44 std::set<Data*>& unique_geom_data_pt)
47 unique_geom_data_pt.clear();
50 const unsigned n_node = this->
nnode();
53 for (
unsigned n = 0; n < n_node; n++)
59 const bool node_is_hanging = nod_pt->
is_hanging();
65 Node* master_node_pt = nod_pt;
74 nmaster = hang_info_pt->
nmaster();
78 for (
unsigned imaster = 0; imaster < nmaster; imaster++)
88 const unsigned n_geom_data = master_node_pt->
ngeom_data();
96 for (
unsigned i = 0;
i < n_geom_data;
i++)
98 unique_geom_data_pt.insert(node_geom_data_pt[
i]);
114 for (
unsigned i = 0;
i < n_geom_obj;
i++)
121 unsigned n_geom_data = geom_obj_pt->
ngeom_data();
125 for (
unsigned idata = 0; idata < n_geom_data; idata++)
127 unique_geom_data_pt.insert(geom_obj_pt->
geom_data_pt(idata));
142 std::set<Data*> unique_geom_data_pt;
152 typedef std::set<Data*>::iterator IT;
153 for (IT it = unique_geom_data_pt.begin(); it != unique_geom_data_pt.end();
171 std::ostream& out,
const std::string& current_string)
const
180 for (
unsigned i = 0;
i < n_geom_data;
i++)
185 std::stringstream conversion;
186 conversion <<
" of Geometric Data " <<
i << current_string;
198 const bool& store_local_dof_pt)
217 for (
unsigned i = 1;
i < n_geom_data;
i++)
231 if (n_total_values == 0)
245 for (
unsigned i = 0;
i < n_total_values;
i++)
251 for (
unsigned i = 1;
i < n_geom_data; ++
i)
263 std::deque<unsigned long> global_eqn_number_queue;
266 for (
unsigned i = 0;
i < n_geom_data;
i++)
272 unsigned n_value = data_pt->
nvalue();
273 for (
unsigned j = 0; j < n_value; j++)
282 global_eqn_number_queue.push_back(
eqn_number);
284 if (store_local_dof_pt)
308 if (store_local_dof_pt)
329 const unsigned n_geometric_data =
ngeom_data();
332 if (n_geometric_data == 0)
return;
335 const unsigned n_dof = this->
ndof();
338 unsigned n_nod = this->
nnode();
341 if (n_nod == 0)
return;
347 unsigned n_shape_controlling_node =
nnode();
372 if (
Ngeom_dof < (n_shape_controlling_node * dim_nod))
398 int local_unknown = 0;
401 for (
unsigned i = 0;
i < n_geometric_data;
i++)
405 for (
unsigned j = 0; j < n_value; j++)
410 if (local_unknown >= 0)
416 double old_var = *value_pt;
419 *value_pt += fd_step;
428 for (
unsigned m = 0; m < n_dof; m++)
431 jacobian(m, local_unknown) =
432 (newres[m] - residuals[m]) / fd_step;
457 n_dof, dim_nod, n_shape_controlling_node, 0.0);
464 ref_el_pt->RefineableElement::get_dresidual_dnodal_coordinates(
465 dresidual_dnodal_coordinates);
470 dresidual_dnodal_coordinates);
479 dresidual_dnodal_coordinates);
484 n_dof, dim_nod, n_shape_controlling_node, 0.0);
489 for (
unsigned l = 0; l < n_dof; l++)
492 for (
unsigned i_data = 0; i_data < n_geometric_data; i_data++)
496 for (
unsigned j_val = 0; j_val < n_value; j_val++)
503 jacobian(l, k) = 0.0;
504 for (
unsigned i = 0;
i < dim_nod;
i++)
506 for (
unsigned j = 0; j < n_shape_controlling_node; j++)
508 jacobian(l, k) += dresidual_dnodal_coordinates(l,
i, j) *
509 dnodal_coordinates_dgeom_dofs(k,
i, j);
522 std::ostringstream error_message;
523 error_message <<
"Never get here: method " << method;
525 OOMPH_CURRENT_FUNCTION,
526 OOMPH_EXCEPTION_LOCATION);
542 const unsigned n_geometric_data =
ngeom_data();
545 if (n_geometric_data == 0)
551 const unsigned n_nod =
nnode();
554 if (n_nod == 0)
return;
560 unsigned n_shape_controlling_node = n_nod;
574 std::map<Node*, unsigned> local_shape_controlling_node_lookup;
579 local_shape_controlling_node_lookup =
586 for (
unsigned j = 0; j < n_nod; j++)
588 local_shape_controlling_node_lookup[
node_pt(j)] = count;
594 for (std::map<Node*, unsigned>::iterator it =
595 local_shape_controlling_node_lookup.begin();
596 it != local_shape_controlling_node_lookup.end();
600 Node* nod_pt = it->first;
603 unsigned node_number = it->second;
606 for (
unsigned i = 0;
i < dim_nod;
i++)
614 int local_unknown = 0;
620 for (
unsigned i = 0;
i < n_geometric_data;
i++)
624 for (
unsigned j = 0; j < n_value; j++)
629 if (local_unknown >= 0)
635 double old_var = *value_pt;
638 *value_pt += fd_step;
644 for (std::map<Node*, unsigned>::iterator it =
645 local_shape_controlling_node_lookup.begin();
646 it != local_shape_controlling_node_lookup.end();
650 Node* nod_pt = it->first;
653 unsigned node_number = it->second;
656 for (
unsigned ii = 0; ii < dim_nod; ii++)
658 dnodal_coordinates_dgeom_dofs(local_unknown, ii, node_number) =
659 (nod_pt->
position(ii) - pos(ii, node_number)) / fd_step;
A class that represents a collection of data; each Data object may contain many different individual ...
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
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...
static long Is_pinned
Static "Magic number" used in place of the equation number to indicate that the value is pinned.
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...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
static long Is_unclassified
Static "Magic number" used in place of the equation number to denote a value that hasn't been classif...
Vector< Data * > Geom_data_pt
Vector that stores pointers to all Data that affect the node update operations, i....
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.
unsigned Ngeom_dof
Number of geometric dofs (computed on the fly when equation numbers are set up)
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 assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Assign local equation numbers for the geometric Data in the element If the boolean argument is true t...
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 ...
bool Bypass_fill_in_jacobian_from_geometric_data
Set flag to true to bypass calculation of Jacobain entries resulting from geometric data.
void complete_setup_of_dependencies()
Construct the vector of (unique) geometric data.
int Method_for_shape_derivs
Choose method for evaluation of shape derivatives (this takes one of the values in the enumeration)
@ Shape_derivs_by_chain_rule
@ Shape_derivs_by_fastest_method
@ Shape_derivs_by_direct_fd
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 ...
unsigned ngeom_data() const
Return the number of geometric data upon which the shape of the element depends.
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.
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...
int ** Geometric_data_local_eqn
Array to hold local eqn number information for the geometric Data variables.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nnode() const
Return the number of nodes.
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 void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
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...
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...
/////////////////////////////////////////////////////////////////////
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...
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...
Class that contains data for hanging 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...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
virtual unsigned ngeom_object() const
Return the number of geometric objects that affect the nodal position. The default value is zero (nod...
virtual GeomObject ** all_geom_object_pt()
Return a pointer to an array of all (geometric) objects that affect the nodal position....
void position(Vector< double > &pos) const
Compute Vector of nodal positions either directly or via hanging node representation.
virtual Data ** all_geom_data_pt()
Return a pointer to an array of all (geometric) data that affect the nodal position....
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
virtual unsigned ngeom_data() const
Return the number of geometric data that affect the nodal position. The default value is zero (node i...
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....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
unsigned nshape_controlling_nodes()
Number of shape-controlling nodes = the number of non-hanging nodes plus the number of master nodes a...
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.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...