29 #ifndef OOMPH_REFINEABLE_ELEMENTS_HEADER
30 #define OOMPH_REFINEABLE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
122 static void check_value_id(
const int& n_continuously_interpolated_values,
123 const int& value_id);
253 template<
class ELEMENT>
262 son_pt.resize(n_sons);
265 for (
unsigned i = 0;
i < n_sons;
i++)
267 son_pt[
i] =
new ELEMENT;
269 son_pt[
i]->set_refinement_level(son_refine_level);
280 #ifdef RANGE_CHECKING
283 std::ostringstream error_message;
284 error_message <<
"Range Error: Value " <<
i
285 <<
" is not in the range (0,"
304 bool& was_already_built,
305 std::ofstream& new_nodes_file) = 0;
373 unsigned n_node = this->
nnode();
374 for (
unsigned n = 0;
n < n_node;
n++)
448 const unsigned& n1d,
const unsigned&
i,
const int& value_id)
483 const int& value_id)
const
505 std::set<std::pair<Data*, unsigned>>& paired_field_data);
577 father_at_reflevel_pt = father_el_pt;
583 father_at_reflevel_pt);
591 const unsigned& initial_p_order = 0)
762 Mesh*
const& mesh_pt,
769 unsigned n_node = this->
nnode();
770 for (
unsigned n = 0;
n < n_node;
n++)
803 bool& was_already_built,
804 std::ofstream& new_nodes_file)
806 std::ostringstream error_message;
807 error_message <<
"This function is broken as it's only needed/used \n"
808 <<
"during \"proper\" refinement\n";
818 std::ostringstream error_message;
819 error_message <<
"This function is broken as it's only needed/used \n"
820 <<
"during \"proper\" refinement\n";
830 std::ostringstream error_message;
831 error_message <<
"This function is broken as it's only needed/used \n"
832 <<
"during \"proper\" refinement\n";
841 std::ostringstream error_message;
842 error_message <<
"This function is broken as it's only needed/used \n"
843 <<
"during \"proper\" refinement\n";
851 std::ostringstream error_message;
852 error_message <<
"This function is broken as it's only needed/used \n"
853 <<
"during \"proper\" refinement\n";
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void shape(const Vector< double > &s, Shape &psi) const =0
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:3544
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
Definition: elements.cc:3882
int get_node_number(Node *const &node_pt) const
Definition: elements.cc:3814
virtual unsigned nnode_1d() const
Definition: elements.h:2218
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Definition: elements.h:1858
Definition: elements.h:73
void set_non_obsolete()
Mark node as non-obsolete.
Definition: nodes.h:1442
Definition: refineable_elements.h:798
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Broken function – this shouldn't really be needed.
Definition: refineable_elements.h:815
void check_integrity(double &max_error)
Broken function – this shouldn't really be needed.
Definition: refineable_elements.h:839
void rebuild_from_sons(Mesh *&mesh_pt)
Broken function – this shouldn't really be needed.
Definition: refineable_elements.h:849
virtual void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Broken function – this shouldn't really be needed.
Definition: refineable_elements.h:826
void build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)
Broken build function – shouldn't really be needed.
Definition: refineable_elements.h:801
Definition: refineable_elements.h:1042
Definition: oomph_definitions.h:222
p-refineable version of RefineableElement
Definition: refineable_elements.h:652
bool to_be_p_unrefined()
Has the element been selected for p-unrefinement?
Definition: refineable_elements.h:755
bool p_refinement_is_enabled()
Flag to indicate suppression of any refinement.
Definition: refineable_elements.h:687
void enable_p_refinement()
Emnable refinement for this element.
Definition: refineable_elements.h:699
bool nodes_built()
Return true if all the nodes have been built, false if not.
Definition: refineable_elements.h:766
unsigned & p_order()
Access function to P_order.
Definition: refineable_elements.h:705
void operator=(const PRefineableElement &)=delete
Broken assignment operator.
PRefineableElement(const PRefineableElement &)=delete
Broken copy constructor.
virtual ~PRefineableElement()
Destructor, empty.
Definition: refineable_elements.h:678
virtual unsigned initial_p_order() const =0
virtual void p_refine(const int &inc, Mesh *const &mesh_pt, GeneralisedElement *const &clone_pt)=0
p-refine the element
void disable_p_refinement()
Suppress of any refinement for this element.
Definition: refineable_elements.h:693
bool To_be_p_refined
Flag for p-refinement.
Definition: refineable_elements.h:658
unsigned P_order
The polynomial expansion order of the elemental basis functions.
Definition: refineable_elements.h:655
void select_for_p_refinement()
Select the element for p-refinement.
Definition: refineable_elements.h:725
bool To_be_p_unrefined
Flag for unrefinement.
Definition: refineable_elements.h:664
void deselect_for_p_unrefinement()
Deselect the element for p-unrefinement.
Definition: refineable_elements.h:743
bool to_be_p_refined()
Has the element been selected for refinement?
Definition: refineable_elements.h:749
void select_for_p_unrefinement()
Select the element for p-unrefinement.
Definition: refineable_elements.h:737
bool P_refinement_is_enabled
Flag to indicate suppression of any refinement.
Definition: refineable_elements.h:661
unsigned p_order() const
Access function to P_order (const version)
Definition: refineable_elements.h:711
void deselect_for_p_refinement()
Deselect the element for p-refinement.
Definition: refineable_elements.h:731
PRefineableElement()
Constructor, calls the RefineableElement constructor.
Definition: refineable_elements.h:668
A Rank 3 Tensor class.
Definition: matrices.h:1370
Definition: refineable_elements.h:97
void set_number(const long &mynumber)
Set element number (for debugging/plotting)
Definition: refineable_elements.h:401
void select_sons_for_unrefinement()
Unrefinement will be performed by merging the four sons of this element.
Definition: refineable_elements.h:332
void assemble_local_to_eulerian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Definition: refineable_elements.cc:133
Tree * tree_pt()
Access function: Pointer to quadtree representation of this element.
Definition: refineable_elements.h:211
virtual void build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)=0
static double Max_integrity_tolerance
Max. allowed discrepancy in element integrity check.
Definition: refineable_elements.h:118
virtual RefineableElement * root_element_pt()
Definition: refineable_elements.h:524
static double & max_integrity_tolerance()
Max. allowed discrepancy in element integrity check.
Definition: refineable_elements.h:495
virtual void further_build()
Further build: e.g. deal with interpolation of internal values.
Definition: refineable_elements.h:599
void select_for_refinement()
Select the element for refinement.
Definition: refineable_elements.h:320
virtual void rebuild_from_sons(Mesh *&mesh_pt)=0
void assign_hanging_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for hanging node variables.
Definition: refineable_elements.cc:312
virtual void pre_build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt)
Pre-build the element.
Definition: refineable_elements.h:596
void set_refinement_level(const int &refine_level)
Set the refinement level.
Definition: refineable_elements.h:308
virtual void unbuild()
Definition: refineable_elements.h:362
Tree * Tree_pt
A pointer to a general tree object.
Definition: refineable_elements.h:100
virtual void deactivate_element()
Definition: refineable_elements.cc:293
long number() const
Element number (for debugging/plotting)
Definition: refineable_elements.h:395
double local_to_eulerian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: refineable_elements.cc:215
virtual bool nodes_built()
Return true if all the nodes have been built, false if not.
Definition: refineable_elements.h:389
virtual unsigned ncont_interpolated_values() const =0
virtual void setup_hanging_nodes(Vector< std::ofstream * > &output_stream)
Definition: refineable_elements.h:604
virtual void initial_setup(Tree *const &adopted_father_pt=0, const unsigned &initial_p_order=0)
Definition: refineable_elements.h:590
void identify_field_data_for_interactions(std::set< std::pair< Data *, unsigned >> &paired_field_data)
Definition: refineable_elements.cc:523
void get_father_at_refinement_level(unsigned &refinement_level, RefineableElement *&father_at_reflevel_pt)
Definition: refineable_elements.h:564
unsigned refinement_level() const
Return the Refinement level.
Definition: refineable_elements.h:314
static void check_value_id(const int &n_continuously_interpolated_values, const int &value_id)
Definition: refineable_elements.cc:53
unsigned Refine_level
Refinement level.
Definition: refineable_elements.h:103
void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Definition: refineable_elements.cc:597
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: refineable_elements.cc:675
virtual unsigned ninterpolating_node_1d(const int &value_id)
Definition: refineable_elements.h:474
void disable_refinement()
Suppress of any refinement for this element.
Definition: refineable_elements.h:237
virtual void further_setup_hanging_nodes()
Definition: refineable_elements.h:609
long Number
Global element number – for plotting/validation purposes.
Definition: refineable_elements.h:115
virtual unsigned ninterpolating_node(const int &value_id)
Definition: refineable_elements.h:466
virtual void interpolating_basis(const Vector< double > &s, Shape &psi, const int &value_id) const
Definition: refineable_elements.h:481
bool refinement_is_enabled()
Flag to indicate suppression of any refinement.
Definition: refineable_elements.h:231
virtual unsigned required_nsons() const
Definition: refineable_elements.h:224
void deselect_for_refinement()
Deselect the element for refinement.
Definition: refineable_elements.h:326
void assemble_local_to_eulerian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Definition: refineable_elements.cc:77
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
unsigned nshape_controlling_nodes()
Definition: refineable_elements.h:627
bool To_be_refined
Flag for refinement.
Definition: refineable_elements.h:106
std::map< Node *, int > * Local_hang_eqn
Definition: refineable_elements.h:167
std::map< Node *, unsigned > shape_controlling_node_lookup()
Definition: refineable_elements.h:636
RefineableElement()
Definition: refineable_elements.h:188
virtual Node * interpolating_node_pt(const unsigned &n, const int &value_id)
Definition: refineable_elements.h:437
void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: refineable_elements.h:511
void split(Vector< ELEMENT * > &son_pt) const
Definition: refineable_elements.h:254
bool to_be_refined()
Has the element been selected for refinement?
Definition: refineable_elements.h:345
void enable_refinement()
Emnable refinement for this element.
Definition: refineable_elements.h:243
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Definition: refineable_elements.h:278
void assemble_eulerian_base_vectors(const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
Definition: refineable_elements.cc:177
virtual double local_one_d_fraction_of_interpolating_node(const unsigned &n1d, const unsigned &i, const int &value_id)
Definition: refineable_elements.h:447
RefineableElement(const RefineableElement &)=delete
Broken copy constructor.
void set_tree_pt(Tree *my_tree_pt)
Set pointer to quadtree representation of this element.
Definition: refineable_elements.h:217
bool Sons_to_be_unrefined
Flag for unrefinement.
Definition: refineable_elements.h:112
virtual Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &value_id)
Definition: refineable_elements.h:456
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_elements.h:417
std::map< Node *, unsigned > Shape_controlling_node_lookup
Definition: refineable_elements.h:172
virtual void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)=0
bool sons_to_be_unrefined()
Has the element been selected for unrefinement?
Definition: refineable_elements.h:351
bool Refinement_is_enabled
Flag to indicate suppression of any refinement.
Definition: refineable_elements.h:109
virtual ~RefineableElement()
Destructor, delete the allocated storage for the hanging equations.
Definition: refineable_elements.cc:38
virtual void check_integrity(double &max_error)=0
void operator=(const RefineableElement &)=delete
Broken assignment operator.
void deselect_sons_for_unrefinement()
Definition: refineable_elements.h:339
Definition: refineable_elements.h:874
virtual void further_build()
Definition: refineable_elements.h:1014
void disable_use_of_undeformed_macro_element_for_new_lagrangian_coords()
Definition: refineable_elements.h:996
bool is_undeformed_macro_element_used_for_new_lagrangian_coords() const
Definition: refineable_elements.h:980
Data * geom_data_pt(const unsigned &j)
Definition: refineable_elements.cc:1055
double local_to_lagrangian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: refineable_elements.cc:938
void assemble_local_to_lagrangian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Definition: refineable_elements.cc:894
void enable_use_of_undeformed_macro_element_for_new_lagrangian_coords()
Definition: refineable_elements.h:988
unsigned ngeom_data() const
Definition: refineable_elements.cc:1003
void assign_solid_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: refineable_elements.h:940
bool Use_undeformed_macro_element_for_new_lagrangian_coords
Definition: refineable_elements.h:899
virtual ~RefineableSolidElement()
Virtual Destructor, delete any allocated storage.
Definition: refineable_elements.h:936
RefineableSolidElement()
Constructor.
Definition: refineable_elements.h:928
void assign_solid_hanging_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: refineable_elements.cc:1178
void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: refineable_elements.cc:1335
std::map< Node *, DenseMatrix< int > > Local_position_hang_eqn
Definition: refineable_elements.h:880
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Definition: refineable_elements.cc:1137
DenseMatrix< int > & local_position_hang_eqn(Node *const &node_pt)
Definition: refineable_elements.h:1005
void assemble_local_to_lagrangian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Definition: refineable_elements.cc:855
Definition: elements.h:3561
virtual void assign_solid_local_eqn_numbers(const bool &store_local_dof)
Assign local equation numbers for the solid equations in the element.
Definition: elements.cc:6898
RefineableElement * object_pt() const
Definition: tree.h:88
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
Definition: tree.h:235
TreeRoot *& root_pt()
Return pointer to root of the tree.
Definition: tree.h:141
RealScalar s
Definition: level1_cplx_impl.h:130
double max_error
Definition: MortaringCantileverCompareToNonMortaring.cpp:188
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
void set(Container &c, Position position, const Value &value)
Definition: stdlist_overload.cpp:36
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2