63 unsigned nnod_father=father_el_pt->
nnode();
67 std::map<int,unsigned> id_count;
71 for (
unsigned j=0;j<nnod_father;j++)
75 node_update_fct_id(
id);
76 unsigned n_id=
id.size();
77 for (
unsigned i=0;
i<n_id;
i++)
85 typedef std::map<int,unsigned>::iterator IT;
86 for (IT it=id_count.begin();it!=id_count.end();it++)
88 if (it->second==nnod_father)
90 shared_ids.push_back(it->first);
96 unsigned n_update_id=shared_ids.size();
103 for (
unsigned i=0;
i<n_update_id;
i++)
106 int id=shared_ids[
i];
114 vector_geom_object_pt(
id));
121 unsigned nvalue=father_node_pt->
nref_value(
id);
125 Shape psi(nnod_father);
128 father_el_pt->
shape(s_father,psi);
131 for (
unsigned ivalue=0;ivalue<nvalue;ivalue++)
133 ref_value[ivalue]=0.0;
140 for (
unsigned j_father=0;j_father<nnod_father;j_father++)
144 father_el_pt->
node_pt(j_father))->
145 vector_ref_value(
id));
148 for (
unsigned ivalue=0;ivalue<nvalue;ivalue++)
150 ref_value[ivalue]+=father_ref_value[ivalue]*psi(j_father);
173 bool update_all_time_levels_for_new_node=
true;
174 alg_node_pt->
node_update(update_all_time_levels_for_new_node);
247 update_all_time_levels_for_new_node)
251 if (update_all_time_levels_for_new_node)
254 ntime= 1 + Position_time_stepper_pt->nprev_values();
273 unsigned nmaster=hanging_pt()->nmaster();
274 for (
unsigned imaster=0;imaster<nmaster;imaster++)
276 dynamic_cast<AlgebraicNode*
>(hanging_pt()->master_node_pt(imaster))
285 if (nnode_update_fcts()!=0)
288 for (
unsigned t=0;
t<ntime;
t++)
300 if (Aux_node_update_fct_pt!=0)
302 Aux_node_update_fct_pt(
this);
327 unsigned nnode_update=nnode_update_fcts();
342 unsigned ndim_node=ndim();
348 node_update_fct_id(
id);
353 if (
id.size()!=nnode_update)
355 std::ostringstream error_stream;
356 error_stream <<
"Inconsistency between number of node update ids:" 357 << nnode_update <<
" and " <<
id.size()
360 OOMPH_CURRENT_FUNCTION,
361 OOMPH_EXCEPTION_LOCATION);
369 set_default_node_update(
id[0]);
375 for (
unsigned i=0;
i<ndim_node;
i++)
382 for (
unsigned iupdate=1;iupdate<nnode_update;iupdate++)
386 set_default_node_update(
id[iupdate]);
392 for (
unsigned i=0;
i<ndim_node;
i++)
399 for (
unsigned i=0;
i<ndim_node;
i++)
401 err+=(x_new[
i]-x_0[
i])*(x_new[
i]-x_0[
i]);
410 if (err>Max_allowed_difference_between_node_update_fcts)
412 oomph_info <<
"Discrepancy in algebraic update function " 414 << x_0[0] <<
" " << x_0[1] <<
" " 415 << x_new[0] <<
" " << x_new[1] << std::endl;
426 set_default_node_update(
id[0]);
432 if (passed) {
return 0;}
void node_update(const bool &update_all_time_levels_for_new_node=false)
Broken assignment operator.
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 ...
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 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 ...
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.
A general Finite Element class.
AlgebraicMesh * mesh_pt()
Default (usually first) mesh that implements update function.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned self_test()
Self-test: Have all values been classified as pinned/unpinned? Return 0 if OK.
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...
static double Max_allowed_difference_between_node_update_fcts
unsigned self_test()
Perform self test: If the node has multiple node update functions, check that they all give the same ...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Dummy algebraic mesh – used for default assignements.
static DummyAlgebraicMesh Dummy_mesh
Static Dummy mesh to which the pointer is addressed.
static int Dummy_node_update_fct_id
Default (negative!) remesh fct id for nodes for which no remesh fct is defined.
unsigned nnode() const
Return the number of nodes.
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...
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...
static Vector< double > Dummy_ref_value
Default dummy vector of reference values to point to for nodes for which no remesh fct is defined...