29#ifndef OOMPH_GENERIC_MESH_HEADER
30#define OOMPH_GENERIC_MESH_HEADER
34#include <oomph-lib-config.h>
294 error_stream <<
"Empty default reset boundary element info function"
296 error_stream <<
"This should be overloaded in a specific "
297 <<
"TriangleMeshBase\n";
299 "Mesh::reset_boundary_element_info()",
306 template<
class BULK_ELEMENT>
312 oomph_info <<
"No boundary coordinates were set up for boundary " << b
324 for (
unsigned e = 0;
e <
nel;
e++)
338 el_pt->set_boundary_number_in_bulk_mesh(b);
355 for (
unsigned i = 0;
i < dim;
i++)
359 for (
unsigned i = 0;
i < (dim - 1);
i++)
381 for (
unsigned j = 0;
j <
nnod;
j++)
384 for (
unsigned i = 0;
i < dim;
i++)
544 if (
nd_pt->is_on_boundary())
559 std::set<unsigned>::const_iterator
it;
660 template<
class BULK_ELEMENT,
template<
class>
class FACE_ELEMENT>
705 for (
unsigned e = 0;
e <
nel;
e++)
720 for (
unsigned e = 0;
e <
nel;
e++)
762 oomph_info <<
"\n\nStarting check for repeated nodes...";
765 for (
unsigned j = 0;
j <
nnod;
j++)
769 for (
unsigned k =
j + 1;
k <
nnod;
k++)
773 for (
unsigned i = 0;
i < dim;
i++)
780 oomph_info <<
"\n\nRepeated node!" << std::endl;
781 oomph_info <<
"Distance between nodes " <<
j <<
" and " <<
k
785 oomph_info <<
"permitted distance of " << epsilon << std::endl
787 oomph_info <<
"The offending nodes are located at: " << std::endl;
788 for (
unsigned i = 0;
i < dim;
i++)
794 oomph_info <<
"\n\n[NOTE: message issued as diagonistic rather "
796 <<
" because at least one of the nodes is a copy; you "
798 <<
" want to check this out. BACKGROUND: Copied nodes "
799 "share the same Data but\n"
800 <<
" will, in general, have different spatial "
801 "positions (e.g. when used\n"
802 <<
" as periodic nodes); however there are cases when "
804 <<
" at the same spatial position (e.g. in "
805 "oomph-lib's annular mesh which\n"
806 <<
" is a rolled-around version of the rectangular "
807 "quadmesh). In such cases,\n"
808 <<
" the nodes could have been deleted and completely "
810 <<
" pointers to existing nodes, but may have been "
811 "left there for convenience\n"
812 <<
" or out of laziness...]\n";
825 oomph_info <<
"...done: Test passed!" << std::endl << std::endl;
849 const unsigned&
e)
const
854 throw OomphLibError(
"Lookup scheme for elements next to boundary "
855 "hasn't been set up yet!\n",
878 error_msg <<
"No non-boundary nodes in the mesh.";
891 throw OomphLibError(
"Lookup scheme for elements next to boundary "
892 "hasn't been set up yet!\n",
909 throw OomphLibError(
"Lookup scheme for elements next to boundary "
910 "hasn't been set up yet!\n",
956 const unsigned&
nplot,
966 const unsigned&
nplot,
1113 norm.initialise(0.0);
1170 "Can't execute compute_error(...) for non FiniteElements",
1215 "Can't execute compute_error(...) for non FiniteElements",
1260 "Can't execute compute_error(...) for non FiniteElements",
1293 norm.initialise(0.0);
1296 error.initialise(0.0);
1321 "Can't execute compute_error(...) for non FiniteElements",
1389 "Can't execute compute_error(...) for non FiniteElements",
1454 "Can't execute compute_error(...) for non FiniteElements",
1508 "Can't execute compute_error(...) for non FiniteElements",
1562 "Can't execute compute_error(...) for non FiniteElements",
1755 for (
unsigned e = 0;
e <
nelem;
e++)
1771 for (
unsigned l = 0;
l <
nleaf;
l++)
1794 for (
unsigned e = 0;
e <
nelem;
e++)
1810 for (
unsigned l = 0;
l <
nleaf;
l++)
1829 for (
unsigned e = 0;
e <
n;
e++)
1904 std::map<unsigned, Vector<Node*>>::iterator
it =
Halo_node_pt.find(
p);
1909 return (*it).second.
size();
1947 std::map<unsigned, Vector<GeneralisedElement*>>::iterator
it =
1953 return (*it).second.
size();
1962 std::map<unsigned, Vector<GeneralisedElement*>>::iterator
it =
1969 return (*it).second;
2017 return (*it).second.
size();
2087 unsigned n =
it->second.
size();
2088 for (
unsigned j = 0;
j <
n;
j++)
2090 oomph_info <<
"Shared node with proc " <<
it->first <<
" ";
2093 for (
unsigned i = 0;
i < ndim;
i++)
2113 return (*it).second.
size();
2131 for (
unsigned j = 0;
j <
np;
j++)
2167 const unsigned&
n_plot = 5)
2174 unsigned p = (*it).first;
2182 const unsigned&
n_plot = 5)
2185 for (
unsigned e = 0;
e <
nel;
e++)
2199 const unsigned&
n_plot = 5)
2206 unsigned p = (*it).first;
2214 const unsigned&
n_plot = 5)
2217 for (
unsigned e = 0;
e <
nel;
e++)
2248 std::map<unsigned, Vector<GeneralisedElement*>>::iterator
it =
2254 return (*it).second.
size();
2293 std::map<unsigned, Vector<GeneralisedElement*>>::iterator
it =
2299 return (*it).second.
size();
2340 unsigned np = (
it->second).size();
2341 for (
unsigned j = 0;
j <
np;
j++)
2351 <<
" doesn't match number of entries \n in vector, "
2365 std::map<unsigned, Vector<Node*>>::iterator
it =
2371 return (*it).second.
size();
2394 std::map<unsigned, Vector<Node*>>::iterator
it =
2401 return (*it).second;
2438 std::map<unsigned, Vector<Node*>>::iterator
it =
2444 return (*it).second.
size();
2462 std::map<unsigned, Vector<Node*>>::iterator
it =
2469 return (*it).second;
2485 std::set<int>
procs;
2491 procs.insert((*it).first);
2507 error_stream <<
"Empty default create_shared_boundaries() method"
2509 error_stream <<
"This should be overloaded in a specific "
2510 <<
"TriangleMeshBase\n";
2512 "Mesh::create_shared_boundaries()",
2522 error_stream <<
"Empty default try_to_add_root_haloed_element_pt() method"
2524 error_stream <<
"This should be overloaded in a specific "
2525 <<
"TriangleMeshBase\n";
2527 "Mesh::try_to_add_root_haloed_element_pt()",
2536 error_stream <<
"Empty default try_to_add_haloed_node_pt() method"
2538 error_stream <<
"This should be overloaded in a specific "
2539 <<
"TriangleMeshBase\n";
2541 "Mesh::try_to_add_haloed_node_pt()",
2556 class SolidICProblem;
2593 for (
unsigned i = 0;
i <
n;
i++)
2628 <<
", not an SolidNode" << std::endl;
2653 std::ostringstream error_message;
2655 error_message <<
"Error: Node " <<
n <<
" of element " <<
e <<
"is a "
2656 <<
typeid(*np).name() <<
", not an SolidNode"
2709 error_stream <<
"Edge cannot have two identical vertex nodes\n";
2815 namespace MeshChecker
2828 template<
class GEOM_ELEMENT_BASE,
class ELEMENT>
2830 const unsigned& nnode_1d = 0)
2838 ELEMENT*
el_pt =
new ELEMENT;
2843 std::stringstream error_message;
2844 error_message <<
"You have specified an illegal element type! Element "
2847 <<
"\n\nand cannot be cast to type \n\n "
2857 std::stringstream error_message;
2858 error_message <<
"You have specified an illegal element type! Element "
2861 <<
"\n\nand has dimension = " <<
el_pt->
dim()
2862 <<
" but we need dim = " << dim << std::endl;
2873 std::stringstream error_message;
2874 error_message <<
"You have specified an illegal element type! "
2875 "Element is of type \n\n"
2878 <<
" but we need nnode_1d = " << nnode_1d << std::endl;
2900 namespace ParaviewHelper
2908 const std::string& output_filename,
2909 const double& time);
2920 namespace NodeOrdering
2931 for (
j = 0;
j < ndim;
j++)
2947 std::string
err =
"Nodes are at the same point to ~ 1e-10!";
2948 err +=
" difference is " +
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
void compute_norm(double &norm)
Compute norm of the solution: sum of squares of the L2 norm for each reagent.
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 ...
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.
A general Finite Element class.
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 double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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")
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
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.
unsigned ndim() const
Access function to # of Eulerian coordinates.
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...
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_haloed_node_pt(const unsigned &p)
Access fct to vector of external haloed node in this Mesh whose halo external counterpart is held on ...
GeneralisedElement * element_pt(const unsigned long &e) const
Return pointer to element e (const version)
Vector< Node * > Node_pt
Vector of pointers to nodes.
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.
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...
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...
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.
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...
unsigned nexternal_halo_node()
Total number of external halo nodes in this Mesh.
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...
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...
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.
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....
Node * boundary_node_pt(const unsigned &b, const unsigned &n) const
Return pointer to node n on boundary b.
std::map< unsigned, Vector< GeneralisedElement * > > External_haloed_element_pt
Map of vectors holding the pointers to the external haloed elements.
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 set_boundary_coordinate_does_not_exist(const unsigned &i)
Set boundary coordinate on the i-th boundary to be non-existing.
void flush_element_storage()
Flush storage for elements (only) by emptying the vectors that store the pointers to them....
void output(const std::string &output_filename)
Output for all elements.
virtual void setup_boundary_element_info(std::ostream &outfile)
Setup lookup schemes which establish whic elements are located next to mesh's boundaries....
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...
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...
Vector< unsigned > Boundary_coordinate_exists_stored_as_unsigned
Indicate whether the boundary coordinates have been set for the specified boundary....
unsigned nhaloed_node(const unsigned &p)
Number of haloed nodes in this Mesh whose haloed 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...
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.
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
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
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...
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
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.
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 ...
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 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" ...
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...
Vector< GeneralisedElement * > & element_pt()
Return reference to the Vector of elements.
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...
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.
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.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
void output_external_haloed_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external haloed elements.
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 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...
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...
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...
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...
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,...
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
void output(std::ostream &outfile)
Output for all elements.
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...
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 set_boundary_coordinate_exists(const unsigned &i)
Set boundary coordinate on the i-th boundary to be existing.
void assign_initial_values_impulsive()
Assign initial values for an impulsive start.
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.
bool Resize_halo_nodes_not_required
Set this to true to suppress resizing of halo nodes (at your own risk!)
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.
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.
std::set< int > external_halo_proc()
Return the set of processors that hold external halo nodes. This is required to avoid having to pass ...
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 ...
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...
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
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.
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.
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
Boolean used to control warning about empty mesh level timestepper function.
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< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
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.
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.
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...
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_haloed_element_pt(const unsigned &p)
Vector of pointers to root haloed elements in this Mesh whose non-halo counterpart is held on process...
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 ...
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...
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
unsigned nroot_halo_element()
Total number of root halo elements in this Mesh.
Node * node_pt(const unsigned long &n) const
Return pointer to global node n (const version)
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void resize(const unsigned &n_value)
Resize the number of equations.
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 ...
IC problem for an elastic body discretised on a given (sub)-mesh. We switch the elements' residuals a...
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
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...
SolidNode * boundary_node_pt(const unsigned &b, const unsigned &n)
Return n-th SolidNodes on b-th boundary.
void scale_mesh(const double &factor)
Scale all nodal coordinates by given factor and re-assign the Lagrangian coordinates.
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...
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...
SolidMesh(const SolidMesh &dummy)=delete
Broken copy constructor.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
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).
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...