52 std::ostringstream error_message;
56 error_message <<
"Range Error: Value " <<
i
57 <<
" is not in the range (0," <<
Nvalue - 1 <<
")";
62 error_message <<
"Range Error: Time Value " <<
t
63 <<
" is not in the range (0," <<
ntstorage() - 1 <<
")";
67 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
79 const unsigned n_copies =
Ncopies;
81 Data** new_copy_of_data_pt =
new Data*[n_copies + 1];
83 for (
unsigned i = 0;
i < n_copies;
i++)
88 new_copy_of_data_pt[n_copies] = data_pt;
105 const unsigned n_copies =
Ncopies;
107 unsigned data_index = n_copies;
109 for (
unsigned i = 0;
i < n_copies;
i++)
119 if (data_index == n_copies)
121 std::ostringstream error_stream;
122 error_stream <<
"Data pointer " << data_pt
123 <<
" is not stored as a copy of the data object " <<
this
126 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
131 Data** new_copy_of_data_pt =
new Data*[n_copies - 1];
135 for (
unsigned i = 0;
i < n_copies;
i++)
165 OOMPH_CURRENT_FUNCTION,
166 OOMPH_EXCEPTION_LOCATION);
179 OOMPH_CURRENT_FUNCTION,
180 OOMPH_EXCEPTION_LOCATION);
240 Time_stepper_pt(
Data::Default_static_time_stepper_pt),
259 Time_stepper_pt(
Data::Default_static_time_stepper_pt),
262 Nvalue(initial_n_value)
269 if (initial_n_value > 0)
273 Value =
new double*[initial_n_value];
278 double* values =
new double[initial_n_value];
282 for (
unsigned i = 0;
i < initial_n_value;
i++)
299 Data::Data(TimeStepper*
const& time_stepper_pt_,
300 const unsigned& initial_n_value,
301 const bool& allocate_storage)
304 Time_stepper_pt(time_stepper_pt_),
307 Nvalue(initial_n_value)
315 if ((allocate_storage) && (initial_n_value > 0))
325 Value =
new double*[initial_n_value];
328 double* values =
new double[initial_n_value * n_tstorage];
331 for (
unsigned i = 0;
i < initial_n_value;
i++)
335 Value[
i] = &values[
i * n_tstorage];
337 for (
unsigned t = 0;
t < n_tstorage;
t++)
349 std::ostream&
operator<<(std::ostream& out,
const Data& d)
351 const unsigned nvalue = d.nvalue();
352 const unsigned nt = d.ntstorage();
354 out <<
"Data: [" << std::endl;
356 for (
unsigned j = 0; j < nvalue; j++)
358 out <<
"global eq " << d.eqn_number(j) <<
": [";
359 for (
unsigned t = 0;
t < nt - 1;
t++)
361 out << d.value(
t, j) <<
", ";
363 out << d.value(nt - 1, j) <<
"]" << std::endl;
365 out <<
"]" << std::endl;
376 const unsigned dim = nd.
ndim();
380 out <<
"Position: [";
381 for (
unsigned j = 0; j < dim; j++)
383 out <<
"dimension " << dim <<
": [";
384 for (
unsigned t = 0;
t < nt - 1;
t++)
386 out << nd.
x(
t, j) <<
", ";
388 out << nd.
x(nt - 1, j) <<
"]" << std::endl;
390 out <<
"]" << std::endl;
395 out << dynamic_cast<const Data&>(nd);
407 const bool& preserve_existing_data)
417 unsigned n_preserved_tstorage = 1;
418 if (preserve_existing_data)
420 n_preserved_tstorage = this->
ntstorage();
433 const unsigned n_value =
nvalue();
442 double* values =
new double[n_value * n_tstorage];
446 if (n_tstorage < n_preserved_tstorage)
448 n_preserved_tstorage = n_tstorage;
450 for (
unsigned i = 0;
i < n_value;
i++)
452 for (
unsigned t = 0;
t < n_preserved_tstorage;
t++)
454 values[
i * n_tstorage +
t] =
Value[
i][
t];
462 for (
unsigned i = 0;
i < n_value;
i++)
464 Value[
i] = &values[
i * n_tstorage];
466 for (
unsigned t = n_preserved_tstorage;
t < n_tstorage;
t++)
506 const unsigned n_value =
nvalue();
507 for (
unsigned i = 0;
i < n_value;
i++)
520 const unsigned n_value =
nvalue();
521 for (
unsigned i = 0;
i < n_value;
i++)
538 const unsigned eqn_number_range =
nvalue();
539 for (
unsigned i = 0;
i < eqn_number_range;
i++)
546 std::ostringstream warn_message;
548 <<
"Node::assign_eqn_numbers(...) noticed that " <<
i
550 <<
"is hanging but not constrained. This shouldn't happen and is\n"
551 <<
"probably because a hanging value was unpinned manually\n"
552 <<
"Rectifying this now...\n";
554 warn_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
577 const unsigned n_value =
nvalue();
579 const unsigned n_storage = n_value * n_time;
582 double* local_value_pt =
Value[0];
585 for (
unsigned i = 0;
i < n_storage; ++
i)
587 if (parameter_pt == (local_value_pt +
i))
604 const unsigned n_value =
nvalue();
608 const unsigned long n_value_orig = orig_data_pt->
nvalue();
609 if (n_value != n_value_orig)
611 std::ostringstream error_stream;
612 error_stream <<
"The number of values, " << n_value
613 <<
" is not the same of those in the original data "
614 << n_value_orig << std::endl;
617 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
619 const unsigned long n_time_orig = orig_data_pt->
ntstorage();
620 if (n_time != n_time_orig)
622 std::ostringstream error_stream;
623 error_stream <<
"The number of time history values, " << n_time
624 <<
" is not the same of those in the original data "
625 << n_time_orig << std::endl;
628 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
632 for (
unsigned t = 0;
t < n_time;
t++)
634 for (
unsigned j = 0; j < n_value; j++)
648 const unsigned value_pt_range =
nvalue();
649 const unsigned time_steps_range =
ntstorage();
652 if (value_pt_range * time_steps_range > 0)
654 dump_file << value_pt_range <<
" # number of data values" << std::endl;
655 dump_file << time_steps_range <<
" # number of doubles for time history"
659 for (
unsigned t = 0;
t < time_steps_range;
t++)
661 for (
unsigned j = 0; j < value_pt_range; j++)
663 dump_file <<
value(
t, j) << std::endl;
675 std::ostringstream error_stream;
678 const unsigned value_pt_range =
nvalue();
679 const unsigned time_steps_range =
ntstorage();
682 if (value_pt_range * time_steps_range > 0)
685 getline(restart_file, input_string,
'#');
687 restart_file.ignore(80,
'\n');
689 const unsigned long check_nvalues = atoi(input_string.c_str());
690 if (check_nvalues != value_pt_range)
693 <<
"Number of values stored in dump file is not equal to the amount "
694 <<
"of storage allocated in Data object " << check_nvalues <<
" "
696 if (check_nvalues > value_pt_range)
698 error_stream <<
" [ignoring extra entries]";
700 error_stream << std::endl;
701 Node* nod_pt =
dynamic_cast<Node*
>(
this);
704 unsigned n_dim = nod_pt->
ndim();
705 error_stream <<
"Node coordinates: ";
706 for (
unsigned i = 0;
i < n_dim;
i++)
708 error_stream << nod_pt->
x(
i) <<
" ";
710 error_stream << nod_pt <<
" ";
712 if (nod_pt->is_halo())
714 error_stream <<
" (halo)\n";
718 error_stream <<
" (not halo)\n";
722 if (check_nvalues < value_pt_range)
725 OOMPH_CURRENT_FUNCTION,
726 OOMPH_EXCEPTION_LOCATION);
731 getline(restart_file, input_string,
'#');
734 restart_file.ignore(80,
'\n');
737 const unsigned check_ntvalues = atoi(input_string.c_str());
740 if (check_ntvalues < time_steps_range)
742 std::ostringstream warning_stream;
743 warning_stream <<
"Number of time history values in dump file is less "
744 <<
"than the storage allocated in Data object: "
745 << check_ntvalues <<
" " << time_steps_range
748 <<
"We're using steady data as initial data for unsteady \n"
749 <<
"run. I'll fill in the remaining history values with zeroes. \n"
750 <<
"If you don't like this \n"
751 <<
"you'll have to overwrite this yourself with whatever is \n "
752 <<
"appropriate for your timestepping scheme. \n";
755 warning_stream.str(),
"Data::read()", OOMPH_EXCEPTION_LOCATION);
758 for (
unsigned t = 0;
t < time_steps_range;
t++)
760 for (
unsigned j = 0; j < check_nvalues; j++)
765 getline(restart_file, input_string);
768 if (j < value_pt_range)
774 error_stream <<
"Not setting j=" << j
775 <<
" -th history restart value [t = " <<
t
776 <<
" ] to " << atof(input_string.c_str())
778 <<
" hasn't been sufficiently resized\n";
783 if (j < value_pt_range)
789 error_stream <<
"Not setting j=" << j
790 <<
" -th restart history value [t = " <<
t
791 <<
" ] to " << 0.0 <<
" because Data "
792 <<
" hasn't been sufficiently resized\n";
799 else if (check_ntvalues > time_steps_range)
801 std::ostringstream warning_stream;
803 <<
"Warning: number of time history values in dump file is greater "
804 <<
"than the storage allocated in Data object: " << check_ntvalues
805 <<
" " << time_steps_range << std::endl;
806 warning_stream <<
"We're using the current values from an unsteady \n"
807 <<
"restart file to initialise a static run. \n";
810 warning_stream.str(),
"Data::read()", OOMPH_EXCEPTION_LOCATION);
813 for (
unsigned t = 0;
t < check_ntvalues;
t++)
815 for (
unsigned j = 0; j < check_nvalues; j++)
818 getline(restart_file, input_string);
822 if (j < value_pt_range)
828 error_stream <<
"Not setting j=" << j
829 <<
" -th restart history value [t = " <<
t
830 <<
" ] to " << atof(input_string.c_str())
832 <<
" hasn't been sufficiently resized\n";
842 for (
unsigned t = 0;
t < time_steps_range;
t++)
844 for (
unsigned j = 0; j < check_nvalues; j++)
847 getline(restart_file, input_string);
850 if (j < value_pt_range)
856 error_stream <<
"Not setting j=" << j
857 <<
" -th restart history value [t = " <<
t
858 <<
" ] to " << atof(input_string.c_str())
860 <<
" hasn't been sufficiently resized\n";
865 if (check_nvalues > value_pt_range)
868 error_stream.str(),
"Data::read()", OOMPH_EXCEPTION_LOCATION);
901 const unsigned eqn_number_range =
Nvalue;
902 for (
unsigned i = 0;
i < eqn_number_range;
i++)
943 const unsigned eqn_number_range =
Nvalue;
944 for (
unsigned i = 0;
i < eqn_number_range;
i++)
953 out <<
"Eqn: " <<
eqn_number <<
" | Value " <<
i << current_string
971 const unsigned eqn_number_range =
Nvalue;
972 for (
unsigned i = 0;
i < eqn_number_range;
i++)
978 oomph_info <<
"\n ERROR: Failed Data::self_test() for i=" <<
i
980 oomph_info <<
" (Value is not classified as pinned or free)"
1005 const unsigned n_value_old =
nvalue();
1007 const unsigned n_value_new = n_value;
1010 if (n_value_new == n_value_old)
1017 if (n_value_new < n_value_old)
1019 std::ostringstream error_stream;
1020 error_stream <<
"Warning : Data cannot be resized to a smaller value!"
1023 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1032 double** value_new_pt =
new double*[n_value_new];
1033 long* eqn_number_new =
new long[n_value_new];
1036 double* values =
new double[n_value_new * t_storage];
1039 for (
unsigned i = 0;
i < n_value_old;
i++)
1042 value_new_pt[
i] = &values[
i * t_storage];
1044 for (
unsigned t = 0;
t < t_storage;
t++)
1054 for (
unsigned i = n_value_old;
i < n_value_new;
i++)
1057 value_new_pt[
i] = &values[
i * t_storage];
1059 for (
unsigned t = 0;
t < t_storage;
t++)
1061 value_new_pt[
i][
t] = 0.0;
1072 if (n_value_old != 0)
delete[]
Value[0];
1074 Value = value_new_pt;
1092 const unsigned n_value = this->
nvalue();
1094 for (
unsigned i = 0;
i < n_value;
i++)
1098 if (global_eqn >= 0)
1100 map_of_value_pt[
static_cast<unsigned>(global_eqn)] = this->
value_pt(
i);
1105 #ifdef OOMPH_HAS_MPI
1115 const unsigned n_value = this->
nvalue();
1128 const unsigned n_tstorage = this->
ntstorage();
1131 const unsigned n_current_value = vector_of_values.size();
1134 unsigned n_debug = 2;
1136 unsigned n_debug = 0;
1139 vector_of_values.resize(n_current_value + n_tstorage * n_value + n_debug);
1142 unsigned index = n_current_value;
1145 vector_of_values[index++] = n_tstorage;
1146 vector_of_values[index++] = n_value;
1155 double* data_pt =
Value[0];
1158 for (
unsigned i = 0;
i < n_value;
i++)
1161 for (
unsigned t = 0;
t < n_tstorage;
t++)
1164 vector_of_values[index] = *data_pt;
1186 unsigned n_value = this->
nvalue();
1189 const unsigned n_tstorage = this->
ntstorage();
1192 unsigned orig_n_tstorage = unsigned(vector_of_values[index++]);
1193 unsigned orig_n_value = unsigned(vector_of_values[index++]);
1194 if ((orig_n_tstorage != n_tstorage) || (orig_n_value != n_value))
1196 std::ostringstream error_stream;
1197 error_stream <<
"Non-matching number of values:\n"
1198 <<
"sent and local n_tstorage: " << orig_n_tstorage <<
" "
1199 << n_tstorage << std::endl
1200 <<
"sent and local n_value: " << orig_n_value <<
" "
1201 << n_value << std::endl;
1203 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1214 double* data_pt =
Value[0];
1217 for (
unsigned i = 0;
i < n_value;
i++)
1220 for (
unsigned t = 0;
t < n_tstorage;
t++)
1223 *data_pt = vector_of_values[index];
1239 const unsigned n_value = this->
nvalue();
1247 const unsigned n_current_value = vector_of_eqn_numbers.size();
1248 vector_of_eqn_numbers.resize(n_current_value + n_value);
1251 unsigned index = n_current_value;
1255 for (
unsigned i = 0;
i < n_value;
i++)
1275 const Vector<long>& vector_of_eqn_numbers,
unsigned& index)
1278 const unsigned n_value = this->
nvalue();
1288 for (
unsigned i = 0;
i < n_value;
i++)
1333 :
Data(data_pt->time_stepper_pt(), 1, false),
1334 Copied_data_pt(data_pt),
1335 Copied_index(copied_index)
1340 std::ostringstream error_stream;
1341 error_stream <<
"The data you are trying to hijack is already a copy"
1343 error_stream <<
"Please copy the original data" << std::endl;
1344 error_stream <<
"In a later version, I might do this for you,"
1345 <<
" but not today" << std::endl;
1348 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1366 OOMPH_CURRENT_FUNCTION,
1367 OOMPH_EXCEPTION_LOCATION);
1410 :
Data(data_pt->time_stepper_pt(), data_pt->nvalue(), false),
1411 Copied_data_pt(data_pt)
1416 std::ostringstream error_stream;
1417 error_stream <<
"The data you are trying to copy is already a copy"
1419 error_stream <<
"Please copy the original data" << std::endl;
1420 error_stream <<
"In a later version, I might do this for you,"
1421 <<
" but not today" << std::endl;
1424 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1441 OOMPH_CURRENT_FUNCTION,
1442 OOMPH_EXCEPTION_LOCATION);
1462 std::ostringstream error_message;
1463 error_message <<
"Range Error: the index " <<
i
1464 <<
" is not in the range (0," <<
Nmaster - 1 <<
")";
1466 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1475 Node*
const& master_node_pt_,
1476 const double& weight)
1478 #ifdef RANGE_CHECKING
1490 const double& weight)
1493 const unsigned n_master =
Nmaster;
1495 Node** new_master_nodes_pt =
new Node*[n_master + 1];
1496 double* new_master_weights =
new double[n_master + 1];
1499 for (
unsigned i = 0;
i < n_master;
i++)
1505 new_master_nodes_pt[n_master] = master_node_pt_;
1506 new_master_weights[n_master] = weight;
1530 const unsigned&
i)
const
1537 std::ostringstream error_message;
1541 error_message <<
"Range Error: X coordinate " <<
i
1542 <<
" is not in the range (0," <<
Ndim - 1 <<
")";
1547 error_message <<
"Range Error: Position type " << k
1552 if (
t >= position_ntstorage)
1554 error_message <<
"Range Error: Position Time Value " <<
t
1555 <<
" is not in the range (0," << position_ntstorage - 1
1560 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1576 Position_time_stepper_pt(
Data::Default_static_time_stepper_pt),
1581 Aux_node_update_fct_pt(0)
1596 const unsigned& n_position_type,
1597 const unsigned& initial_n_value,
1598 const bool& allocate_x_position)
1599 :
Data(initial_n_value),
1601 Position_time_stepper_pt(
Data::Default_static_time_stepper_pt),
1604 Nposition_type(n_position_type),
1606 Aux_node_update_fct_pt(0)
1613 const unsigned n_storage = n_dim * n_position_type;
1617 if (allocate_x_position)
1623 double* x_positions =
new double[n_storage];
1626 for (
unsigned j = 0; j < n_storage; j++)
1645 const unsigned& n_dim,
1646 const unsigned& n_position_type,
1647 const unsigned& initial_n_value,
1648 const bool& allocate_x_position)
1649 :
Data(time_stepper_pt_, initial_n_value),
1651 Position_time_stepper_pt(time_stepper_pt_),
1654 Nposition_type(n_position_type),
1656 Aux_node_update_fct_pt(0)
1663 const unsigned n_storage = n_dim * n_position_type;
1666 if (allocate_x_position)
1675 double* x_positions =
new double[n_storage * n_tstorage];
1678 for (
unsigned j = 0; j < n_storage; j++)
1681 X_position[j] = &x_positions[j * n_tstorage];
1683 for (
unsigned t = 0;
t < n_tstorage;
t++)
1705 const unsigned nhang =
nvalue() + 1;
1706 for (
unsigned ival = 1; ival < nhang; ival++)
1754 const bool& preserve_existing_data)
1763 unsigned n_preserved_tstorage = 1;
1764 if (preserve_existing_data)
1779 double* x_positions =
new double[n_storage * n_tstorage];
1783 if (n_tstorage < n_preserved_tstorage)
1785 n_preserved_tstorage = n_tstorage;
1789 for (
unsigned j = 0; j < n_storage; ++j)
1791 for (
unsigned t = 0;
t < n_preserved_tstorage;
t++)
1793 x_positions[j * n_tstorage +
t] = this->
X_position[j][
t];
1801 for (
unsigned j = 0; j < n_storage; j++)
1804 X_position[j] = &x_positions[j * n_tstorage];
1806 for (
unsigned t = n_preserved_tstorage;
t < n_tstorage;
t++)
1828 for (
unsigned t = 0;
t < n_time;
t++)
1852 for (
unsigned t = 0;
t < n_time;
t++)
1877 for (
unsigned t = 0;
t < n_time;
t++)
1892 const unsigned&
i)
const
1903 for (
unsigned t = 0;
t < n_time;
t++)
1922 const unsigned long npos_storage_orig =
1924 if (npos_storage != npos_storage_orig)
1926 std::ostringstream error_stream;
1927 error_stream <<
"The allocated positional storage " << npos_storage
1928 <<
" is not the same as the original Node "
1929 << npos_storage_orig << std::endl;
1932 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1939 const unsigned long n_time_orig =
1941 if (n_time != n_time_orig)
1943 std::ostringstream error_stream;
1944 error_stream <<
"The number of positional time history values, " << n_time
1945 <<
" is not the same of those in the original node "
1946 << n_time_orig << std::endl;
1949 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1953 for (
unsigned t = 0;
t < n_time;
t++)
1955 for (
unsigned j = 0; j < npos_storage; j++)
1973 dump_file << npos_storage <<
" # number of fixed position variables"
1977 dump_file << Time_steps_range
1978 <<
" # total number of doubles for time history (incl present)"
1981 for (
unsigned t = 0;
t < Time_steps_range;
t++)
1983 for (
unsigned j = 0; j < npos_storage; j++)
2004 getline(restart_file, input_string,
'#');
2006 restart_file.ignore(80,
'\n');
2008 const unsigned long check_npos_storage = atoi(input_string.c_str());
2009 if (check_npos_storage != npos_storage)
2011 std::ostringstream error_stream;
2012 error_stream <<
"The allocated positional storage " << npos_storage
2013 <<
" is not the same as that in the input file"
2014 << check_npos_storage << std::endl;
2017 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2024 getline(restart_file, input_string,
'#');
2026 restart_file.ignore(80,
'\n');
2028 const unsigned long check_time_steps_range = atoi(input_string.c_str());
2029 if (check_time_steps_range != time_steps_range)
2031 std::ostringstream error_stream;
2033 <<
"Number of positional history values in dump file is less "
2034 <<
"than the storage allocated in Node object: "
2035 << check_time_steps_range <<
" " << time_steps_range << std::endl;
2038 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2042 for (
unsigned t = 0;
t < time_steps_range;
t++)
2044 for (
unsigned j = 0; j < npos_storage; j++)
2047 getline(restart_file, input_string);
2072 unsigned n_hang =
nvalue() + 1;
2080 for (
unsigned n = 0; n < n_hang; n++)
2090 std::vector<bool> Same_as_geometric(n_hang,
true);
2093 for (
unsigned n = 1; n < n_hang; n++)
2097 Same_as_geometric[n] =
false;
2119 for (
unsigned n = 1; n < n_hang; n++)
2121 if (Same_as_geometric[n] ==
true)
2170 unsigned old_nvalue =
nvalue();
2177 backup_hanging_pt =
new HangInfo*[old_nvalue + 1];
2180 for (
unsigned i = 0;
i < old_nvalue + 1;
i++)
2195 if (backup_hanging_pt != 0)
2198 const unsigned n_hang = n_value + 1;
2201 for (
unsigned i = 0;
i < n_hang;
i++)
2207 for (
unsigned i = 0;
i <= old_nvalue;
i++)
2213 for (
unsigned i = old_nvalue + 1;
i < n_hang;
i++)
2248 delete[] backup_hanging_pt;
2259 throw OomphLibError(
"Only BoundaryNodes can be made periodic",
2260 OOMPH_CURRENT_FUNCTION,
2261 OOMPH_EXCEPTION_LOCATION);
2272 throw OomphLibError(
"Only BoundaryNodes can make periodic nodes",
2273 OOMPH_CURRENT_FUNCTION,
2274 OOMPH_EXCEPTION_LOCATION);
2286 const unsigned nhang =
nvalue() + 1;
2287 for (
unsigned ival = 1; ival < nhang; ival++)
2325 std::stringstream ss;
2326 ss <<
"Node (bas class) can't have boundary coordinates\n";
2328 ss.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2338 std::stringstream ss;
2339 ss <<
"Cannot add non BoundaryNode<NODE> to boundary " << b <<
"\n";
2341 ss.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2352 throw OomphLibError(
"Cannot remove non BoundaryNode<NODE> to boundary",
2353 OOMPH_CURRENT_FUNCTION,
2354 OOMPH_EXCEPTION_LOCATION);
2365 throw OomphLibError(
"Non-boundary Node cannot have boundary coordinates",
2366 OOMPH_CURRENT_FUNCTION,
2367 OOMPH_EXCEPTION_LOCATION);
2383 throw OomphLibError(
"Non-boundary Node cannot have boundary coordinates",
2384 OOMPH_CURRENT_FUNCTION,
2385 OOMPH_EXCEPTION_LOCATION);
2398 throw OomphLibError(
"Non-boundary Node cannot have boundary coordinates",
2399 OOMPH_CURRENT_FUNCTION,
2400 OOMPH_EXCEPTION_LOCATION);
2422 for (
unsigned m = 0; m < n_master; m++)
2452 for (
unsigned m = 0; m < n_master; m++)
2469 const unsigned n_value =
nvalue();
2470 for (
unsigned i = 0;
i < n_value;
i++)
2485 const unsigned n_value =
nvalue();
2486 for (
unsigned i = 0;
i < n_value;
i++)
2502 const unsigned n_dim =
ndim();
2503 for (
unsigned i = 0;
i < n_dim;
i++)
2517 const unsigned n_dim =
ndim();
2518 for (
unsigned i = 0;
i < n_dim;
i++)
2541 double interpolated_position = 0.0;
2545 for (
unsigned m = 0; m < n_master; m++)
2550 posn = interpolated_position;
2573 double interpolated_position = 0.0;
2577 for (
unsigned m = 0; m < n_master; m++)
2582 posn = interpolated_position;
2605 double interpolated_position = 0.0;
2609 for (
unsigned m = 0; m < n_master; m++)
2614 posn = interpolated_position;
2626 const unsigned&
i)
const
2639 double interpolated_position = 0.0;
2643 for (
unsigned m = 0; m < n_master; m++)
2645 interpolated_position +=
2649 posn = interpolated_position;
2670 for (
unsigned t = 0;
t < n_time;
t++)
2694 for (
unsigned t = 0;
t < n_time;
t++)
2720 for (
unsigned t = 0;
t < n_time;
t++)
2736 const unsigned&
i)
const
2747 for (
unsigned t = 0;
t < n_time;
t++)
2763 const unsigned n_dim = this->
ndim();
2764 for (
unsigned i = 0;
i < n_dim;
i++)
2766 outfile <<
x(
i) <<
" ";
2768 outfile << std::endl;
2772 #ifdef OOMPH_HAS_MPI
2791 const unsigned n_current_value = vector_of_values.size();
2794 unsigned n_debug = 2;
2796 unsigned n_debug = 0;
2799 vector_of_values.resize(n_current_value + n_tstorage * n_storage + n_debug);
2802 unsigned index = n_current_value;
2805 vector_of_values[index++] = n_storage;
2806 vector_of_values[index++] = n_tstorage;
2814 for (
unsigned i = 0;
i < n_storage;
i++)
2817 for (
unsigned t = 0;
t < n_tstorage;
t++)
2820 vector_of_values[index] = *data_pt;
2847 unsigned orig_n_storage = unsigned(vector_of_values[index++]);
2848 unsigned orig_n_tstorage = unsigned(vector_of_values[index++]);
2849 if ((orig_n_tstorage != n_tstorage) || (orig_n_storage != n_storage))
2851 std::ostringstream error_stream;
2852 error_stream <<
"Non-matching number of values:\n"
2853 <<
"sent and local n_tstorage: " << orig_n_tstorage <<
" "
2854 << n_tstorage << std::endl
2855 <<
"sent and local n_storage: " << orig_n_storage <<
" "
2856 << n_storage << std::endl;
2858 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2866 for (
unsigned i = 0;
i < n_storage;
i++)
2869 for (
unsigned t = 0;
t < n_tstorage;
t++)
2872 *data_pt = vector_of_values[index];
2901 bool already_a_copy =
false;
2902 already_a_copy |= copied_node_pt->
is_a_copy();
2903 const unsigned n_periodic = periodic_copies_pt.size();
2904 for (
unsigned n = 0; n < n_periodic; n++)
2906 already_a_copy |= periodic_copies_pt[n]->is_a_copy();
2912 std::ostringstream error_stream;
2914 <<
"The nodes you are trying to make periodic are already periodic\n"
2915 <<
"Or you are trying to make a copy of another already periodic "
2917 error_stream <<
"Please copy the original data if you can\n";
2919 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2923 for (
unsigned n = 0; n < n_periodic; n++)
2926 Node*
const nod_pt = periodic_copies_pt[n];
2928 if (nod_pt != copied_node_pt)
2952 Node*
const& copied_node_pt)
2958 std::ostringstream error_stream;
2959 error_stream <<
"The node you are trying to make into a periodic copy is "
2960 "already a copy\n.";
2962 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3067 std::ostringstream error_stream;
3068 error_stream <<
"Node is not on boundary " << b << std::endl;
3071 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3083 delete (*Boundary_coordinates_pt)[b];
3126 OOMPH_CURRENT_FUNCTION,
3127 OOMPH_EXCEPTION_LOCATION);
3134 std::ostringstream error_stream;
3135 error_stream <<
"Node is not on boundary " << b << std::endl;
3138 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3144 std::ostringstream error_stream;
3146 <<
"Boundary coordinates have not been set\n"
3147 <<
"[Note: In refineable problems, the boundary coordinates\n"
3148 <<
" will only be interpolated to newly created nodes\n"
3149 <<
" if Mesh::Boundary_coordinate_exists[...] has been\n"
3150 <<
" set to true!]\n";
3152 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3166 const unsigned& b,
const unsigned& k,
Vector<double>& boundary_zeta)
3173 OOMPH_CURRENT_FUNCTION,
3174 OOMPH_EXCEPTION_LOCATION);
3181 std::ostringstream error_stream;
3182 error_stream <<
"Node is not on boundary " << b << std::endl;
3185 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3193 std::ostringstream error_stream;
3195 <<
"Boundary coordinates have not been set\n"
3196 <<
"[Note: In refineable problems, the boundary coordinates\n"
3197 <<
" will only be interpolated to newly created nodes\n"
3198 <<
" if Mesh::Boundary_coordinate_exists[...] has been\n"
3199 <<
" set to true!]\n";
3201 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3207 const unsigned nboundary_coord = (*Boundary_coordinates_pt)[b]->nrow();
3209 if (nboundary_coord != boundary_zeta.size())
3211 std::ostringstream error_stream;
3212 error_stream <<
"Wrong number of coordinates in the vector boundary_zeta"
3214 <<
"There are " << nboundary_coord <<
" boundary coordinates"
3216 <<
"But bounday_zeta() has size " << boundary_zeta.size()
3220 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3225 for (
unsigned i = 0;
i < nboundary_coord;
i++)
3227 boundary_zeta[
i] = (*(*Boundary_coordinates_pt)[b])(
i, k);
3237 const unsigned& b,
const unsigned& k,
const Vector<double>& boundary_zeta)
3244 OOMPH_CURRENT_FUNCTION,
3245 OOMPH_EXCEPTION_LOCATION);
3252 std::ostringstream error_stream;
3253 error_stream <<
"Node is not on boundary " << b << std::endl;
3256 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3267 const unsigned nboundary_coord = boundary_zeta.size();
3273 (*Boundary_coordinates_pt)[b] =
3281 unsigned ncol = (*Boundary_coordinates_pt)[b]->ncol();
3283 (*Boundary_coordinates_pt)[b]->resize(nboundary_coord, ncol);
3289 (*Boundary_coordinates_pt)[b]->resize(nboundary_coord, k + 1);
3294 for (
unsigned i = 0;
i < nboundary_coord;
i++)
3296 (*(*Boundary_coordinates_pt)[b])(
i, k) = boundary_zeta[
i];
3317 std::ostringstream error_message;
3321 error_message <<
"Range Error: Xi coordinate " <<
i
3322 <<
" is not in the range (0," <<
Nlagrangian - 1 <<
")";
3327 error_message <<
"Range Error: Lagrangian type " << k
3333 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3349 const unsigned& n_lagrangian_type,
3350 const unsigned& n_dim,
3351 const unsigned& n_position_type,
3352 const unsigned& initial_n_value)
3353 :
Node(n_dim, n_position_type, initial_n_value, false),
3354 Nlagrangian(n_lagrangian),
3355 Nlagrangian_type(n_lagrangian_type)
3366 const unsigned n_lagrangian_storage = n_lagrangian * n_lagrangian_type;
3369 for (
unsigned j = 0; j < n_lagrangian_storage; j++)
3385 const unsigned& n_lagrangian,
3386 const unsigned& n_lagrangian_type,
3387 const unsigned& n_dim,
3388 const unsigned& n_position_type,
3389 const unsigned& initial_n_value)
3390 :
Node(time_stepper_pt_, n_dim, n_position_type, initial_n_value, false),
3391 Nlagrangian(n_lagrangian),
3392 Nlagrangian_type(n_lagrangian_type)
3395 const unsigned n_storage = n_dim * n_position_type;
3403 const unsigned n_lagrangian_storage = n_lagrangian * n_lagrangian_type;
3406 for (
unsigned j = 0; j < n_lagrangian_storage; j++)
3443 const unsigned long nlagrangian_storage_orig =
3445 if (nlagrangian_storage != nlagrangian_storage_orig)
3447 std::ostringstream error_stream;
3448 error_stream <<
"The allocated lagrangian storage " << nlagrangian_storage
3449 <<
" is not the same as the original Solid Node "
3450 << nlagrangian_storage_orig << std::endl;
3453 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3457 for (
unsigned j = 0; j < nlagrangian_storage; j++)
3475 dump_file << nlagrangian_storage
3476 <<
" # number of Lagrangian position variables" << std::endl;
3478 for (
unsigned j = 0; j < nlagrangian_storage; j++)
3498 getline(restart_file, input_string,
'#');
3500 restart_file.ignore(80,
'\n');
3502 const unsigned long check_nlagrangian_storage = atoi(input_string.c_str());
3503 if (check_nlagrangian_storage != nlagrangian_storage)
3505 std::ostringstream error_stream;
3506 error_stream <<
"The allocated Lagrangian storage " << nlagrangian_storage
3507 <<
" is not the same as that in the input file"
3508 << check_nlagrangian_storage << std::endl;
3511 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3515 for (
unsigned j = 0; j < nlagrangian_storage; j++)
3518 getline(restart_file, input_string);
3550 const bool& preserve_existing_data)
3563 preserve_existing_data);
3574 double*
const& parameter_pt)
3599 double lagn_position = 0.0;
3603 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
3610 posn = lagn_position;
3620 const unsigned&
i)
const
3633 double lagn_position = 0.0;
3637 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
3644 posn = lagn_position;
3676 std::stringstream conversion;
3677 conversion <<
" of Solid Node Position" << current_string;
3683 std::stringstream conversion;
3684 conversion <<
" of Data" << current_string;
3694 std::map<unsigned, double*>& map_of_value_pt)
3703 #ifdef OOMPH_HAS_MPI
3716 const unsigned n_lagrangian_storage =
3720 const unsigned n_current_value = vector_of_values.size();
3723 unsigned n_debug = 1;
3725 unsigned n_debug = 0;
3728 vector_of_values.resize(n_current_value + n_lagrangian_storage + n_debug);
3731 unsigned index = n_current_value;
3734 vector_of_values[index++] = n_lagrangian_storage;
3741 for (
unsigned i = 0;
i < n_lagrangian_storage;
i++)
3744 vector_of_values[index] = *data_pt;
3764 const unsigned n_lagrangian_storage =
3768 unsigned orig_n_lagrangian_storage = unsigned(vector_of_values[index++]);
3769 if (orig_n_lagrangian_storage != n_lagrangian_storage)
3771 std::ostringstream error_stream;
3772 error_stream <<
"Non-matching number of values:\n"
3773 <<
"sent and local n_lagrangian_storage: "
3774 << orig_n_lagrangian_storage <<
" " << n_lagrangian_storage
3777 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3785 for (
unsigned i = 0;
i < n_lagrangian_storage;
i++)
3788 *data_pt = vector_of_values[index];
3812 const Vector<long>& vector_of_eqn_numbers,
unsigned& index)
A class that contains the information required by Nodes that are located on Mesh boundaries....
unsigned ncoordinates_on_boundary(const unsigned &b)
Get the number of boundary coordinates on mesh boundary b.
std::set< unsigned > * Boundaries_pt
Pointer to set of mesh boundaries occupied by the Node; NULL if the Node is not on any boundaries.
void set_coordinates_on_boundary(const unsigned &b, const Vector< double > &boundary_zeta)
Set the vector of boundary coordinates on mesh boundary b.
void make_node_periodic(Node *const &node_pt, Node *const &original_node_pt)
Helper function that is used to turn BoundaryNodes into peridic boundary nodes by setting the data va...
void make_nodes_periodic(Node *const &node_pt, Vector< Node * > const &periodic_copies_pt)
Helper function that is used to turn BoundaryNodes into periodic boundary nodes by setting the data v...
void add_to_boundary(const unsigned &b)
Add the node to the mesh boundary b.
Node * Copied_node_pt
If the BoundaryNode is periodic, this pointer is set to the BoundaryNode whose data it shares.
void get_coordinates_on_boundary(const unsigned &b, Vector< double > &boundary_zeta)
Return the vector of boundary coordinates on mesh boundary b.
std::map< unsigned, DenseMatrix< double > * > * Boundary_coordinates_pt
Pointer to a map of pointers to intrinsic boundary coordinates of the Node, indexed by the boundary n...
std::map< unsigned, unsigned > * Index_of_first_value_assigned_by_face_element_pt
Pointer to a map, indexed by the face element identifier it returns the position of the first face el...
bool is_on_boundary() const
Test whether the node lies on a boundary.
void remove_from_boundary(const unsigned &b)
Remove the node from the mesh boundary b.
virtual ~BoundaryNodeBase()
Destructor, clean up any allocated storage for the boundaries.
Data * Copied_data_pt
Pointer to the Data object from which the values are copied.
void clear_copied_pointers()
Clear the pointers to the copied data.
void reset_copied_pointers()
Reset the pointers to the copied data.
void resize(const unsigned &n_value)
We cannot resize CopiedData, so the resize function throws a warning.
A class that represents a collection of data; each Data object may contain many different individual ...
static TimeStepper * Default_static_time_stepper_pt
Default (static) timestepper used in steady problems.
void add_copy(Data *const &data_pt)
Add the pointer data_pt to the array Copy_of_data_pt. This should be used whenever copies are made of...
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
long * Eqn_number
C-style array of pointers to the (global) equation numbers of the values.
virtual void add_eqn_numbers_to_vector(Vector< long > &vector_of_eqn_numbers)
Add all equation numbers to the vector in the internal storage order.
bool does_pointer_correspond_to_value(double *const ¶meter_pt)
Check whether the pointer parameter_pt addresses internal data values.
void constrain(const unsigned &i)
Constrain the i-th stored variable when making hanging data If the data is already pinned leave it al...
virtual void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Node. The ostream specifies the output stream to which the descr...
virtual void add_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Add pointers to all unpinned and unconstrained data to a map indexed by (global) equation number.
long * eqn_number_pt(const unsigned &i)
Return the pointer to the equation number of the i-th stored variable.
unsigned Nvalue
Number of values stored in the data object.
static long Is_pinned
Static "Magic number" used in place of the equation number to indicate that the value is pinned.
void range_check(const unsigned &t, const unsigned &i) const
Check that the arguments are within the range of the stored data values and timesteps.
void remove_copy(Data *const &data_pt)
Remove the pointer data_pt from the array Copy_of_data_pt. This should be used whenever copies of the...
virtual void clear_copied_pointers()
Helper function that should be overloaded derived classes that contain copies of data....
friend class HijackedData
bool is_segregated_solve_pinned(const unsigned &i)
Test whether the i-th variable is temporaily pinned for a segregated solve.
Data ** Copy_of_data_pt
C-style array of any Data objects that contain copies of the current Data object's data values.
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
void copy(Data *orig_data_pt)
Copy Data values from specified Data object.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
bool is_halo() const
Is this Data a halo?
TimeStepper * Time_stepper_pt
Pointer to a Timestepper. The inclusion of a Timestepper pointer in the Data class,...
virtual void read_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all data and time history values from the vector starting from index. On return the index will b...
virtual void add_values_to_vector(Vector< double > &vector_of_values)
Add all data and time history values to the vector in the internal storage order.
static long Is_constrained
Static "Magic number" used in place of the equation number to indicate that the value is constrained ...
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
virtual bool is_a_copy() const
Return a boolean to indicate whether the Data objact contains any copied values. A base Data object c...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
unsigned Ncopies
Number of Data that contain copies of this Data object's values.
void dump(std::ostream &dump_file) const
Dump the data object to a file.
virtual ~Data()
Destructor, deallocates memory assigned for data.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
virtual void assign_eqn_numbers(unsigned long &global_ndof, Vector< double * > &dof_pt)
Assign global equation numbers; increment global number of unknowns, global_ndof; and add any new dof...
double ** Value
C-style array of pointers to data values and possible history values. The data must be ordered in suc...
bool is_constrained(const unsigned &i)
Test whether the i-th variable is constrained (1: true; 0: false).
static long Is_unclassified
Static "Magic number" used in place of the equation number to denote a value that hasn't been classif...
void delete_value_storage()
Delete all storage allocated by the Data object for values and equation numbers.
virtual void resize(const unsigned &n_value)
Change (increase) the number of values that may be stored.
Data()
Default: Just set pointer to (steady) timestepper. No storage for values is allocated.
void unconstrain(const unsigned &i)
Unconstrain the i-th stored variable when make the data nonhanging. Only unconstrain if it was actual...
void set_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set a new timestepper by resizing the appropriate storage. If already assigned the equation numbering...
void read(std::ifstream &restart_file)
Read data object from a file.
static long Is_segregated_solve_pinned
Static "Magic number" used in place of the equation number to indicate that the value is pinned,...
unsigned self_test()
Self-test: Have all values been classified as pinned/unpinned? Return 0 if OK.
virtual void read_eqn_numbers_from_vector(const Vector< long > &vector_of_eqn_numbers, unsigned &index)
Read all equation numbers from the vector starting from index. On return the index will be set to the...
bool is_pinned(const unsigned &i) const
Test whether the i-th variable is pinned (1: true; 0: false).
virtual void reset_copied_pointers()
Helper function that should be overloaded in derived classes that can contain copies of Data....
Class that contains data for hanging nodes.
Node ** Master_nodes_pt
C-style array of pointers to nodes that this hanging node depends on.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
void range_check(const unsigned &i) const
Check that the argument is within the range of stored data values.
unsigned Nmaster
Number of master nodes required by this hanging node.
unsigned nmaster() const
Return the number of master nodes.
double * Master_weights
C-style array of weights for the dofs on the master nodes.
void add_master_node_pt(Node *const &master_node_pt, const double &weight)
Add (pointer to) master node and corresponding weight to the internally stored (pointers to) master n...
void set_master_node_pt(const unsigned &i, Node *const &master_node_pt, const double &weight)
Set the pointer to the i-th master node and its weight.
Data * Copied_data_pt
Pointer to the Data object from which the value is copied.
unsigned Copied_index
Index of the value that is copied from within the Data object.
void resize(const unsigned &n_value)
We cannot resize HijackedData, so the resize function throws a warning.
void reset_copied_pointers()
Reset the pointers to the copied data.
void clear_copied_pointers()
Clear the pointers to the copied data.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double dx_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
double & x(const unsigned &i)
Return the i-th nodal coordinate.
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
void copy(Node *orig_node_pt)
Copy all nodal data from specified Node object.
void add_values_to_vector(Vector< double > &vector_of_values)
Add all data and time history values to the vector. Overloaded to add the position information as wel...
virtual void set_position_time_stepper(TimeStepper *const &position_time_stepper_pt, const bool &preserve_existing_data)
Set a new position timestepper be resizing the appropriate storage.
virtual unsigned ncoordinates_on_boundary(const unsigned &b)
Get the number of boundary coordinates on mesh boundary b. Broken virtual interface provides run-time...
void set_nonhanging()
Label node as non-hanging node by removing all hanging node data.
void read(std::ifstream &restart_file)
Read nodal position and associated data from file for restart.
static unsigned No_independent_position
Static "Magic number" used to indicate that there is no independent position in a periodic node.
void x_gen_range_check(const unsigned &t, const unsigned &k, const unsigned &i) const
Private function to check that the arguemnts to the position functions are in range.
virtual void assign_eqn_numbers(unsigned long &global_ndof, Vector< double * > &dof_pt)
Assign global equation numbers; increment global number of unknowns, global_ndof; and add any new dof...
virtual void remove_from_boundary(const unsigned &b)
Broken interface for removing the node from the mesh boundary b Here to provide error reporting.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
virtual void make_periodic_nodes(const Vector< Node * > &periodic_nodes_pt)
Make the nodes passed in the vector periodic_nodes share the same data as this node.
virtual void constrain_positions()
Constrain the positions when the node is made hanging Empty virtual function that is overloaded in So...
void output(std::ostream &outfile)
Output nodal position.
TimeStepper * Position_time_stepper_pt
Pointer to the timestepper associated with the position data.
double ** X_position
Array of pointers to the data holding the Eulerian positions. The storage format must be the same as ...
virtual void add_to_boundary(const unsigned &b)
Broken interface for adding the node to the mesh boundary b Essentially here for error reporting.
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
HangInfo ** Hanging_pt
C-style array of pointers to hanging node info. It's set to NULL if the node isn't hanging....
void set_hanging_pt(HangInfo *const &hang_pt, const int &i)
Set the hanging data for the i-th value. (hang_pt=0 to make non-hanging)
Vector< double > value() const
Return vector of values calculated using value(vector).
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
unsigned Nposition_type
Number of coordinate types used in the mapping between local and global coordinates (e....
virtual bool boundary_coordinates_have_been_set_up()
Have boundary coordinates been set up? Broken virtual interface provides run-time error checking.
double position_gen(const unsigned &k, const unsigned &i) const
Return generalised nodal coordinate either directly or via hanging node representation.
unsigned Ndim
Eulerian dimension of the node.
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Return the vector of the k-th generalised boundary coordinates on mesh boundary b....
double raw_value(const unsigned &i) const
Return the i-th value stored at the Node. This interface does NOT take the hanging status of the Node...
virtual void unconstrain_positions()
Unconstrain the positions when the node is made non-hanging Empty virtual function that is overloaded...
Vector< double > position() const
Return vector of position of node at current time.
virtual Node * copied_node_pt() const
Return pointer to copied node (null if the current node is not a copy – always the case here; it's ov...
void read_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all data and time history values from the vector starting from index. On return the index will b...
virtual void dump(std::ostream &dump_file) const
Dump nodal position and associated data to file for restart.
double dposition_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt, either directly or via hanging node representatio...
double dx_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt.
void resize(const unsigned &n_value)
Resize the number of equations.
virtual void make_periodic(Node *const &node_pt)
Make the node periodic by copying the values from node_pt. Note that the coordinates will always rema...
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
bool is_hanging() const
Test whether the node is geometrically hanging.
Node()
Default constructor.
double dposition_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
virtual ~Node()
Destructor: Clean up the memory allocated for nodal position.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
void xi_gen_range_check(const unsigned &k, const unsigned &i) const
Private function to check that the arguments to the position functions are in range.
void set_position_time_stepper(TimeStepper *const &position_time_stepper_pt, const bool &preserve_existing_data)
Set a new position timestepper be resizing the appropriate storage Overloaded from the basic implemen...
unsigned Nlagrangian
Number of Lagrangian coordinates of the node.
void add_values_to_vector(Vector< double > &vector_of_values)
Add all data, position and time history values to the vector Overload to add the Lagrangian coordinat...
bool does_pointer_correspond_to_position_data(double *const ¶meter_pt)
Overload the check whether the pointer parameter_pt addresses position data values.
void read_eqn_numbers_from_vector(const Vector< long > &vector_of_eqn_numbers, unsigned &index)
Read all equation numbers from the vector starting from index. On return the index will be set to the...
unsigned nlagrangian_type() const
Number of types of Lagrangian coordinates used to interpolate the Lagrangian coordinates within the e...
double & xi_gen(const unsigned &k, const unsigned &i)
Reference to the generalised Lagrangian position. ‘Type’: k; 'Coordinate direction: i.
Data * Variable_position_pt
Pointer to data that will hold variable positions in elastic nodes.
void add_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Overload the function add_values_to_map so that it also adds the variable position data.
unsigned Nlagrangian_type
Number of types of Lagrangian coordinates used to interpolate the Lagrangian coordinates within the e...
double lagrangian_position(const unsigned &i) const
Return lagrangian coordinate either directly or via hanging node representation.
double lagrangian_position_gen(const unsigned &k, const unsigned &i) const
Return generalised lagrangian coordinate either directly or via hanging node representation.
SolidNode()
Default Constructor.
void read_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all data and time history values from the vector starting from index. On return the index will b...
virtual ~SolidNode()
Destructor that cleans up the additional memory allocated in SolidNodes.
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Node. The ostream specifies the output stream to which the descr...
void dump(std::ostream &dump_file) const
Dump nodal positions (variable and fixed) and associated data to file for restart.
void set_external_variable_position_pt(Data *const &data_pt)
Set the variable position data from an external data object.
void read(std::ifstream &restart_file)
Read nodal positions (variable and fixed) and associated data from file for restart.
double * Xi_position
Storage for the Lagrangian positions.
double & xi(const unsigned &i)
Reference to i-th Lagrangian position.
void add_eqn_numbers_to_vector(Vector< long > &vector_of_eqn_numbers)
Add all equation numbers to the vector in the internal storage order. Overload to add equation number...
void assign_eqn_numbers(unsigned long &global_number, Vector< double * > &dof_pt)
Overload the assign equation numbers routine.
void copy(SolidNode *orig_node_pt)
Copy nodal positions and associated data from specified node object.
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
unsigned nlagrangian() const
Return number of lagrangian coordinates.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
std::ostream & operator<<(std::ostream &out, const DoubleVector &v)
output operator
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...