26 #ifndef OOMPH_ALGEBRAIC_ELEMENTS_HEADER
27 #define OOMPH_ALGEBRAIC_ELEMENTS_HEADER
39 class AlgebraicElementBase;
40 class DummyAlgebraicMesh;
64 const unsigned& n_position_type,
65 const unsigned& initial_nvalue)
66 :
Node(n_dim, n_position_type, initial_nvalue)
86 const unsigned& n_dim,
87 const unsigned& n_position_type,
88 const unsigned& initial_nvalue)
132 void node_update(
const bool& update_all_time_levels_for_new_node =
false);
161 typedef std::map<int, AlgebraicMesh*>::iterator IT;
164 id.push_back(it->first);
284 const bool& called_from_constructor =
false)
289 if (!called_from_constructor)
291 std::ostringstream error_message;
292 error_message <<
"\nNegative ID, " <<
id
293 <<
", only allowed if called from constructor and\n"
294 <<
"indicated as such by optional boolean flag."
297 OOMPH_CURRENT_FUNCTION,
298 OOMPH_EXCEPTION_LOCATION);
397 std::ostringstream error_message;
398 error_message <<
"There is no reference mesh for node update fct id"
401 OOMPH_CURRENT_FUNCTION,
402 OOMPH_EXCEPTION_LOCATION);
411 std::ostringstream error_message;
412 error_message <<
"There is no Geom_object_pt for node update fct id"
415 OOMPH_CURRENT_FUNCTION,
416 OOMPH_EXCEPTION_LOCATION);
425 std::ostringstream error_message;
426 error_message <<
"There is no Ref_value for node update fct id" <<
id
429 OOMPH_CURRENT_FUNCTION,
430 OOMPH_EXCEPTION_LOCATION);
536 template<
class ELEMENT>
574 template<
class ELEMENT>
625 std::ostringstream error_stream;
626 error_stream <<
"Error: Node " << n <<
"is a "
627 <<
typeid(
Node_pt[n]).name() <<
", not an AlgebraicNode"
630 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
656 if (update_all_solid_nodes)
659 "Doesn't make sense to use an AlgebraicMesh with\n";
661 "SolidElements so specifying update_all_solid_nodes=true\n";
662 error_message +=
"doesn't make sense either\n";
665 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
672 unsigned n_node =
nnode();
677 for (
unsigned n = 0; n < n_node; n++)
684 unsigned n_dim = alg_nod_pt->
ndim();
688 for (
unsigned n = 0; n < n_node; n++)
695 for (
unsigned i = 0;
i < n_dim;
i++)
702 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
705 for (
unsigned i = 0;
i < n_dim;
i++)
713 for (
unsigned i = 0;
i < n_dim;
i++)
730 int iproc = (*it).first;
734 if (n_ext_halo_node > 0)
736 for (
unsigned n = 0; n < n_ext_halo_node; n++)
744 unsigned n_dim = alg_nod_pt->
ndim();
748 for (
unsigned n = 0; n < n_ext_halo_node; n++)
755 for (
unsigned i = 0;
i < n_dim;
i++)
762 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
765 for (
unsigned i = 0;
i < n_dim;
i++)
773 for (
unsigned i = 0;
i < n_dim;
i++)
798 unsigned n_node =
nnode();
799 for (
unsigned n = 0; n < n_node; n++)
807 oomph_info <<
"Done algnode selftest in mesh" << std::endl;
////////////////////////////////////////////////////////////////////
AlgebraicElementBase(const AlgebraicElementBase &)=delete
Broken copy constructor.
void operator=(const AlgebraicElementBase &)=delete
Broken assignment operator.
void setup_algebraic_node_update(Node *&node_pt, const Vector< double > &s_father, FiniteElement *father_el_pt) const
Set up node update info for (newly created) algebraic node: I.e. work out its node update information...
AlgebraicElementBase()
Empty constructor.
Algebraic elements are elements that have AlgebraicNodes whose position is determined by the geometri...
~AlgebraicElement()
Broken assignment operator.
AlgebraicElement(const AlgebraicElement &)=delete
Broken copy constructor.
AlgebraicElement()
Constructor – simply calls the constructor of the underlying ELEMENT.
AlgebraicElement(FiniteElement *const &element_pt, const int &face_index)
Constructor for face elements.
////////////////////////////////////////////////////////////////////
~AlgebraicMesh()
Broken assignment operator.
AlgebraicMesh()
Constructor: create a null zeroth entry in the Geom_object_list_pt Vector (each AlgebraicMesh's const...
virtual void update_node_update(AlgebraicNode *&node_pt)=0
Update the node update info for given node, following mesh adaptation. Must be implemented for every ...
AlgebraicMesh(const AlgebraicMesh &)=delete
Broken copy constructor.
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
virtual void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)=0
Update the nodal position posn at time level t (t=0: present; t>0: previous). Must be implemented for...
unsigned ngeom_object_list_pt()
Return number of geometric objects associated with AlgebraicMesh.
Vector< GeomObject * > Geom_object_list_pt
Vector of GeomObjects associated with this AlgebraicMesh The zeroth entry is null,...
void node_update(const bool &update_all_solid_nodes=false)
Update all nodal positions via algebraic node update functions [Doesn't make sense to use this mesh w...
unsigned self_test()
Self test: check consistentency of multiple node updates.
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Add the specified GeomObject to the list of geometric objects associated with this AlgebraicMesh; rem...
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
////////////////////////////////////////////////////////////////////
std::map< int, Vector< GeomObject * > >::iterator Default_it_geom_object_pt
Default iterator for vector of geom objects. These GeomObjects are involved in the default update.
unsigned ngeom_object(const int &id)
Number of geometric objects involved in id-th update function.
unsigned ngeom_object() const
Number of geometric objects involved in default (usually first) update function.
std::map< int, AlgebraicMesh * > Mesh_pt
Pointer to mesh that performs the specified node update operation (Map because this node may only use...
unsigned nref_value(const int &id)
Number of reference values involved in id-th update function.
unsigned nref_value()
Number of reference values involved in default (usually first) update function.
static AlgebraicMesh * Dummy_mesh_pt
Default dummy mesh to point to for nodes for which no remesh fct is defined.
std::map< int, AlgebraicMesh * >::iterator Default_it_mesh_pt
Default iterator for mesh: This mesh performs the default update.
static double Max_allowed_difference_between_node_update_fcts
What it says: Used in self-test to check if different node update functions produce the same result.
void set_default_node_update(const int &id)
Make id-th node update function the default.
unsigned self_test()
Perform self test: If the node has multiple node update functions, check that they all give the same ...
AlgebraicNode(const AlgebraicNode &)=delete
Broken copy constructor.
void node_update_fct_id(Vector< int > &id)
Return vector of node update fct ids (vector is resized to contain the correct number of entries)....
GeomObject * geom_object_pt(const unsigned &i)
Return pointer to i-th geometric object involved in default (usually first) update function.
static Vector< GeomObject * > Dummy_geom_object_pt
Default dummy vector of geom objects to point to for nodes for which no remesh fct is defined.
void node_update(const bool &update_all_time_levels_for_new_node=false)
Broken assignment operator.
AlgebraicNode()
Default Constructor.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
AlgebraicNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Constructor for steady algebraic node of spatial dimension n_dim, with n_position_type generalised co...
unsigned nnode_update_fcts()
Number of node update fcts.
AlgebraicMesh * mesh_pt()
Default (usually first) mesh that implements update function.
Vector< double > & vector_ref_value(const int &id)
Return vector of reference values involved in id-th update function.
double ref_value(const unsigned &i)
Return i-th reference value involved in default (usually first) update function.
void kill_node_update_info(const int &id=0)
Erase algebraic node update information for id-th node update function. Id defaults to 0.
Vector< GeomObject * > & vector_geom_object_pt()
Return vector of geometric objects involved in default (usually first) update function.
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Return vector of geometric objects involved in id-th update function.
static DummyAlgebraicMesh Dummy_mesh
Static Dummy mesh to which the pointer is addressed.
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
AlgebraicNode(TimeStepper *time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Constructor for bog-standard algebraic node of spatial dimension n_dim, with n_position_type generali...
std::map< int, Vector< double > >::iterator Default_it_ref_value
Default iterator for vector of ref values. These reference values are involved in the default update.
void add_node_update_info(const int &id, AlgebraicMesh *mesh_pt, const Vector< GeomObject * > &geom_object_pt, const Vector< double > &ref_value, const bool &called_from_constructor=false)
Add algebraic update information for node: What's the ID of the mesh update function (typically used ...
std::map< int, Vector< GeomObject * > > Geom_object_pt
Vector of geometric objects that are involved in the specified node update operation....
Vector< double > & vector_ref_value()
Return vector of reference values involved in default (usually first) update function.
int Default_node_update_fct_id
Default node update function ID.
AlgebraicMesh * mesh_pt(const int &id)
Mesh that implements the id-th node update function.
void add_node_update_info(AlgebraicMesh *mesh_pt, const Vector< GeomObject * > &geom_object_pt, const Vector< double > &ref_value)
Add algebraic update information for node: Which Mesh implements the update operation?...
virtual ~AlgebraicNode()
Destructor (empty)
std::map< int, Vector< double > > Ref_value
Vector of reference values that are required for the specified node update operation....
static int Dummy_node_update_fct_id
Default (negative!) remesh fct id for nodes for which no remesh fct is defined.
static Vector< double > Dummy_ref_value
Default dummy vector of reference values to point to for nodes for which no remesh fct is defined.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
////////////////////////////////////////////////////////////////////
DummyAlgebraicMesh()
Empty constructor.
virtual void setup_algebraic_node_update(AlgebraicNode *&nod_pt)
Setup algebraic node update for specified node; do nothing in this dummy version.
virtual void update_node_update(AlgebraicNode *&node_pt)
Update the node update info for given node, following mesh adaptation. Must be implemented for every ...
virtual void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Broken assignment operator.
DummyAlgebraicMesh(const DummyAlgebraicMesh &)=delete
Broken copy constructor.
Specific implementation of the class for specified element and node type.
FaceGeometry()
Constructor.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
/////////////////////////////////////////////////////////////////////
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
Vector< Node * > Node_pt
Vector of pointers to nodes.
unsigned nexternal_halo_node()
Total number of external halo nodes in this Mesh.
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...
unsigned long nnode() const
Return number of nodes in the mesh.
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
std::map< unsigned, Vector< Node * > > External_halo_node_pt
Map of vectors holding the pointers to the external halo nodes.
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.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following th...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
bool is_hanging() const
Test whether the node is geometrically hanging.
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////////// //////////////////////////////...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...