26#ifndef OOMPH_ALGEBRAIC_ELEMENTS_HEADER
27#define OOMPH_ALGEBRAIC_ELEMENTS_HEADER
39 class AlgebraicElementBase;
40 class DummyAlgebraicMesh;
86 const unsigned&
n_dim,
161 typedef std::map<int, AlgebraicMesh*>::iterator
IT;
164 id.push_back(
it->first);
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."
397 std::ostringstream error_message;
398 error_message <<
"There is no reference mesh for node update fct id"
411 std::ostringstream error_message;
412 error_message <<
"There is no Geom_object_pt for node update fct id"
425 std::ostringstream error_message;
426 error_message <<
"There is no Ref_value for node update fct id" <<
id
536 template<
class ELEMENT>
574 template<
class ELEMENT>
627 <<
typeid(
Node_pt[
n]).
name() <<
", not an AlgebraicNode"
658 std::string error_message =
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";
695 for (
unsigned i = 0;
i <
n_dim;
i++)
701 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
705 for (
unsigned i = 0;
i <
n_dim;
i++)
713 for (
unsigned i = 0;
i <
n_dim;
i++)
717 nod_pt->perform_auxiliary_node_update_fct();
730 int iproc = (*it).first;
755 for (
unsigned i = 0;
i <
n_dim;
i++)
761 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
765 for (
unsigned i = 0;
i <
n_dim;
i++)
773 for (
unsigned i = 0;
i <
n_dim;
i++)
807 oomph_info <<
"Done algnode selftest in mesh" << std::endl;
Base class for algebraic elements.
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.
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
~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 ...
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
AlgebraicMesh(const AlgebraicMesh &)=delete
Broken copy constructor.
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.
Algebraic nodes are nodes with an algebraic positional update function.
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.
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.
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
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.
Vector< GeomObject * > & vector_geom_object_pt()
Return vector of geometric objects involved in default (usually first) update function.
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.
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Return vector of geometric objects involved in id-th update function.
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.
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.
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.
static DummyAlgebraicMesh Dummy_mesh
Static Dummy mesh to which the pointer is addressed.
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...
AlgebraicMesh * mesh_pt(const int &id)
Mesh that implements the id-th node update function.
Vector< double > & vector_ref_value()
Return vector of reference values involved in default (usually first) update function.
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, AlgebraicMesh * >::iterator Default_it_mesh_pt
Default iterator for mesh: This mesh performs the default update.
std::map< int, Vector< GeomObject * > > Geom_object_pt
Vector of geometric objects that are involved in the specified node update operation....
int Default_node_update_fct_id
Default node update function ID.
Vector< double > & vector_ref_value(const int &id)
Return vector of reference values involved in id-th 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.
Dummy algebraic mesh – used for default assignements.
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.
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
A general Finite Element class.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
A geometric object is an object that provides a parametrised description of its shape via the functio...
unsigned ndim() const
Access function to # of Eulerian coordinates.
Vector< Node * > Node_pt
Vector of pointers to nodes.
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 nexternal_halo_node()
Total number of external halo nodes in this Mesh.
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...
An OomphLibError object which should be thrown when an run-time error is encountered....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
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...