34 #ifndef OOMPH_ELEMENT_WITH_MOVING_NODES 35 #define OOMPH_ELEMENT_WITH_MOVING_NODES 139 #ifdef RANGE_CHECKING 143 std::ostringstream error_message;
144 error_message <<
"Range Error: Data number " << n
145 <<
" is not in the range (0," 148 OOMPH_CURRENT_FUNCTION,
149 OOMPH_EXCEPTION_LOCATION);
156 std::ostringstream error_message;
157 error_message <<
"Range Error: value " << i <<
" at data " << n
158 <<
" is not in the range (0," 159 << n_value -1 <<
")";
161 OOMPH_CURRENT_FUNCTION,
162 OOMPH_EXCEPTION_LOCATION);
171 "Geometric data local equation numbers have not been allocated",
172 OOMPH_CURRENT_FUNCTION,
173 OOMPH_EXCEPTION_LOCATION);
191 for(
unsigned n=0;n<n_geom_data;n++)
226 const bool& i_know_what_i_am_doing=
false)
228 if (!i_know_what_i_am_doing)
230 std::ostringstream error_message;
232 <<
"Evaluation of shape derivatives by chain rule is currently \n" 233 <<
"disabled because it's broken, at least for refineable \n" 234 <<
"elements. This all needs to be checked again very carefully\n" 235 <<
"following the instructions in the commit log\n" 236 <<
"If you know what you're doing and want to force this methodology\n" 237 <<
"call this function with the optional boolean set to true.\n";
240 "ElementWithMovingNodes::evaluate_shape_derivs_by_chain_rule()",
241 OOMPH_EXCEPTION_LOCATION);
250 const bool& i_know_what_i_am_doing=
false)
252 if (!i_know_what_i_am_doing)
254 std::ostringstream error_message;
256 <<
"Evaluation of shape derivatives by fastest method is currently \n" 257 <<
"disabled because it's broken, at least for refineable \n" 258 <<
"elements. This all needs to be checked again very carefully\n" 259 <<
"following the instructions in the commit log\n" 260 <<
"If you know what you're doing and want to force this methodology\n" 261 <<
"call this function with the optional boolean set to true.\n";
264 "ElementWithMovingNodes::evaluate_shape_derivs_by_fastest_method()",
265 OOMPH_EXCEPTION_LOCATION);
292 dnodal_coordinates_dgeom_dofs);
301 const bool &store_local_dof_pt);
319 const unsigned n_dof =
ndof();
373 template<
class ELEMENT,
class NODE_TYPE>
390 ELEMENT::describe_local_dofs(out,current_string);
400 const int &face_index) :
411 ELEMENT::describe_local_dofs(out,curr_str);
484 ELEMENT::complete_setup_of_dependencies();
496 ELEMENT::assign_all_generic_local_eqn_numbers(store_local_dof_pt);
506 ELEMENT::get_jacobian(residuals,jacobian);
518 ELEMENT::get_jacobian_and_mass_matrix(residuals,jacobian,mass_matrix);
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.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
unsigned ngeom_data() const
Return the number of geometric data upon which the shape of the element depends.
A policy class that serves to establish the common interfaces for elements that contain moving nodes...
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0...
bool Bypass_fill_in_jacobian_from_geometric_data
Set flag to true to bypass calculation of Jacobain entries resulting from geometric data...
void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Compute the element's residuals vector and jacobian matrix.
bool Evaluate_dresidual_dnodal_coordinates_by_fd
Boolean to decide if shape derivatives are to be evaluated by fd (using FiniteElement::get_dresidual_...
Node * construct_boundary_node(const unsigned &n)
Overload the node assignment routine to assign boundary nodes.
virtual ~ElementWithMovingNodes()
Virtual destructor (clean up and allocated memory)
~ElementWithSpecificMovingNodes()
Empty Destructor,.
A general Finite Element class.
int ** Geometric_data_local_eqn
Array to hold local eqn number information for the geometric Data variables.
void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Assign local equation numbers for the underlying element, then deal with the additional geometric dof...
int Method_for_shape_derivs
Choose method for evaluation of shape derivatives (this takes one of the values in the enumeration) ...
void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residuals vector and jacobian matrix.
ElementWithMovingNodes()
Constructor.
bool are_dresidual_dnodal_coordinates_always_evaluated_by_fd() const
Return whether shape derivatives are evaluated by fd.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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 ...
bool is_fill_in_jacobian_from_geometric_data_bypassed() const
Test whether the call to fill_in_jacobian_from_geometric_data is bypassed.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
void evaluate_shape_derivs_by_fastest_method(const bool &i_know_what_i_am_doing=false)
Evaluate shape derivatives by (anticipated) fastest method. Currently disabled by default because it'...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Node * construct_node(const unsigned &n)
Overload the node assignment routine to assign nodes of the appropriate type.
void identify_geometric_data(std::set< Data *> &geometric_data_pt)
Specify Data that affects the geometry of the element by adding the element's geometric Data to the s...
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Overloaded node allocation for unsteady problems.
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh...
unsigned ngeom_dof() const
Number of geometric dofs.
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Overloaded boundary node allocation for unsteady problems.
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
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 *& node_pt(const unsigned &n)
Return a pointer to the local node n.
ElementWithMovingNodes(const ElementWithMovingNodes &)
Broken copy constructor.
void disable_bypass_fill_in_jacobian_from_geometric_data()
Do not bypass the call to fill_in_jacobian_from_geometric_data.
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 ...
ElementWithSpecificMovingNodes()
Constructor, call the constructor of the base element.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Ngeom_dof
Number of geometric dofs (computed on the fly when equation numbers are set up)
void enable_always_evaluate_dresidual_dnodal_coordinates_by_fd()
Insist that shape derivatives are always evaluated by fd (using FiniteElement::get_dresidual_dnodal_c...
void describe_local_dofs(std::ostream &out, std::string &curr_str)
Unique final overrider for describe_dofs.
void operator=(const ElementWithMovingNodes &)
Broken assignment operator.
int & method_for_shape_derivs()
Access to method (enumerated flag) for determination of shape derivs.
void evaluate_shape_derivs_by_direct_fd()
Evaluate shape derivatives by direct finite differencing.
ElementWithSpecificMovingNodes(FiniteElement *const &element_pt, const int &face_index)
Constructor used for face elements.
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 ...
void enable_bypass_fill_in_jacobian_from_geometric_data()
Bypass the call to fill_in_jacobian_from_geometric_data.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
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...
void fill_in_jacobian_from_geometric_data(DenseMatrix< double > &jacobian)
void evaluate_shape_derivs_by_chain_rule(const bool &i_know_what_i_am_doing=false)
Evaluate shape derivatives by chain rule. Currently disabled by default because it's broken; can re-e...
void complete_setup_of_dependencies()
Construct the vector of (unique) geometric data.
void complete_setup_of_dependencies()
Complete the setup of additional dependencies. Overloads empty virtual function in GeneralisedElement...
void disable_always_evaluate_dresidual_dnodal_coordinates_by_fd()
Insist that shape derivatives are always evaluated using the overloaded version of this function that...