29 #ifndef OOMPH_GENERIC_MESH_HEADER
30 #define OOMPH_GENERIC_MESH_HEADER
34 #include <oomph-lib-config.h>
289 std::ostringstream error_stream;
290 error_stream <<
"Empty default reset boundary element info function"
292 error_stream <<
"This should be overloaded in a specific "
293 <<
"TriangleMeshBase\n";
295 "Mesh::reset_boundary_element_info()",
296 OOMPH_EXCEPTION_LOCATION);
302 template<
class BULK_ELEMENT>
308 oomph_info <<
"No boundary coordinates were set up for boundary " << b
320 for (
unsigned e = 0;
e < nel;
e++)
345 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
351 for (
unsigned i = 0;
i < dim;
i++)
353 the_file << x[
i] <<
" ";
355 for (
unsigned i = 0;
i < (dim - 1);
i++)
357 the_file << zeta[
i] <<
" ";
360 the_file << std::endl;
375 unsigned nnod = this->
nnode();
377 for (
unsigned j = 0; j < nnod; j++)
380 for (
unsigned i = 0;
i < dim;
i++)
382 nod_pt->
x(
i) *= factor;
481 OOMPH_CURRENT_FUNCTION,
482 OOMPH_EXCEPTION_LOCATION);
533 const unsigned n_node =
nnode();
534 for (
unsigned nd = 0; nd < n_node; nd++)
541 std::set<unsigned>* boundaries_pt;
545 unsigned max_boundary_n =
546 1 + *std::max_element(boundaries_pt->begin(), boundaries_pt->end());
553 std::set<unsigned>::const_iterator it;
554 for (it = boundaries_pt->begin(); it != boundaries_pt->end(); it++)
574 #ifdef RANGE_CHECKING
577 std::ostringstream error_message;
578 error_message <<
"Range Error: " <<
i <<
" is not in the range (0,"
582 OOMPH_CURRENT_FUNCTION,
583 OOMPH_EXCEPTION_LOCATION);
638 virtual void node_update(
const bool& update_all_solid_nodes =
false);
642 virtual void reorder_nodes(
const bool& use_old_ordering =
true);
648 const bool& use_old_ordering =
true)
const;
652 template<
class BULK_ELEMENT,
template<
class>
class FACE_ELEMENT>
658 for (
unsigned n = 0; n < nbound_node; n++)
666 for (
unsigned e = 0;
e < nbound_element;
e++)
669 FACE_ELEMENT<BULK_ELEMENT>* face_element_pt =
697 for (
unsigned e = 0;
e < nel;
e++)
712 for (
unsigned e = 0;
e < nel;
e++)
717 size += fe_pt->
size();
733 std::ofstream& inverted_element_file);
744 std::ofstream inverted_element_file;
746 inverted_element_file);
754 oomph_info <<
"\n\nStarting check for repeated nodes...";
756 unsigned nnod =
nnode();
757 for (
unsigned j = 0; j < nnod; j++)
760 unsigned dim = nod1_pt->
ndim();
761 for (
unsigned k = j + 1; k < nnod; k++)
765 for (
unsigned i = 0;
i < dim;
i++)
767 dist += pow((nod1_pt->
x(
i) - nod2_pt->
x(
i)), 2);
772 oomph_info <<
"\n\nRepeated node!" << std::endl;
773 oomph_info <<
"Distance between nodes " << j <<
" and " << k
775 oomph_info <<
"is " << dist <<
" which is less than the"
777 oomph_info <<
"permitted distance of " << epsilon << std::endl
779 oomph_info <<
"The offending nodes are located at: " << std::endl;
780 for (
unsigned i = 0;
i < dim;
i++)
786 oomph_info <<
"\n\n[NOTE: message issued as diagonistic rather "
788 <<
" because at least one of the nodes is a copy; you "
790 <<
" want to check this out. BACKGROUND: Copied nodes "
791 "share the same Data but\n"
792 <<
" will, in general, have different spatial "
793 "positions (e.g. when used\n"
794 <<
" as periodic nodes); however there are cases when "
796 <<
" at the same spatial position (e.g. in "
797 "oomph-lib's annular mesh which\n"
798 <<
" is a rolled-around version of the rectangular "
799 "quadmesh). In such cases,\n"
800 <<
" the nodes could have been deleted and completely "
802 <<
" pointers to existing nodes, but may have been "
803 "left there for convenience\n"
804 <<
" or out of laziness...]\n";
814 if (failed)
return 1;
817 oomph_info <<
"...done: Test passed!" << std::endl << std::endl;
841 const unsigned&
e)
const
846 throw OomphLibError(
"Lookup scheme for elements next to boundary "
847 "hasn't been set up yet!\n",
848 OOMPH_CURRENT_FUNCTION,
849 OOMPH_EXCEPTION_LOCATION);
861 for (
unsigned nd = 0, nnd =
nnode(); nd < nnd; nd++)
863 if (!(
node_pt(nd)->is_on_boundary()))
869 std::ostringstream error_msg;
870 error_msg <<
"No non-boundary nodes in the mesh.";
872 error_msg.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
883 throw OomphLibError(
"Lookup scheme for elements next to boundary "
884 "hasn't been set up yet!\n",
885 OOMPH_CURRENT_FUNCTION,
886 OOMPH_EXCEPTION_LOCATION);
901 throw OomphLibError(
"Lookup scheme for elements next to boundary "
902 "hasn't been set up yet!\n",
903 OOMPH_CURRENT_FUNCTION,
904 OOMPH_EXCEPTION_LOCATION);
911 virtual void dump(std::ofstream& dump_file,
912 const bool& use_old_ordering =
true)
const;
916 const bool& use_old_ordering =
true)
const
918 std::ofstream dump_stream(dump_file_name.c_str());
920 if (!dump_stream.is_open())
922 std::string err =
"Couldn't open file " + dump_file_name;
924 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
927 dump(dump_stream, use_old_ordering);
931 virtual void read(std::ifstream& restart_file);
939 void output_paraview(std::ofstream& file_out,
const unsigned& nplot)
const;
947 std::ofstream& file_out,
948 const unsigned& nplot,
957 std::ofstream& file_out,
958 const unsigned& nplot,
963 void output(std::ostream& outfile);
966 void output(std::ostream& outfile,
const unsigned& n_plot);
969 void output(FILE* file_pt);
972 void output(FILE* file_pt,
const unsigned& nplot);
977 std::ofstream outfile;
978 outfile.open(output_filename.c_str());
986 std::ofstream outfile;
987 outfile.open(output_filename.c_str());
994 const unsigned& n_plot,
1000 const unsigned& n_plot,
1011 std::ofstream outfile;
1012 outfile.open(output_filename.c_str());
1033 TimeStepper*
const& time_stepper_pt,
const bool& preserve_existing_data)
1037 preserve_existing_data);
1045 TimeStepper*
const& time_stepper_pt,
const bool& preserve_existing_data);
1056 const bool& preserve_existing_data);
1061 TimeStepper*
const& time_stepper_pt,
const bool& preserve_existing_data);
1078 for (
unsigned long e = 0;
e < n_element;
e++)
1082 #ifdef OOMPH_HAS_MPI
1102 unsigned n_entry = norm.size();
1114 for (
unsigned long e = 0;
e < n_element;
e++)
1119 #ifdef OOMPH_HAS_MPI
1129 for (
unsigned i = 0;
i < n_entry;
i++)
1132 norm[
i] += el_norm[
i];
1141 std::ostream& outfile,
1151 double el_error, el_norm;
1154 unsigned long Element_pt_range =
Element_pt.size();
1155 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1162 "Can't execute compute_error(...) for non FiniteElements",
1163 OOMPH_CURRENT_FUNCTION,
1164 OOMPH_EXCEPTION_LOCATION);
1170 #ifdef OOMPH_HAS_MPI
1175 el_pt->
compute_error(outfile, exact_soln_pt, time, el_error, el_norm);
1187 std::ostream& outfile,
1196 double el_error, el_norm;
1199 unsigned long Element_pt_range =
Element_pt.size();
1200 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1207 "Can't execute compute_error(...) for non FiniteElements",
1208 OOMPH_CURRENT_FUNCTION,
1209 OOMPH_EXCEPTION_LOCATION);
1215 #ifdef OOMPH_HAS_MPI
1219 el_pt->
compute_error(outfile, exact_soln_pt, el_error, el_norm);
1241 double el_error, el_norm;
1244 unsigned long Element_pt_range =
Element_pt.size();
1245 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1252 "Can't execute compute_error(...) for non FiniteElements",
1253 OOMPH_CURRENT_FUNCTION,
1254 OOMPH_EXCEPTION_LOCATION);
1262 #ifdef OOMPH_HAS_MPI
1291 unsigned n_norm = norm.size();
1294 unsigned n_error = error.size();
1303 unsigned long element_pt_range =
Element_pt.size();
1306 for (
unsigned long e = 0;
e < element_pt_range;
e++)
1313 "Can't execute compute_error(...) for non FiniteElements",
1314 OOMPH_CURRENT_FUNCTION,
1315 OOMPH_EXCEPTION_LOCATION);
1325 #ifdef OOMPH_HAS_MPI
1333 for (
unsigned i = 0;
i < n_norm;
i++)
1335 norm[
i] += el_norm[
i];
1339 for (
unsigned i = 0;
i < n_error;
i++)
1341 error[
i] += el_error[
i];
1352 std::ostream& outfile,
1359 unsigned n_error = error.size();
1360 unsigned n_norm = norm.size();
1361 for (
unsigned i = 0;
i < n_error;
i++)
1365 for (
unsigned i = 0;
i < n_norm;
i++)
1373 unsigned long Element_pt_range =
Element_pt.size();
1374 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1381 "Can't execute compute_error(...) for non FiniteElements",
1382 OOMPH_CURRENT_FUNCTION,
1383 OOMPH_EXCEPTION_LOCATION);
1386 for (
unsigned i = 0;
i < n_error;
i++)
1390 for (
unsigned i = 0;
i < n_norm;
i++)
1395 #ifdef OOMPH_HAS_MPI
1399 el_pt->
compute_error(outfile, exact_soln_pt, time, el_error, el_norm);
1402 for (
unsigned i = 0;
i < n_error;
i++)
1404 error[
i] += el_error[
i];
1406 for (
unsigned i = 0;
i < n_norm;
i++)
1408 norm[
i] += el_norm[
i];
1418 std::ostream& outfile,
1424 unsigned n_error = error.size();
1425 unsigned n_norm = norm.size();
1426 for (
unsigned i = 0;
i < n_error;
i++)
1430 for (
unsigned i = 0;
i < n_norm;
i++)
1438 unsigned long Element_pt_range =
Element_pt.size();
1439 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1446 "Can't execute compute_error(...) for non FiniteElements",
1447 OOMPH_CURRENT_FUNCTION,
1448 OOMPH_EXCEPTION_LOCATION);
1451 for (
unsigned i = 0;
i < n_error;
i++)
1455 for (
unsigned i = 0;
i < n_norm;
i++)
1460 #ifdef OOMPH_HAS_MPI
1464 el_pt->
compute_error(outfile, exact_soln_pt, el_error, el_norm);
1467 for (
unsigned i = 0;
i < n_error;
i++)
1469 error[
i] += el_error[
i];
1471 for (
unsigned i = 0;
i < n_norm;
i++)
1473 norm[
i] += el_norm[
i];
1489 double el_error, el_norm;
1492 unsigned long Element_pt_range =
Element_pt.size();
1493 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1500 "Can't execute compute_error(...) for non FiniteElements",
1501 OOMPH_CURRENT_FUNCTION,
1502 OOMPH_EXCEPTION_LOCATION);
1508 #ifdef OOMPH_HAS_MPI
1513 el_pt->
compute_error(exact_soln_pt, time, el_error, el_norm);
1532 unsigned n_error = error.size();
1533 unsigned n_norm = norm.size();
1534 for (
unsigned i = 0;
i < n_error;
i++)
1538 for (
unsigned i = 0;
i < n_norm;
i++)
1546 unsigned long Element_pt_range =
Element_pt.size();
1547 for (
unsigned long e = 0;
e < Element_pt_range;
e++)
1554 "Can't execute compute_error(...) for non FiniteElements",
1555 OOMPH_CURRENT_FUNCTION,
1556 OOMPH_EXCEPTION_LOCATION);
1559 for (
unsigned i = 0;
i < n_error;
i++)
1563 for (
unsigned i = 0;
i < n_norm;
i++)
1568 #ifdef OOMPH_HAS_MPI
1572 el_pt->
compute_error(exact_soln_pt, time, el_error, el_norm);
1575 for (
unsigned i = 0;
i < n_error;
i++)
1577 error[
i] += el_error[
i];
1579 for (
unsigned i = 0;
i < n_norm;
i++)
1581 norm[
i] += el_norm[
i];
1590 #ifdef OOMPH_HAS_MPI
1602 #ifdef OOMPH_HAS_MPI
1610 #ifdef OOMPH_HAS_MPI
1640 const bool& report_stats,
1641 const bool& overrule_keep_as_halo_element_status);
1648 const bool& report_stats =
false)
1652 bool overrule_keep_as_halo_element_status =
false;
1658 overrule_keep_as_halo_element_status);
1669 const bool& report_stats =
false)
1686 const bool& report_stats);
1693 double& max_efficiency,
1694 double& min_efficiency);
1701 double& max_permitted_error_for_halo_check);
1707 const bool& report_stats);
1713 const bool& report_stats =
false)
1747 for (
unsigned e = 0;
e < nelem;
e++)
1762 unsigned nleaf = leaf_pt.size();
1763 for (
unsigned l = 0; l < nleaf; l++)
1765 vec_el_pt.push_back(leaf_pt[l]->object_pt());
1770 vec_el_pt.push_back(el_pt);
1786 for (
unsigned e = 0;
e < nelem;
e++)
1801 unsigned nleaf = leaf_pt.size();
1802 for (
unsigned l = 0; l < nleaf; l++)
1804 vec_el_pt.push_back(leaf_pt[l]->object_pt());
1809 vec_el_pt.push_back(el_pt);
1821 for (
unsigned e = 0;
e < n;
e++)
1838 n += it->second.size();
1886 n += it->second.size();
1896 std::map<unsigned, Vector<Node*>>::iterator it =
Halo_node_pt.find(p);
1901 return (*it).second.size();
1929 n += it->second.size();
1939 std::map<unsigned, Vector<GeneralisedElement*>>::iterator it =
1945 return (*it).second.size();
1954 std::map<unsigned, Vector<GeneralisedElement*>>::iterator it =
1961 return (*it).second;
1993 n += it->second.size();
2004 std::map<unsigned, Vector<Node*>>::iterator it =
Haloed_node_pt.find(p);
2009 return (*it).second.size();
2066 n += it->second.size();
2079 unsigned n = it->second.size();
2080 for (
unsigned j = 0; j < n; j++)
2082 oomph_info <<
"Shared node with proc " << it->first <<
" ";
2083 Node* nod_pt = it->second[j];
2084 unsigned ndim = nod_pt->
ndim();
2085 for (
unsigned i = 0;
i < ndim;
i++)
2090 oomph_info << j <<
" " << nod_pt << std::endl;
2100 std::map<unsigned, Vector<Node*>>::iterator it =
Shared_node_pt.find(p);
2105 return (*it).second.size();
2123 for (
unsigned j = 0; j < np; j++)
2143 unsigned& max_number,
2144 unsigned& min_number);
2151 unsigned& max_number,
2152 unsigned& min_number);
2159 const unsigned& n_plot = 5)
2166 unsigned p = (*it).first;
2173 std::ostream& outfile,
2174 const unsigned& n_plot = 5)
2177 for (
unsigned e = 0;
e < nel;
e++)
2183 fe_pt->
output(outfile, n_plot);
2191 const unsigned& n_plot = 5)
2198 unsigned p = (*it).first;
2205 std::ostream& outfile,
2206 const unsigned& n_plot = 5)
2209 for (
unsigned e = 0;
e < nel;
e++)
2215 fe_pt->
output(outfile, n_plot);
2230 n += it->second.size();
2240 std::map<unsigned, Vector<GeneralisedElement*>>::iterator it =
2246 return (*it).second.size();
2275 n += it->second.size();
2285 std::map<unsigned, Vector<GeneralisedElement*>>::iterator it =
2291 return (*it).second.size();
2316 n += it->second.size();
2332 unsigned np = (it->second).size();
2333 for (
unsigned j = 0; j < np; j++)
2341 std::ostringstream error_stream;
2342 error_stream <<
"Total number of external halo nodes, " << n_total
2343 <<
" doesn't match number of entries \n in vector, "
2346 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2357 std::map<unsigned, Vector<Node*>>::iterator it =
2363 return (*it).second.size();
2386 std::map<unsigned, Vector<Node*>>::iterator it =
2393 return (*it).second;
2420 n += it->second.size();
2430 std::map<unsigned, Vector<Node*>>::iterator it =
2436 return (*it).second.size();
2454 std::map<unsigned, Vector<Node*>>::iterator it =
2461 return (*it).second;
2477 std::set<int> procs;
2483 procs.insert((*it).first);
2495 std::map<
Data*, std::set<unsigned>>& processors_associated_with_data,
2496 const bool& overrule_keep_as_halo_element_status)
2498 std::ostringstream error_stream;
2499 error_stream <<
"Empty default create_shared_boundaries() method"
2501 error_stream <<
"This should be overloaded in a specific "
2502 <<
"TriangleMeshBase\n";
2504 "Mesh::create_shared_boundaries()",
2505 OOMPH_EXCEPTION_LOCATION);
2513 std::ostringstream error_stream;
2514 error_stream <<
"Empty default try_to_add_root_haloed_element_pt() method"
2516 error_stream <<
"This should be overloaded in a specific "
2517 <<
"TriangleMeshBase\n";
2519 "Mesh::try_to_add_root_haloed_element_pt()",
2520 OOMPH_EXCEPTION_LOCATION);
2527 std::ostringstream error_stream;
2528 error_stream <<
"Empty default try_to_add_haloed_node_pt() method"
2530 error_stream <<
"This should be overloaded in a specific "
2531 <<
"TriangleMeshBase\n";
2533 "Mesh::try_to_add_haloed_node_pt()",
2534 OOMPH_EXCEPTION_LOCATION);
2548 class SolidICProblem;
2578 #ifdef OOMPH_HAS_MPI
2583 unsigned n = sub_mesh_pt.size();
2585 for (
unsigned i = 0;
i < n;
i++)
2587 sub_mesh_mesh_pt[
i] =
static_cast<Mesh*
>(sub_mesh_pt[
i]);
2599 std::ostringstream error_stream;
2600 error_stream <<
"Error: Node " << n <<
"is a "
2601 <<
typeid(
Node_pt[n]).name() <<
", not an SolidNode"
2604 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2617 std::ostringstream error_stream;
2618 error_stream <<
"Error: Node " << n <<
"is a "
2620 <<
", not an SolidNode" << std::endl;
2622 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2640 OOMPH_CURRENT_FUNCTION,
2641 OOMPH_EXCEPTION_LOCATION);
2645 std::ostringstream error_message;
2647 error_message <<
"Error: Node " << n <<
" of element " <<
e <<
"is a "
2648 <<
typeid(*np).name() <<
", not an SolidNode"
2652 OOMPH_CURRENT_FUNCTION,
2653 OOMPH_EXCEPTION_LOCATION);
2700 std::ostringstream error_stream;
2701 error_stream <<
"Edge cannot have two identical vertex nodes\n";
2703 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2807 namespace MeshChecker
2820 template<
class GEOM_ELEMENT_BASE,
class ELEMENT>
2822 const unsigned& nnode_1d = 0)
2830 ELEMENT* el_pt =
new ELEMENT;
2833 if (
dynamic_cast<GEOM_ELEMENT_BASE*
>(el_pt) == 0)
2835 std::stringstream error_message;
2836 error_message <<
"You have specified an illegal element type! Element "
2838 <<
typeid(el_pt).name()
2839 <<
"\n\nand cannot be cast to type \n\n "
2840 <<
typeid(GEOM_ELEMENT_BASE).name() <<
"\n\n";
2842 OOMPH_CURRENT_FUNCTION,
2843 OOMPH_EXCEPTION_LOCATION);
2847 if (dim != el_pt->dim())
2849 std::stringstream error_message;
2850 error_message <<
"You have specified an illegal element type! Element "
2852 <<
typeid(el_pt).name()
2853 <<
"\n\nand has dimension = " << el_pt->dim()
2854 <<
" but we need dim = " << dim << std::endl;
2856 OOMPH_CURRENT_FUNCTION,
2857 OOMPH_EXCEPTION_LOCATION);
2863 if (nnode_1d != el_pt->nnode_1d())
2865 std::stringstream error_message;
2866 error_message <<
"You have specified an illegal element type! "
2867 "Element is of type \n\n"
2868 <<
typeid(el_pt).name()
2869 <<
"\n\nand has nnode_1d = " << el_pt->nnode_1d()
2870 <<
" but we need nnode_1d = " << nnode_1d << std::endl;
2872 OOMPH_CURRENT_FUNCTION,
2873 OOMPH_EXCEPTION_LOCATION);
2892 namespace ParaviewHelper
2901 const double& time);
2912 namespace NodeOrdering
2920 unsigned ndim = nd1_pt->
ndim();
2923 for (j = 0; j < ndim; j++)
2925 if (std::abs(nd1_pt->
x(j) - nd2_pt->
x(j)) > 1
e-10)
2927 if (nd1_pt->
x(j) < nd2_pt->
x(j))
2939 std::string err =
"Nodes are at the same point to ~ 1e-10!";
2940 err +=
" difference is " +
2943 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
A class that contains the information required by Nodes that are located on Mesh boundaries....
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
A class that represents a collection of data; each Data object may contain many different individual ...
virtual bool is_a_copy() const
Return a boolean to indicate whether the Data objact contains any copied values. A base Data object c...
void set_halo(const unsigned &non_halo_proc_ID)
Label the node as halo and specify processor that holds non-halo counterpart.
Information for documentation of results: Directory and file number to enable output in the form RESL...
void disable_doc()
Disable documentation.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
Node * node2_pt() const
Access to the second vertex node.
bool is_on_boundary() const
Test whether the Edge lies on a boundary. Relatively simple test, based on both vertices lying on (so...
Node * node1_pt() const
Access to the first vertex node.
bool is_boundary_edge() const
Test whether the Edge is a boundary edge, i.e. does it connnect two boundary nodes?
Node * Node1_pt
First vertex node.
Edge(Node *node1_pt, Node *node2_pt)
Constructor: Pass in the two vertex nodes.
bool operator<(const Edge &other) const
Less-than operator.
Node * Node2_pt
Second vertex node.
bool operator==(const Edge &other) const
Comparison operator.
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
A Generalised Element class.
bool is_halo() const
Is this element a halo?
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
virtual void compute_norm(Vector< double > &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever n...
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
void set_external_halo_node_pt(const unsigned &p, const Vector< Node * > &external_halo_node_pt)
Set vector of external halo node in this Mesh whose non-halo external counterpart is held on processo...
Node * halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th halo node in this Mesh whose non-halo counterpart is held on processor p.
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
void(FiniteElement::* SteadyExactSolutionFctPt)(const Vector< double > &x, Vector< double > &soln)
Typedef for function pointer to function that computes steady exact solution.
Vector< Node * > external_halo_node_pt(const unsigned &p)
Access fct to vector of external halo node in this Mesh whose non-halo external counterpart is held o...
Vector< Node * > Node_pt
Vector of pointers to nodes.
Node * boundary_node_pt(const unsigned &b, const unsigned &n) const
Return pointer to node n on boundary b.
void enable_resizing_of_halo_nodes()
Function to (re-)enable resizing of halo nodes – this returns things to the default behaviour.
std::map< unsigned, Vector< Node * > > Shared_node_pt
Map of vectors holding the pointers to the shared nodes. These are all the nodes that are on two "nei...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
bool does_pointer_correspond_to_mesh_data(double *const ¶meter_pt)
Does the double pointer correspond to any mesh data.
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
void distribute(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, Vector< GeneralisedElement * > &deleted_element_pt, const bool &report_stats=false)
Distribute the problem Add to vector of pointers to deleted elements.
void disable_resizing_of_halo_nodes()
Function to suppress resizing of halo nodes – optmisation but call it at your own risk!
unsigned ndof_types() const
Return number of dof types in mesh.
void remove_boundary_node(const unsigned &b, Node *const &node_pt)
Remove a node from the boundary b.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
void output_external_halo_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external halo elements.
void setup_shared_node_scheme()
Setup shared node scheme.
void max_and_min_element_size(double &max_size, double &min_size)
Determine max and min area for all FiniteElements in the mesh (non-FiniteElements are ignored)
std::map< unsigned, Vector< GeneralisedElement * > > Root_haloed_element_pt
Map of vectors holding the pointers to the root haloed elements.
GeneralisedElement *& root_halo_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th root halo element in this Mesh whose non-halo counterpart is held on processor...
void set_keep_all_elements_as_halos()
Call this function to keep all the elements as halo elements.
unsigned nroot_haloed_element(const unsigned &p)
Number of root haloed elements in this Mesh whose non-halo counterpart is held on processor p.
virtual unsigned try_to_add_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Vector< Vector< FiniteElement * > > Boundary_element_pt
Vector of Vector of pointers to elements on the boundaries: Boundary_element_pt(b,...
void add_halo_node_pt(const unsigned &p, Node *&nod_pt)
Add halo node whose non-halo counterpart is held on processor p to the storage scheme for halo nodes.
unsigned nexternal_haloed_element()
Total number of external haloed elements in this Mesh.
unsigned add_external_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Add external haloed node whose halo (external) counterpart is held on processor p to the storage sche...
Node * haloed_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th haloed node in this Mesh whose halo counterpart is held on processor p.
unsigned nexternal_halo_node()
Total number of external halo nodes in this Mesh.
unsigned nexternal_haloed_element(const unsigned &p)
Number of external haloed elements in this Mesh whose non-halo counterpart is held on processor p.
unsigned nodal_dimension() const
Return number of nodal dimension in mesh.
void add_external_halo_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external halo element whose non-halo counterpart is held on processor p to this Mesh.
virtual void compute_norm(double &norm)
Compute norm of solution by summing contributions of compute_norm(...) for all constituent elements i...
bool Lookup_for_elements_next_boundary_is_setup
Flag to indicate that the lookup schemes for elements that are adjacent to the boundaries has been se...
void flush_element_and_node_storage()
Flush storage for elements and nodes by emptying the vectors that store the pointers to them....
std::map< unsigned, Vector< GeneralisedElement * > > External_haloed_element_pt
Map of vectors holding the pointers to the external haloed elements.
Node * shared_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th shared node in this Mesh who has a counterpart on processor p.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
void add_shared_node_pt(const unsigned &p, Node *&nod_pt)
Add shared node whose counterpart is held on processor p to the storage scheme for shared nodes....
void flush_element_storage()
Flush storage for elements (only) by emptying the vectors that store the pointers to them....
GeneralisedElement * element_pt(const unsigned long &e) const
Return pointer to element e (const version)
void output(const std::string &output_filename)
Output for all elements.
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
virtual void setup_boundary_element_info(std::ostream &outfile)
Setup lookup schemes which establish whic elements are located next to mesh's boundaries....
Node * node_pt(const unsigned long &n) const
Return pointer to global node n (const version)
Node *& external_halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th external halo node in this Mesh whose non-halo external counterpart is held on...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
void get_haloed_node_stats(double &av_number, unsigned &max_number, unsigned &min_number)
Get haloed node stats for this distributed mesh: Average/max/min number of haloed nodes over all proc...
void(FiniteElement::* UnsteadyExactSolutionFctPt)(const double &time, const Vector< double > &x, Vector< double > &soln)
Typedef for function pointer to function that computes unsteady exact solution.
void check_halo_schemes(DocInfo &doc_info, double &max_permitted_error_for_halo_check)
Check halo and shared schemes on the mesh.
virtual void set_mesh_level_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Function that can be used to set any additional timestepper data stored at the Mesh (as opposed to no...
unsigned nhaloed_node(const unsigned &p)
Number of haloed nodes in this Mesh whose haloed counterpart is held on processor p.
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the elements. The ostream specifies the output stream to which...
virtual void classify_halo_and_haloed_nodes(DocInfo &doc_info, const bool &report_stats)
Classify the halo and haloed nodes in the mesh. Virtual so it can be overloaded to perform additional...
void add_root_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add root haloed element whose non-halo counterpart is held on processor p to the storage scheme for h...
void synchronise_shared_nodes(const bool &report_stats)
Synchronise shared node lookup schemes to cater for the the case where: (1) a certain node on the cur...
void check_inverted_elements(bool &mesh_has_inverted_elements)
Check for inverted elements and report outcome in boolean variable. This visits all elements at their...
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
For the e-th finite element on boundary b, return int to indicate the face_index of the face adjacent...
void output_external_halo_elements(const unsigned &p, std::ostream &outfile, const unsigned &n_plot=5)
Output all external halo elements with processor p.
Vector< Vector< int > > Face_index_at_boundary
For the e-th finite element on boundary b, this is the index of the face that lies along that boundar...
GeneralisedElement *& external_halo_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external halo element in this Mesh whose non-halo counterpart is held on proce...
unsigned nexternal_haloed_node(const unsigned &p)
Number of external haloed nodes in this Mesh whose halo (external) counterpart is held on processor p...
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Vector< GeneralisedElement * > & element_pt()
Return reference to the Vector of elements.
void copy_boundary_node_data_from_nodes()
Replace existing boundary node lookup schemes with new schemes created using the boundary data stored...
void set_elemental_internal_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the internal data stored within elements in the meah.
void doc_boundary_coordinates(const unsigned &b, std::ofstream &the_file)
Output boundary coordinates on boundary b – template argument specifies the bulk element type (needed...
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
bool Keep_all_elements_as_halos
bool to indicate whether to keep all elements in a mesh as halos or not
std::map< unsigned, Vector< Node * > > External_haloed_node_pt
Map of vectors holding the pointers to the external haloed nodes.
void output_external_haloed_elements(const unsigned &p, std::ostream &outfile, const unsigned &n_plot=5)
Output all external haloed elements with processor p.
void set_nodal_and_elemental_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with all nodal and elemental data stored in the mesh.
virtual void setup_boundary_element_info()
Interface for function that is used to setup the boundary information (Empty virtual function – imple...
std::map< unsigned, Vector< GeneralisedElement * > > Root_halo_element_pt
Map of vectors holding the pointers to the root halo elements.
unsigned elemental_dimension() const
Return number of elemental dimension in mesh.
std::set< int > external_halo_proc()
Return the set of processors that hold external halo nodes. This is required to avoid having to pass ...
void set_external_haloed_node_pt(const unsigned &p, const Vector< Node * > &external_haloed_node_pt)
Set vector of external haloed node in this Mesh whose halo external counterpart is held on processor ...
Node *& external_haloed_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th external haloed node in this Mesh whose halo external counterpart is held on p...
void check_inverted_elements(bool &mesh_has_inverted_elements, std::ofstream &inverted_element_file)
Check for inverted elements and report outcome in boolean variable. This visits all elements at their...
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
virtual void compute_norm(Vector< double > &norm)
Compute norm of solution by summing contributions of compute_norm(...) for all constituent elements i...
void add_root_halo_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add root halo element whose non-halo counterpart is held on processor p to this Mesh.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt)
Output a given Vector function at f(n_plot) points in each element.
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Plot error when compared against a given exact solution. Also returns the norm of the error and that ...
virtual void scale_mesh(const double &factor)
Scale all nodal coordinates by given factor. Virtual so it can be overloaded in SolidMesh class where...
void shift_time_values()
Shift time-dependent data along for next timestep: Deal with nodal Data/positions and the element's i...
virtual void reorder_nodes(const bool &use_old_ordering=true)
Re-order nodes in the order in which they appear in elements – can be overloaded for more efficient r...
void prune_halo_elements_and_nodes(Vector< GeneralisedElement * > &deleted_element_pt, const bool &report_stats=false)
(Irreversibly) prune halo(ed) elements and nodes, usually after another round of refinement,...
unsigned nhalo_node(const unsigned &p)
Number of halo nodes in this Mesh whose non-halo counterpart is held on processor p.
void calculate_predictions()
Calculate predictions for all Data and positions associated with the mesh, usually used in adaptive t...
void output_boundaries(const std::string &output_filename)
Output the nodes on the boundaries (into separate tecplot zones). Specify filename.
unsigned nboundary() const
Return number of boundaries.
unsigned add_external_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external haloed element whose non-halo counterpart is held on processor p to the storage scheme f...
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Mesh. The ostream specifies the output stream to which the descr...
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
void disable_output_of_halo_elements()
Function to disable halo element output.
void output_fct_paraview(std::ofstream &file_out, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Output in paraview format into specified file. Breaks up each element into sub-elements for plotting ...
unsigned nroot_halo_element(const unsigned &p)
Number of root halo elements in this Mesh whose non-halo counterpart is held on processor p.
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
bool Output_halo_elements
Bool for output of halo elements.
void build_face_mesh(const unsigned &b, Mesh *const &face_mesh_pt)
Constuct a Mesh of FACE_ELEMENTs along the b-th boundary of the mesh (which contains elements of type...
unsigned long nnode() const
Return number of nodes in the mesh.
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
virtual void node_update(const bool &update_all_solid_nodes=false)
Update nodal positions in response to changes in the domain shape. Uses the FiniteElement::get_x(....
void get_efficiency_of_mesh_distribution(double &av_efficiency, double &max_efficiency, double &min_efficiency)
Get efficiency of mesh distribution: In an ideal distribution without halo overhead,...
unsigned nroot_haloed_element()
Total number of root haloed elements in this Mesh.
void output_external_haloed_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external haloed elements.
void delete_all_external_storage()
Wipe the storage for all externally-based elements.
unsigned nnon_halo_element()
Total number of non-halo elements in this mesh (Costly call computes result on the fly)
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Returns the norm of the error and that of the exact solution. Version with vectors of norms and error...
void get_all_halo_data(std::map< unsigned, double * > &map_of_halo_data)
Get all the halo data stored in the mesh and add pointers to the data to the map, indexed by global e...
unsigned nhalo_node()
Total number of halo nodes in this Mesh.
std::map< unsigned, Vector< Node * > > Halo_node_pt
Map of vectors holding the pointers to the halo nodes.
Mesh()
Default constructor.
void set_communicator_pt(OomphCommunicator *comm_pt)
Function to set communicator (mesh is assumed to be distributed if the communicator pointer is non-nu...
virtual void create_shared_boundaries(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, const Vector< GeneralisedElement * > &backed_up_el_pt, const Vector< FiniteElement * > &backed_up_f_el_pt, std::map< Data *, std::set< unsigned >> &processors_associated_with_data, const bool &overrule_keep_as_halo_element_status)
Creates the shared boundaries, only used in unstructured meshes In this case with the "TriangleMesh" ...
unsigned check_for_repeated_nodes(const double &epsilon=1.0e-12)
Check for repeated nodes within a given spatial tolerance. Return (0/1) for (pass/fail).
void convert_to_boundary_node(Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
A function that upgrades an ordinary node to a boundary node We shouldn't ever really use this,...
void output(std::ostream &outfile)
Output for all elements.
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
virtual unsigned try_to_add_root_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
std::map< unsigned, Vector< Node * > > Haloed_node_pt
Map of vectors holding the pointers to the haloed nodes.
void doc_shared_nodes()
Doc shared nodes.
void operator=(const Mesh &)=delete
Broken assignment operator.
void assign_initial_values_impulsive()
Assign initial values for an impulsive start.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
bool Resize_halo_nodes_not_required
Set this to true to suppress resizing of halo nodes (at your own risk!)
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
void flush_node_storage()
Flush storage for nodes (only) by emptying the vectors that store the pointers to them.
void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers in all elements If the boolean argument is true then also store poi...
unsigned nexternal_halo_element(const unsigned &p)
Number of external halo elements in this Mesh whose non-halo counterpart is held on processor p.
Vector< Vector< Node * > > Boundary_node_pt
Vector of Vector of pointers to nodes on the boundaries: Boundary_node_pt(b,n). Note that this is pri...
virtual ~Mesh()
Virtual Destructor to clean up all memory.
void add_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Add haloed node whose halo counterpart is held on processor p to the storage scheme for haloed nodes.
void get_external_halo_node_pt(Vector< Node * > &external_halo_node_pt)
Get vector of pointers to all external halo nodes.
void enable_output_of_halo_elements()
Function to enable halo element output.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
void add_external_halo_node_pt(const unsigned &p, Node *&nod_pt)
Add external halo node whose non-halo (external) counterpart is held on processor p to the storage sc...
void unset_keep_all_elements_as_halos()
Calll this function to unset the flag that keeps all elements in the mesh as halo elements.
virtual void read(std::ifstream &restart_file)
Read solution from restart file.
void set_nodal_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the nodal data in the mesh.
virtual void reset_boundary_element_info(Vector< unsigned > &ntmp_boundary_elements, Vector< Vector< unsigned >> &ntmp_boundary_elements_in_region, Vector< FiniteElement * > &deleted_elements)
Virtual function to perform the reset boundary elements info rutines.
void doc_mesh_distribution(DocInfo &doc_info)
Doc the mesh distribution, to be processed with tecplot macros.
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
void get_shared_node_pt(const unsigned &p, Vector< Node * > &shared_node_pt)
Get vector of pointers to shared nodes with processor p. Required for faster search in Missing_master...
void get_halo_node_stats(double &av_number, unsigned &max_number, unsigned &min_number)
Get halo node stats for this distributed mesh: Average/max/min number of halo nodes over all processo...
void set_consistent_pinned_values_for_continuation(ContinuationStorageScheme *const &continuation_stepper_pt)
Set consistent values for pinned data in continuation.
Vector< Node * > prune_dead_nodes()
Prune nodes. Nodes that have been marked as obsolete are removed from the mesh (and its boundary-node...
void output(const std::string &output_filename, const unsigned &n_plot)
Output at f(n_plot) points in each element.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Plot error when compared against a given time-dependent exact solution. Also returns the norm of the ...
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
void resize_halo_nodes()
Helper function that resizes halo nodes to the same size as their non-halo counterparts if required....
unsigned nexternal_halo_node(const unsigned &p)
Number of external halo nodes in this Mesh whose non-halo (external) counterpart is held on processor...
std::map< unsigned, Vector< Node * > > External_halo_node_pt
Map of vectors holding the pointers to the external halo nodes.
unsigned nhaloed_node()
Total number of haloed nodes in this Mesh.
unsigned nexternal_haloed_node()
Total number of external haloed nodes in this Mesh.
unsigned nshared_node(const unsigned &p)
Number of shared nodes in this Mesh who have a counterpart on processor p.
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
Boolean used to control warning about empty mesh level timestepper function.
Node * get_some_non_boundary_node() const
Find a node not on any boundary in mesh_pt (useful for pinning a single node in a purely Neumann prob...
unsigned long assign_global_eqn_numbers(Vector< double * > &Dof_pt)
Assign the global equation numbers in the Data stored at the nodes and also internal element Data....
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot error when compared against a given time-dependent exact solution. Also returns the norm of the ...
virtual void distribute(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, Vector< GeneralisedElement * > &deleted_element_pt, DocInfo &doc_info, const bool &report_stats, const bool &overrule_keep_as_halo_element_status)
Distribute the problem and doc; make this virtual to allow overloading for particular meshes where fu...
Vector< Node * > external_haloed_node_pt(const unsigned &p)
Access fct to vector of external haloed node in this Mesh whose halo external counterpart is held on ...
void null_external_halo_node(const unsigned &p, Node *nod_pt)
Null out specified external halo node (used when deleting duplicates)
Mesh(const Mesh &dummy)=delete
Broken copy constructor.
Vector< GeneralisedElement * > root_haloed_element_pt(const unsigned &p)
Vector of pointers to root haloed elements in this Mesh whose non-halo counterpart is held on process...
unsigned nshared_node()
Total number of shared nodes in this Mesh.
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Returns the norm of the error and that of the exact solution.
void remove_null_pointers_from_external_halo_node_storage()
Consolidate external halo node storage by removing nulled out pointes in external halo and haloed sch...
GeneralisedElement *& external_haloed_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external haloed element in this Mesh whose non-halo counterpart is held on pro...
unsigned long nelement() const
Return number of elements in the mesh.
virtual void get_node_reordering(Vector< Node * > &reordering, const bool &use_old_ordering=true) const
Get a reordering of the nodes in the order in which they appear in elements – can be overloaded for m...
virtual void classify_halo_and_haloed_nodes(const bool &report_stats=false)
Classify the halo and haloed nodes in the mesh. Virtual so it can be overloaded to perform additional...
Vector< GeneralisedElement * > root_halo_element_pt(const unsigned &p)
Vector of pointers to root halo elements in this Mesh whose non-halo counterpart is held on processor...
void merge_meshes(const Vector< Mesh * > &sub_mesh_pt)
Merge meshes. Note: This simply merges the meshes' elements and nodes (ignoring duplicates; no bounda...
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Output in paraview format into specified file. Breaks up each element into sub-elements for plotting ...
GeneralisedElement *& root_haloed_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th root haloed element in this Mesh whose non-halo counterpart is held on process...
void output_boundaries(std::ostream &outfile)
Output the nodes on the boundaries (into separate tecplot zones)
unsigned nexternal_halo_element()
Total number of external halo elements in this Mesh.
virtual void dump(std::ofstream &dump_file, const bool &use_old_ordering=true) const
Dump the data in the mesh into a file for restart.
double total_size()
Determine the sum of all "sizes" of the FiniteElements in the mesh (non-FiniteElements are ignored)....
void dump(const std::string &dump_file_name, const bool &use_old_ordering=true) const
Dump the data in the mesh into a file for restart.
std::map< unsigned, Vector< GeneralisedElement * > > External_halo_element_pt
External halo(ed) elements are created as and when they are needed to act as source elements for the ...
Mesh(const Vector< Mesh * > &sub_mesh_pt)
Constructor builds combined mesh from the meshes specified. Note: This simply merges the meshes' elem...
Vector< GeneralisedElement * > halo_element_pt(const unsigned &p)
Return vector of halo elements in this Mesh whose non-halo counterpart is held on processor p.
unsigned nroot_halo_element()
Total number of root halo elements in this Mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Return a pointer to set of mesh boundaries that this node occupies; this will be overloaded by Bounda...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void resize(const unsigned &n_value)
Resize the number of equations.
bool is_hanging() const
Test whether the node is geometrically hanging.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
Tree * tree_pt()
Access function: Pointer to quadtree representation of this element.
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
void operator=(const SolidMesh &)=delete
Broken assignment operator.
SolidMesh()
Default constructor.
void set_lagrangian_nodal_coordinates()
Make the current configuration the undeformed one by setting the nodal Lagrangian coordinates to thei...
void scale_mesh(const double &factor)
Scale all nodal coordinates by given factor and re-assign the Lagrangian coordinates.
static SolidICProblem Solid_IC_problem
Static problem that can be used to assign initial conditions on a given solid mesh (need to define th...
SolidMesh(const Vector< SolidMesh * > &sub_mesh_pt)
Constructor builds combined mesh from the meshes specified. Note: This simply merges the meshes' elem...
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
SolidNode * element_node_pt(const unsigned long &e, const unsigned &n)
Return the n-th local SolidNode in elemnet e. This is required to cast the nodes in a solid mesh to b...
SolidNode * boundary_node_pt(const unsigned &b, const unsigned &n)
Return n-th SolidNodes on b-th boundary.
SolidMesh(const SolidMesh &dummy)=delete
Broken copy constructor.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void stick_leaves_into_vector(Vector< Tree * > &)
Traverse tree and stick pointers to leaf "nodes" (only) into Vector.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void assert_geometric_element(const unsigned &dim, const unsigned &nnode_1d=0)
Helper function to assert that finite element of type ELEMENT can be cast to base class of type GEOM_...
bool node_global_position_comparison(Node *nd1_pt, Node *nd2_pt)
Function for ordering nodes. Return true if first node's position is "before" second nodes....
void write_pvd_footer(std::ofstream &pvd_file)
Write the pvd file footer.
void write_pvd_header(std::ofstream &pvd_file)
Write the pvd file header.
void write_pvd_information(std::ofstream &pvd_file, const std::string &output_filename, const double &time)
Add name of output file and associated continuous time to pvd file.
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types).
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...