57 unsigned nnod_father = father_el_pt->
nnode();
61 std::map<int, unsigned> id_count;
65 for (
unsigned j = 0; j < nnod_father; j++)
69 ->node_update_fct_id(
id);
70 unsigned n_id =
id.size();
71 for (
unsigned i = 0;
i < n_id;
i++)
79 typedef std::map<int, unsigned>::iterator IT;
80 for (IT it = id_count.begin(); it != id_count.end(); it++)
82 if (it->second == nnod_father)
84 shared_ids.push_back(it->first);
90 unsigned n_update_id = shared_ids.size();
97 for (
unsigned i = 0;
i < n_update_id;
i++)
100 int id = shared_ids[
i];
115 unsigned nvalue = father_node_pt->
nref_value(
id);
119 Shape psi(nnod_father);
122 father_el_pt->
shape(s_father, psi);
125 for (
unsigned ivalue = 0; ivalue < nvalue; ivalue++)
127 ref_value[ivalue] = 0.0;
134 for (
unsigned j_father = 0; j_father < nnod_father; j_father++)
142 for (
unsigned ivalue = 0; ivalue < nvalue; ivalue++)
144 ref_value[ivalue] += father_ref_value[ivalue] * psi(j_father);
166 bool update_all_time_levels_for_new_node =
true;
167 alg_node_pt->
node_update(update_all_time_levels_for_new_node);
232 const bool& update_all_time_levels_for_new_node)
236 if (update_all_time_levels_for_new_node)
259 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
273 for (
unsigned t = 0;
t < ntime;
t++)
313 if (nnode_update <= 1)
321 double err_max = 0.0;
324 unsigned ndim_node =
ndim();
335 if (
id.size() != nnode_update)
337 std::ostringstream error_stream;
338 error_stream <<
"Inconsistency between number of node update ids:"
339 << nnode_update <<
" and " <<
id.size() << std::endl;
341 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
355 for (
unsigned i = 0;
i < ndim_node;
i++)
362 for (
unsigned iupdate = 1; iupdate < nnode_update; iupdate++)
371 for (
unsigned i = 0;
i < ndim_node;
i++)
378 for (
unsigned i = 0;
i < ndim_node;
i++)
380 err += (x_new[
i] - x_0[
i]) * (x_new[
i] - x_0[
i]);
391 oomph_info <<
"Discrepancy in algebraic update function " << iupdate
392 <<
": " << x_0[0] <<
" " << x_0[1] <<
" " << x_new[0]
393 <<
" " << x_new[1] << std::endl;
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...
////////////////////////////////////////////////////////////////////
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 ...
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...
////////////////////////////////////////////////////////////////////
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.
static AlgebraicMesh * Dummy_mesh_pt
Default dummy mesh to point to for nodes for which no remesh fct is defined.
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 ...
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.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
unsigned nnode_update_fcts()
Number of node update fcts.
AlgebraicMesh * mesh_pt()
Default (usually first) mesh that implements 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.
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 ...
Vector< double > & vector_ref_value()
Return vector of reference values involved in default (usually first) update function.
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.
unsigned self_test()
Self-test: Have all values been classified as pinned/unpinned? Return 0 if OK.
////////////////////////////////////////////////////////////////////
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
unsigned nnode() const
Return the number of nodes.
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.
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...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
AuxNodeUpdateFctPt Aux_node_update_fct_pt
Pointer to auxiliary update function – this can be used to update any nodal values following the upda...
TimeStepper * Position_time_stepper_pt
Pointer to the timestepper associated with the position data.
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....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...