49 std::set<Data*> &unique_geom_data_pt)
52 unique_geom_data_pt.clear();
55 const unsigned n_node = this->
nnode();
58 for(
unsigned n=0;n<n_node;n++)
64 const bool node_is_hanging = nod_pt->
is_hanging();
70 Node* master_node_pt=nod_pt;
79 nmaster = hang_info_pt->
nmaster();
83 for (
unsigned imaster=0;imaster<nmaster;imaster++)
91 const unsigned n_geom_data = master_node_pt->
ngeom_data();
99 for(
unsigned i=0;
i<n_geom_data;
i++)
101 unique_geom_data_pt.insert(node_geom_data_pt[
i]);
117 for(
unsigned i=0;
i<n_geom_obj;
i++)
124 unsigned n_geom_data=geom_obj_pt->
ngeom_data();
128 for (
unsigned idata=0;idata<n_geom_data;idata++)
130 unique_geom_data_pt.insert(geom_obj_pt->
geom_data_pt(idata));
145 std::set<Data*> unique_geom_data_pt;
155 typedef std::set<Data*>::iterator IT;
156 for (IT it=unique_geom_data_pt.begin();it!=unique_geom_data_pt.end();it++)
182 for(
unsigned i=0;
i<n_geom_data;
i++)
187 std::stringstream conversion;
188 conversion<<
" of Geometric Data "<<
i<<current_string;
200 const bool &store_local_dof_pt)
219 for(
unsigned i=1;
i<n_geom_data;
i++)
241 for(
unsigned i=0;
i<n_total_values;
i++)
245 for(
unsigned i=1;
i<n_geom_data;++
i)
257 std::deque<unsigned long> global_eqn_number_queue;
260 for(
unsigned i=0;
i<n_geom_data;
i++)
266 unsigned n_value= data_pt->
nvalue();
267 for (
unsigned j=0;j<n_value;j++)
276 global_eqn_number_queue.push_back(eqn_number);
278 if(store_local_dof_pt)
304 if(store_local_dof_pt)
324 const unsigned n_geometric_data =
ngeom_data();
327 if(n_geometric_data == 0)
return;
330 const unsigned n_dof = this->
ndof();
333 unsigned n_nod=this->
nnode();
336 if (n_nod==0)
return;
342 unsigned n_shape_controlling_node=
nnode();
367 if (
Ngeom_dof<(n_shape_controlling_node*dim_nod))
398 for(
unsigned i=0;
i<n_geometric_data;
i++)
402 for(
unsigned j=0;j<n_value;j++)
407 if(local_unknown >= 0)
413 double old_var = *value_pt;
416 *value_pt += fd_step;
425 for(
unsigned m=0;m<n_dof;m++)
428 jacobian(m,local_unknown) = (newres[m] - residuals[m])/fd_step;
455 n_shape_controlling_node,
463 ref_el_pt->RefineableElement::get_dresidual_dnodal_coordinates(
464 dresidual_dnodal_coordinates);
469 dresidual_dnodal_coordinates);
484 n_shape_controlling_node,
490 for (
unsigned l=0;l<n_dof;l++)
493 for(
unsigned i_data=0;i_data<n_geometric_data;i_data++)
497 for(
unsigned j_val=0;j_val<n_value;j_val++)
505 for (
unsigned i=0;
i<dim_nod;
i++)
507 for (
unsigned j=0;j<n_shape_controlling_node;j++)
510 dresidual_dnodal_coordinates(l,
i,j)*
511 dnodal_coordinates_dgeom_dofs(k,
i,j);
524 std::ostringstream error_message;
525 error_message <<
"Never get here: method " << method;
528 OOMPH_CURRENT_FUNCTION,
529 OOMPH_EXCEPTION_LOCATION);
547 const unsigned n_geometric_data =
ngeom_data();
550 if(n_geometric_data == 0) {
return;}
553 const unsigned n_nod=
nnode();
556 if (n_nod==0)
return;
562 unsigned n_shape_controlling_node=n_nod;
576 std::map<Node*,unsigned> local_shape_controlling_node_lookup;
581 local_shape_controlling_node_lookup=
588 for (
unsigned j=0;j<n_nod;j++)
590 local_shape_controlling_node_lookup[
node_pt(j)]=count;
596 for (std::map<Node*,unsigned>::iterator it=
597 local_shape_controlling_node_lookup.begin();
598 it!=local_shape_controlling_node_lookup.end();
602 Node* nod_pt=it->first;
605 unsigned node_number=it->second;
608 for (
unsigned i=0;
i<dim_nod;
i++)
622 for(
unsigned i=0;
i<n_geometric_data;
i++)
626 for(
unsigned j=0;j<n_value;j++)
631 if(local_unknown >= 0)
637 double old_var = *value_pt;
640 *value_pt += fd_step;
646 for (std::map<Node*,unsigned>::iterator it=
647 local_shape_controlling_node_lookup.begin();
648 it!=local_shape_controlling_node_lookup.end();
652 Node* nod_pt=it->first;
655 unsigned node_number=it->second;
658 for (
unsigned ii=0;ii<dim_nod;ii++)
660 dnodal_coordinates_dgeom_dofs(local_unknown,ii,node_number)=
661 (nod_pt->
position(ii)-pos(ii,node_number))/fd_step;
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
Vector< Data * > Geom_data_pt
Vector that stores pointers to all Data that affect the node update operations, i.e. the variables that can affect the position of the node.
virtual unsigned ngeom_data() const
How many items of Data does the shape of the object depend on? This is implemented as a broken virtua...
unsigned ngeom_data() const
Return the number of geometric data upon which the shape of the element depends.
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double *> const &global_dof_pt)
Add the contents of the queue global_eqn_numbers to the local storage for the local-to-global transla...
bool Bypass_fill_in_jacobian_from_geometric_data
Set flag to true to bypass calculation of Jacobain entries resulting from geometric data...
virtual Data ** all_geom_data_pt()
Return a pointer to an array of all (geometric) data that affect the nodal position. The default value is zero (node is stationary)
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
bool Evaluate_dresidual_dnodal_coordinates_by_fd
Boolean to decide if shape derivatives are to be evaluated by fd (using FiniteElement::get_dresidual_...
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
virtual unsigned ngeom_data() const
Return the number of geometric data that affect the nodal position. The default value is zero (node i...
int ** Geometric_data_local_eqn
Array to hold local eqn number information for the geometric Data variables.
int Method_for_shape_derivs
Choose method for evaluation of shape derivatives (this takes one of the values in the enumeration) ...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned nmaster() const
Return the number of master nodes.
bool is_hanging() const
Test whether the node is geometrically hanging.
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Node. The ostream specifies the output stream to which the descr...
virtual GeomObject ** all_geom_object_pt()
Return a pointer to an array of all (geometric) objects that affect the nodal position. The default value is zero (node is stationary)
virtual unsigned ngeom_object() const
Return the number of geometric objects that affect the nodal position. The default value is zero (nod...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned nshape_controlling_nodes()
Number of shape-controlling nodes = the number of non-hanging nodes plus the number of master nodes a...
static long Is_pinned
Static "Magic number" used in place of the equation number to indicate that the value is pinned...
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
void position(Vector< double > &pos) const
Compute Vector of nodal positions either directly or via hanging node representation.
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
A class that represents a collection of data; each Data object may contain many different individual ...
int geometric_data_local_eqn(const unsigned &n, const unsigned &i)
Return the local equation number corresponding to the i-th value at the n-th geometric data object...
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Class that contains data for hanging nodes.
void assemble_set_of_all_geometric_data(std::set< Data *> &unique_geom_data_pt)
Return a set of all geometric data associated with the element.
virtual void get_dnodal_coordinates_dgeom_dofs(RankThreeTensor< double > &dnodal_coordinates_dgeom_dofs)
Compute derivatives of the nodal coordinates w.r.t. to the geometric dofs. Default implementation by ...
std::map< Node *, unsigned > shape_controlling_node_lookup()
Return lookup scheme for unique number associated with any of the nodes that actively control the sha...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
static long Is_unclassified
Static "Magic number" used in place of the equation number to denote a value that hasn't been classif...
unsigned Ngeom_dof
Number of geometric dofs (computed on the fly when equation numbers are set up)
static std::deque< double * > Dof_pt_deque
Static storage for deque used to add_global_equation_numbers when pointers to the dofs in each elemen...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number...
unsigned nnode() const
Return the number of nodes.
virtual Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on. This is implemented as a bro...
void fill_in_jacobian_from_geometric_data(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the Jacobian matrix from the geometric data. This version assumes that...
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
void complete_setup_of_dependencies()
Construct the vector of (unique) geometric data.
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates. Default implementation by FD can be overwritten for specific elements. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}.
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...