Go to the documentation of this file.
23 #include "libmesh/elem.h"
24 #include "libmesh/mesh_refinement.h"
25 #include "libmesh/remote_elem.h"
39 #ifdef LIBMESH_ENABLE_AMR
44 if (this->
parent() !=
nullptr)
49 if (parent_p_level > p)
61 _p_level = cast_int<unsigned char>(p);
62 parent_p_level = cast_int<unsigned char>(p);
64 parent_p_level = std::min(parent_p_level,
82 _p_level = cast_int<unsigned char>(p);
99 unsigned int parent_p_level = this->
p_level();
101 for (
unsigned int c = 0; c != nc; c++)
113 mesh_refinement.
add_node(*
this, c, cnode,
116 current_child->
set_node(cnode) = node;
119 mesh_refinement.
add_elem (current_child);
123 for (
unsigned int i=0; i != nei; ++i)
129 unsigned int parent_p_level = this->
p_level();
130 for (
unsigned int c = 0; c != nc; c++)
151 for (
unsigned int c = 0; c != nc; c++)
172 unsigned int parent_p_level = 0;
174 const unsigned int n_n = this->
n_nodes();
177 for (
unsigned int c = 0, nc = this->
n_children(); c != nc; ++c)
185 bool calculated_new_pos =
false;
187 for (
unsigned int n=0; n<n_n; n++)
193 if ((em_val != 0.) && (em_val != 1.))
196 calculated_new_pos =
true;
200 if (calculated_new_pos)
203 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
206 child_node(i)=new_pos(i);
216 libmesh_assert_equal_to (mychild.refinement_flag(),
Elem::COARSEN);
218 if (mychild.p_level() > parent_p_level)
219 parent_p_level = mychild.p_level();
243 #endif // #ifdef LIBMESH_ENABLE_AMR
const Elem * child_ptr(unsigned int i) const
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Node * add_node(Elem &parent, unsigned int child, unsigned int node, processor_id_type proc_id)
Add a node to the mesh.
unsigned int n_systems() const
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
virtual unsigned int n_nodes() const =0
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
void contract()
Contract an active element, i.e.
Elem ** _children
Pointers to this element's children.
The libMesh namespace provides an interface to certain functionality in the library.
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
Elem * add_elem(Elem *elem)
Adds the element elem to the mesh.
unsigned int p_level() const
IntRange< unsigned short > node_index_range() const
virtual void refine(MeshRefinement &mesh_refinement)
Refine the element.
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
processor_id_type processor_id() const
const Point & point(const unsigned int i) const
Implements (adaptive) mesh refinement algorithms for a MeshBase.
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
RefinementState p_refinement_flag() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
void add_scaled(const TypeVector< T2 > &, const T &)
Add a scaled value to this vector without creating a temporary.
A Node is like a Point, but with more information.
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
virtual Node *& set_node(const unsigned int i)
const Elem * parent() const
RefinementState refinement_flag() const
virtual unsigned int n_children() const =0
void coarsen()
Coarsen the element.
This is the base class from which all geometric element types are derived.
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
void set_extra_integer(const unsigned int index, const dof_id_type value)
Sets the value on this object of the extra integer associated with index, which should have been obta...
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual ElemType type() const =0
const RemoteElem * remote_elem