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)
69 LeakCheckNames::AlgebraicNode_build += 1;
86 const unsigned& n_dim,
87 const unsigned& n_position_type,
88 const unsigned& initial_nvalue)
92 LeakCheckNames::AlgebraicNode_build += 1;
108 LeakCheckNames::AlgebraicNode_build -= 1;
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."
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>
625 std::ostringstream error_stream;
626 error_stream <<
"Error: Node " <<
n <<
"is a "
627 <<
typeid(
Node_pt[
n]).
name() <<
", not an AlgebraicNode"
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";
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++)
726 External_halo_node_pt.begin();
727 it != External_halo_node_pt.end();
730 int iproc = (*it).first;
732 unsigned n_ext_halo_node = nexternal_halo_node(iproc);
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++)
750 Node* nod_pt = external_halo_node_pt(iproc,
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;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: algebraic_elements.h:506
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
Definition: algebraic_elements.cc:48
AlgebraicElementBase()
Empty constructor.
Definition: algebraic_elements.h:509
Definition: algebraic_elements.h:540
~AlgebraicElement()
Broken assignment operator.
Definition: algebraic_elements.h:566
AlgebraicElement(const AlgebraicElement &)=delete
Broken copy constructor.
AlgebraicElement()
Definition: algebraic_elements.h:544
AlgebraicElement(FiniteElement *const &element_pt, const int &face_index)
Constructor for face elements.
Definition: algebraic_elements.h:551
Definition: algebraic_elements.h:599
~AlgebraicMesh()
Broken assignment operator.
Definition: algebraic_elements.h:616
AlgebraicMesh()
Definition: algebraic_elements.h:604
virtual void update_node_update(AlgebraicNode *&node_pt)=0
AlgebraicMesh(const AlgebraicMesh &)=delete
Broken copy constructor.
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
Definition: algebraic_elements.h:835
virtual void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)=0
unsigned ngeom_object_list_pt()
Return number of geometric objects associated with AlgebraicMesh.
Definition: algebraic_elements.h:829
Vector< GeomObject * > Geom_object_list_pt
Definition: algebraic_elements.h:844
void node_update(const bool &update_all_solid_nodes=false)
Definition: algebraic_elements.h:653
unsigned self_test()
Self test: check consistentency of multiple node updates.
Definition: algebraic_elements.h:786
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Definition: algebraic_elements.h:823
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
Definition: algebraic_elements.h:620
Definition: algebraic_elements.h:55
std::map< int, Vector< GeomObject * > >::iterator Default_it_geom_object_pt
Definition: algebraic_elements.h:460
unsigned ngeom_object(const int &id)
Number of geometric objects involved in id-th update function.
Definition: algebraic_elements.h:184
unsigned ngeom_object() const
Definition: algebraic_elements.h:192
std::map< int, AlgebraicMesh * > Mesh_pt
Definition: algebraic_elements.h:439
unsigned nref_value(const int &id)
Number of reference values involved in id-th update function.
Definition: algebraic_elements.h:235
unsigned nref_value()
Definition: algebraic_elements.h:243
static AlgebraicMesh * Dummy_mesh_pt
Definition: algebraic_elements.h:479
std::map< int, AlgebraicMesh * >::iterator Default_it_mesh_pt
Default iterator for mesh: This mesh performs the default update.
Definition: algebraic_elements.h:456
static double Max_allowed_difference_between_node_update_fcts
Definition: algebraic_elements.h:471
void set_default_node_update(const int &id)
Make id-th node update function the default.
Definition: algebraic_elements.h:384
unsigned self_test()
Definition: algebraic_elements.cc:297
AlgebraicNode(const AlgebraicNode &)=delete
Broken copy constructor.
void node_update_fct_id(Vector< int > &id)
Definition: algebraic_elements.h:154
GeomObject * geom_object_pt(const unsigned &i)
Definition: algebraic_elements.h:229
static Vector< GeomObject * > Dummy_geom_object_pt
Definition: algebraic_elements.h:486
void node_update(const bool &update_all_time_levels_for_new_node=false)
Broken assignment operator.
Definition: algebraic_elements.cc:231
AlgebraicNode()
Default Constructor.
Definition: algebraic_elements.h:58
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
Definition: algebraic_elements.h:146
AlgebraicNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Definition: algebraic_elements.h:63
unsigned nnode_update_fcts()
Number of node update fcts.
Definition: algebraic_elements.h:136
AlgebraicMesh * mesh_pt()
Default (usually first) mesh that implements update function.
Definition: algebraic_elements.h:170
Vector< double > & vector_ref_value(const int &id)
Definition: algebraic_elements.h:259
double ref_value(const unsigned &i)
Definition: algebraic_elements.h:267
void kill_node_update_info(const int &id=0)
Definition: algebraic_elements.h:365
Vector< GeomObject * > & vector_geom_object_pt()
Definition: algebraic_elements.h:208
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Definition: algebraic_elements.h:200
static DummyAlgebraicMesh Dummy_mesh
Static Dummy mesh to which the pointer is addressed.
Definition: algebraic_elements.h:482
GeomObject ** all_geom_object_pt()
Return the vector of all geometric objects.
Definition: algebraic_elements.h:215
AlgebraicNode(TimeStepper *time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Definition: algebraic_elements.h:85
std::map< int, Vector< double > >::iterator Default_it_ref_value
Definition: algebraic_elements.h:464
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)
Definition: algebraic_elements.h:280
std::map< int, Vector< GeomObject * > > Geom_object_pt
Definition: algebraic_elements.h:446
Vector< double > & vector_ref_value()
Definition: algebraic_elements.h:251
int Default_node_update_fct_id
Default node update function ID.
Definition: algebraic_elements.h:467
AlgebraicMesh * mesh_pt(const int &id)
Mesh that implements the id-th node update function.
Definition: algebraic_elements.h:177
void add_node_update_info(AlgebraicMesh *mesh_pt, const Vector< GeomObject * > &geom_object_pt, const Vector< double > &ref_value)
Definition: algebraic_elements.h:331
virtual ~AlgebraicNode()
Destructor (empty)
Definition: algebraic_elements.h:105
std::map< int, Vector< double > > Ref_value
Definition: algebraic_elements.h:453
static int Dummy_node_update_fct_id
Definition: algebraic_elements.h:475
static Vector< double > Dummy_ref_value
Definition: algebraic_elements.h:490
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
Dummy algebraic mesh – used for default assignements.
Definition: algebraic_elements.h:859
DummyAlgebraicMesh()
Empty constructor.
Definition: algebraic_elements.h:862
virtual void setup_algebraic_node_update(AlgebraicNode *&nod_pt)
Definition: algebraic_elements.h:886
virtual void update_node_update(AlgebraicNode *&node_pt)
Definition: algebraic_elements.h:882
virtual void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Broken assignment operator.
Definition: algebraic_elements.h:872
DummyAlgebraicMesh(const DummyAlgebraicMesh &)=delete
Broken copy constructor.
Definition: element_with_moving_nodes.h:382
FaceGeometry()
Constructor.
Definition: algebraic_elements.h:580
Definition: elements.h:4998
Definition: elements.h:1313
Definition: geom_objects.h:101
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Definition: nodes.h:808
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Definition: nodes.h:791
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:183
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
Definition: mesh.cc:778
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
void perform_auxiliary_node_update_fct()
Definition: nodes.h:1615
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
Definition: oomph_definitions.h:222
Definition: timesteppers.h:231
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
list x
Definition: plotDoE.py:28
string name
Definition: plotDoE.py:33
t
Definition: plotPSD.py:36
Definition: indexed_view.cpp:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86