libMesh
|
Implements (adaptive) mesh refinement algorithms for a MeshBase
.
More...
#include <mesh_refinement.h>
Classes | |
class | ElementFlagging |
Abstract base class to be used for user-specified element flagging. More... | |
Public Member Functions | |
MeshRefinement (MeshBase &mesh) | |
Constructor. More... | |
void | set_periodic_boundaries_ptr (PeriodicBoundaries *pb_ptr) |
Sets the PeriodicBoundaries pointer. More... | |
~MeshRefinement () | |
Destructor. More... | |
void | clear () |
Deletes all the data that are currently stored. More... | |
void | flag_elements_by_error_fraction (const ErrorVector &error_per_cell, const Real refine_fraction=0.3, const Real coarsen_fraction=0.0, const unsigned int max_level=libMesh::invalid_uint) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell . More... | |
void | flag_elements_by_error_tolerance (const ErrorVector &error_per_cell) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell . More... | |
bool | flag_elements_by_nelem_target (const ErrorVector &error_per_cell) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell . More... | |
void | flag_elements_by_elem_fraction (const ErrorVector &error_per_cell, const Real refine_fraction=0.3, const Real coarsen_fraction=0.0, const unsigned int max_level=libMesh::invalid_uint) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell . More... | |
void | flag_elements_by_mean_stddev (const ErrorVector &error_per_cell, const Real refine_fraction=1.0, const Real coarsen_fraction=0.0, const unsigned int max_level=libMesh::invalid_uint) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell . More... | |
void | flag_elements_by (ElementFlagging &element_flagging) |
Flag elements based on a function object. More... | |
void | switch_h_to_p_refinement () |
Takes a mesh whose elements are flagged for h refinement and coarsening, and switches those flags to request p refinement and coarsening instead. More... | |
void | add_p_to_h_refinement () |
Takes a mesh whose elements are flagged for h refinement and coarsening, and adds flags to request p refinement and coarsening of the same elements. More... | |
bool | refine_and_coarsen_elements () |
Refines and coarsens user-requested elements. More... | |
bool | coarsen_elements () |
Only coarsens the user-requested elements. More... | |
bool | refine_elements () |
Only refines the user-requested elements. More... | |
void | uniformly_refine (unsigned int n=1) |
Uniformly refines the mesh n times. More... | |
void | uniformly_coarsen (unsigned int n=1) |
Attempts to uniformly coarsen the mesh n times. More... | |
void | uniformly_p_refine (unsigned int n=1) |
Uniformly p refines the mesh n times. More... | |
void | uniformly_p_coarsen (unsigned int n=1) |
Attempts to uniformly p coarsen the mesh n times. More... | |
void | clean_refinement_flags () |
Sets the refinement flag to Elem::DO_NOTHING for each element in the mesh. More... | |
bool | test_level_one (bool libmesh_assert_yes=false) |
bool | test_unflagged (bool libmesh_assert_yes=false) |
Node * | add_node (Elem &parent, unsigned int child, unsigned int node, processor_id_type proc_id) |
Add a node to the mesh. More... | |
Elem * | add_elem (Elem *elem) |
Adds the element elem to the mesh. More... | |
const MeshBase & | get_mesh () const |
MeshBase & | get_mesh () |
bool & | coarsen_by_parents () |
If coarsen_by_parents is true, complete groups of sibling elements (elements with the same parent) will be flagged for coarsening. More... | |
Real & | refine_fraction () |
The refine_fraction sets either a desired target or a desired maximum number of elements to flag for refinement, depending on which flag_elements_by method is called. More... | |
Real & | coarsen_fraction () |
The coarsen_fraction sets either a desired target or a desired maximum number of elements to flag for coarsening, depending on which flag_elements_by method is called. More... | |
unsigned int & | max_h_level () |
The max_h_level is the greatest refinement level an element should reach. More... | |
Real & | coarsen_threshold () |
The coarsen_threshold provides hysteresis in AMR/C strategies. More... | |
dof_id_type & | nelem_target () |
If nelem_target is set to a nonzero value, methods like flag_elements_by_nelem_target() will attempt to keep the number of active elements in the mesh close to nelem_target. More... | |
Real & | absolute_global_tolerance () |
If absolute_global_tolerance is set to a nonzero value, methods like flag_elements_by_global_tolerance() will attempt to reduce the global error of the mesh (defined as the square root of the sum of the squares of the errors on active elements) to below this tolerance. More... | |
unsigned char & | face_level_mismatch_limit () |
If face_level_mismatch_limit is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two face neighbors will not differ by more than that limit. More... | |
unsigned char & | edge_level_mismatch_limit () |
If edge_level_mismatch_limit is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two edge neighbors will not differ by more than that limit. More... | |
unsigned char & | node_level_mismatch_limit () |
If node_level_mismatch_limit is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two nodal neighbors will not differ by more than that limit. More... | |
signed char & | overrefined_boundary_limit () |
If overrefined_boundary_limit is set to a nonnegative value, then refinement and coarsening will produce meshes in which the refinement level of a boundary element is no more than that many levels greater than the level of any of its interior neighbors. More... | |
signed char & | underrefined_boundary_limit () |
If underrefined_boundary_limit is set to a nonnegative value, then refinement and coarsening will produce meshes in which the refinement level of an element is no more than that many levels greater than the level of any boundary elements on its sides. More... | |
bool | make_flags_parallel_consistent () |
Copy refinement flags on ghost elements from their local processors. More... | |
bool | get_enforce_mismatch_limit_prior_to_refinement () |
void | set_enforce_mismatch_limit_prior_to_refinement (bool enforce) |
Set _enforce_mismatch_limit_prior_to_refinement option. More... | |
bool & | enforce_mismatch_limit_prior_to_refinement () |
Get/set the _enforce_mismatch_limit_prior_to_refinement flag. More... | |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Private Types | |
enum | NeighborType { POINT, EDGE } |
This helper function enforces the desired mismatch limits prior to refinement. More... | |
Private Member Functions | |
MeshRefinement (const MeshRefinement &) | |
MeshRefinement & | operator= (const MeshRefinement &) |
bool | _coarsen_elements () |
Coarsens user-requested elements. More... | |
bool | _refine_elements () |
Refines user-requested elements. More... | |
void | _smooth_flags (bool refining, bool coarsening) |
Smooths refinement flags according to current settings. More... | |
bool | limit_level_mismatch_at_node (const unsigned int max_mismatch) |
This algorithm restricts the maximum level mismatch at any node in the mesh. More... | |
bool | limit_level_mismatch_at_edge (const unsigned int max_mismatch) |
bool | limit_overrefined_boundary (const signed char max_mismatch) |
bool | limit_underrefined_boundary (const signed char max_mismatch) |
bool | eliminate_unrefined_patches () |
This algorithm selects an element for refinement if all of its neighbors are (or will be) refined. More... | |
void | create_parent_error_vector (const ErrorVector &error_per_cell, ErrorVector &error_per_parent, Real &parent_error_min, Real &parent_error_max) |
Calculates the error on all coarsenable parents. More... | |
void | update_nodes_map () |
Updates the _new_nodes_map . More... | |
bool | make_coarsening_compatible () |
Take user-specified coarsening flags and augment them so that level-one dependency is satisfied. More... | |
bool | make_refinement_compatible () |
Take user-specified refinement flags and augment them so that level-one dependency is satisfied. More... | |
Elem * | topological_neighbor (Elem *elem, const PointLocatorBase *point_locator, const unsigned int side) |
Local dispatch function for getting the correct topological neighbor from the Elem class. More... | |
bool | has_topological_neighbor (const Elem *elem, const PointLocatorBase *point_locator, const Elem *neighbor) |
Local dispatch function for checking the correct has_neighbor function from the Elem class. More... | |
bool | enforce_mismatch_limit_prior_to_refinement (Elem *elem, NeighborType nt, unsigned max_mismatch) |
Private Attributes | |
TopologyMap | _new_nodes_map |
Data structure that holds the new nodes information. More... | |
MeshBase & | _mesh |
Reference to the mesh. More... | |
bool | _use_member_parameters |
For backwards compatibility, we initialize this as false and then set it to true if the user uses any of the refinement parameter accessor functions. More... | |
bool | _coarsen_by_parents |
Refinement parameter values. More... | |
Real | _refine_fraction |
Real | _coarsen_fraction |
unsigned int | _max_h_level |
Real | _coarsen_threshold |
dof_id_type | _nelem_target |
Real | _absolute_global_tolerance |
unsigned char | _face_level_mismatch_limit |
unsigned char | _edge_level_mismatch_limit |
unsigned char | _node_level_mismatch_limit |
signed char | _overrefined_boundary_limit |
signed char | _underrefined_boundary_limit |
bool | _enforce_mismatch_limit_prior_to_refinement |
This option enforces the mismatch level prior to refinement by checking if refining any element marked for refinement would cause a mismatch greater than the limit. More... | |
PeriodicBoundaries * | _periodic_boundaries |
Implements (adaptive) mesh refinement algorithms for a MeshBase
.
Definition at line 61 of file mesh_refinement.h.
|
private |
This helper function enforces the desired mismatch limits prior to refinement.
It is called from the MeshRefinement::limit_level_mismatch_at_edge() and MeshRefinement::limit_level_mismatch_at_node() functions.
true
if this enforcement caused the refinement flags for elem
to change, false otherwise. Enumerator | |
---|---|
POINT | |
EDGE |
Definition at line 858 of file mesh_refinement.h.
|
explicit |
Constructor.
|
private |
libMesh::MeshRefinement::~MeshRefinement | ( | ) |
Destructor.
Deletes all the elements that are currently stored.
|
private |
Coarsens user-requested elements.
Both coarsen_elements and refine_elements used to be in the public interface for the MeshRefinement object. Unfortunately, without proper preparation (make_refinement_compatible, make_coarsening_compatible) at least coarsen_elements() did not work alone. By making them private, we signal to the user that they are not part of the interface. It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.
|
private |
Refines user-requested elements.
It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.
|
private |
Smooths refinement flags according to current settings.
It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the flags actually changed (hence data needs to be projected) and false
otherwise. Real & libMesh::MeshRefinement::absolute_global_tolerance | ( | ) |
If absolute_global_tolerance
is set to a nonzero value, methods like flag_elements_by_global_tolerance() will attempt to reduce the global error of the mesh (defined as the square root of the sum of the squares of the errors on active elements) to below this tolerance.
absolute_global_tolerance
is 0 by default.
Definition at line 909 of file mesh_refinement.h.
References _absolute_global_tolerance, and _use_member_parameters.
Node* libMesh::MeshRefinement::add_node | ( | Elem & | parent, |
unsigned int | child, | ||
unsigned int | node, | ||
processor_id_type | proc_id | ||
) |
Add a node to the mesh.
The node should be node n of child c of parent Elem parent. The processor id proc_id
is used if necessary to help determine numbering of newly created nodes, but newly created nodes are left unpartitioned until a node partitionining sweep is done later.
void libMesh::MeshRefinement::add_p_to_h_refinement | ( | ) |
Takes a mesh whose elements are flagged for h refinement and coarsening, and adds flags to request p refinement and coarsening of the same elements.
void libMesh::MeshRefinement::clean_refinement_flags | ( | ) |
Sets the refinement flag to Elem::DO_NOTHING
for each element in the mesh.
void libMesh::MeshRefinement::clear | ( | ) |
Deletes all the data that are currently stored.
bool & libMesh::MeshRefinement::coarsen_by_parents | ( | ) |
If coarsen_by_parents
is true, complete groups of sibling elements (elements with the same parent) will be flagged for coarsening.
This should make the coarsening more likely to occur as requested.
coarsen_by_parents
is true by default.
Definition at line 873 of file mesh_refinement.h.
References _coarsen_by_parents, and _use_member_parameters.
bool libMesh::MeshRefinement::coarsen_elements | ( | ) |
Only coarsens the user-requested elements.
Some elements will not be coarsened to satisfy the level one rule. It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.maintain_level_one
, new code should use face_level_mismatch_limit() instead. Real & libMesh::MeshRefinement::coarsen_fraction | ( | ) |
The coarsen_fraction
sets either a desired target or a desired maximum number of elements to flag for coarsening, depending on which flag_elements_by method is called.
coarsen_fraction
must be in , and is 0 by default.
Definition at line 885 of file mesh_refinement.h.
References _coarsen_fraction, and _use_member_parameters.
Real & libMesh::MeshRefinement::coarsen_threshold | ( | ) |
The coarsen_threshold
provides hysteresis in AMR/C strategies.
Refinement of elements with error estimate E will be done even at the expense of coarsening elements whose children's accumulated error does not exceed coarsen_threshold
* E.
coarsen_threshold
must be in , and is 0.1 by default.
Definition at line 897 of file mesh_refinement.h.
References _coarsen_threshold, and _use_member_parameters.
|
inherited |
Parallel::Communicator
object used by this mesh. Definition at line 89 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by libMesh::EpetraVector< T >::EpetraVector(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), and libMesh::Parallel::sync_node_data_by_element_id_once().
|
private |
Calculates the error on all coarsenable parents.
error_per_parent[parent_id] stores this error if parent_id corresponds to a coarsenable parent, and stores -1 otherwise.
unsigned char & libMesh::MeshRefinement::edge_level_mismatch_limit | ( | ) |
If edge_level_mismatch_limit
is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two edge neighbors will not differ by more than that limit.
If edge_level_mismatch_limit
is 0, then level differences will be unlimited.
edge_level_mismatch_limit
is 0 by default.
Definition at line 920 of file mesh_refinement.h.
References _edge_level_mismatch_limit.
|
private |
This algorithm selects an element for refinement if all of its neighbors are (or will be) refined.
This algorithm will transform this mesh:
* o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | | | | * | | | | | | * o---o---o o---o---o * | | | | | | * | | | | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o *
into this:
* o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | : | | | * | | | : | | | * o---o---o...o...o---o---o * | | | : | | | * | | | : | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o * | | | | | | | * | | | | | | | * o---o---o---o---o---o---o *
by refining the indicated element
bool & libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement | ( | ) |
Get/set the _enforce_mismatch_limit_prior_to_refinement flag.
The default value for this flag is false.
Definition at line 954 of file mesh_refinement.h.
References _enforce_mismatch_limit_prior_to_refinement.
Referenced by get_enforce_mismatch_limit_prior_to_refinement(), and set_enforce_mismatch_limit_prior_to_refinement().
|
private |
unsigned char & libMesh::MeshRefinement::face_level_mismatch_limit | ( | ) |
If face_level_mismatch_limit
is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two face neighbors will not differ by more than that limit.
If face_level_mismatch_limit
is 0, then level differences will be unlimited.
face_level_mismatch_limit
is 1 by default. Currently the only supported options are 0 and 1.
Definition at line 915 of file mesh_refinement.h.
References _face_level_mismatch_limit.
void libMesh::MeshRefinement::flag_elements_by | ( | ElementFlagging & | element_flagging | ) |
Flag elements based on a function object.
The class ElementFlagging
defines a mechanism for implementing refinement strategies.
void libMesh::MeshRefinement::flag_elements_by_elem_fraction | ( | const ErrorVector & | error_per_cell, |
const Real | refine_fraction = 0.3 , |
||
const Real | coarsen_fraction = 0.0 , |
||
const unsigned int | max_level = libMesh::invalid_uint |
||
) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
.
This method picks the top refine_fraction
* n_elem
elements for refinement and the bottom coarsen_fraction
* n_elem
elements for coarsening. The two fractions refine_fraction
and coarsen_fraction
must be in .
All the function arguments except error_per_cell have been deprecated, and will be removed in future libMesh releases - to control these parameters, set the corresponding member variables.
void libMesh::MeshRefinement::flag_elements_by_error_fraction | ( | const ErrorVector & | error_per_cell, |
const Real | refine_fraction = 0.3 , |
||
const Real | coarsen_fraction = 0.0 , |
||
const unsigned int | max_level = libMesh::invalid_uint |
||
) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
.
The two fractions refine_fraction
and coarsen_fraction
must be in .
All the function arguments except error_per_cell have been deprecated, and will be removed in future libMesh releases - to control these parameters, set the corresponding member variables.
void libMesh::MeshRefinement::flag_elements_by_error_tolerance | ( | const ErrorVector & | error_per_cell | ) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
.
This method refines the worst elements with errors greater than absolute_global_tolerance
/ n_active_elem, flagging at most refine_fraction
* n_active_elem It coarsens elements with errors less than coarsen_threshold
* global_tolerance
/ n_active_elem, flagging at most coarsen_fraction
* n_active_elem
The three fractions refine_fraction
coarsen_fraction
and coarsen_threshold
should be in .
void libMesh::MeshRefinement::flag_elements_by_mean_stddev | ( | const ErrorVector & | error_per_cell, |
const Real | refine_fraction = 1.0 , |
||
const Real | coarsen_fraction = 0.0 , |
||
const unsigned int | max_level = libMesh::invalid_uint |
||
) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
.
This method picks the top refine_fraction
* stddev
+ mean
elements for refinement and the bottom mean
- coarsen_fraction
* stddev
elements for coarsening. The two fractions refine_fraction
and coarsen_fraction
must be in .
All the function arguments except error_per_cell have been deprecated, and will be removed in future libMesh releases - to control these parameters, set the corresponding member variables.
bool libMesh::MeshRefinement::flag_elements_by_nelem_target | ( | const ErrorVector & | error_per_cell | ) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
.
This method attempts to produce a mesh with slightly more than nelem_target
active elements, trading element refinement for element coarsening when their error ratios exceed coarsen_threshold
. It flags no more than refine_fraction
* n_elem elements for refinement and flags no more than coarsen_fraction
* n_elem elements for coarsening.
true
if it has done all the AMR/C it can do in a single step, or false if further adaptive steps may be required to produce a mesh with a narrow error distribution and the right number of elements. bool libMesh::MeshRefinement::get_enforce_mismatch_limit_prior_to_refinement | ( | ) |
_enforce_mismatch_limit_prior_to_refinement
flag, false by default.Definition at line 941 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
const MeshBase& libMesh::MeshRefinement::get_mesh | ( | ) | const |
MeshBase
object associated with this object. Definition at line 327 of file mesh_refinement.h.
References _mesh.
MeshBase& libMesh::MeshRefinement::get_mesh | ( | ) |
MeshBase
object associated with this object. Definition at line 333 of file mesh_refinement.h.
References _mesh.
|
private |
Local dispatch function for checking the correct has_neighbor function from the Elem class.
|
private |
|
private |
This algorithm restricts the maximum level mismatch at any node in the mesh.
Calling this with max_mismatch
equal to 1 would transform this mesh:
* o---o---o---o---o-------o-------o * | | | | | | | * | | | | | | | * o---o---o---o---o | | * | | | | | | | * | | | | | | | * o---o---o---o---o-------o-------o * | | | | | | | * | | | | | | | * o---o---o---o---o | | * | | | | | | | * | | | | | | | * o---o---o---o---o-------o-------o * | | | | * | | | | * | | | | * | | | | * | | | | * o-------o-------o | * | | | | * | | | | * | | | | * | | | | * | | | | * o-------o-------o---------------o *
into this:
* o---o---o---o---o-------o-------o * | | | | | | | * | | | | | | | * o---o---o---o---o | | * | | | | | | | * | | | | | | | * o---o---o---o---o-------o-------o * | | | | | | | * | | | | | | | * o---o---o---o---o | | * | | | | | | | * | | | | | | | * o---o---o---o---o-------o-------o * | | | : | * | | | : | * | | | : | * | | | : | * | | | : | * o-------o-------o.......o.......o * | | | : | * | | | : | * | | | : | * | | | : | * | | | : | * o-------o-------o-------o-------o *
by refining the indicated element
|
private |
|
private |
|
private |
Take user-specified coarsening flags and augment them so that level-one dependency is satisfied.
This function used to take an argument, maintain_level_one
- new code should use face_level_mismatch_limit() instead.
bool libMesh::MeshRefinement::make_flags_parallel_consistent | ( | ) |
Copy refinement flags on ghost elements from their local processors.
true
if any flags changed.
|
private |
Take user-specified refinement flags and augment them so that level-one dependency is satisfied.
This function used to take an argument, maintain_level_one
- new code should use face_level_mismatch_limit() instead.
unsigned int & libMesh::MeshRefinement::max_h_level | ( | ) |
The max_h_level
is the greatest refinement level an element should reach.
max_h_level
is unlimited (libMesh::invalid_uint) by default
Definition at line 891 of file mesh_refinement.h.
References _max_h_level, and _use_member_parameters.
|
inherited |
Definition at line 95 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().
Referenced by libMesh::MeshBase::partition().
dof_id_type & libMesh::MeshRefinement::nelem_target | ( | ) |
If nelem_target
is set to a nonzero value, methods like flag_elements_by_nelem_target() will attempt to keep the number of active elements in the mesh close to nelem_target.
nelem_target
is 0 by default.
Definition at line 903 of file mesh_refinement.h.
References _nelem_target, and _use_member_parameters.
unsigned char & libMesh::MeshRefinement::node_level_mismatch_limit | ( | ) |
If node_level_mismatch_limit
is set to a nonzero value, then refinement and coarsening will produce meshes in which the refinement level of two nodal neighbors will not differ by more than that limit.
If node_level_mismatch_limit
is 0, then level differences will be unlimited.
node_level_mismatch_limit
is 0 by default.
Definition at line 925 of file mesh_refinement.h.
References _node_level_mismatch_limit.
|
private |
signed char & libMesh::MeshRefinement::overrefined_boundary_limit | ( | ) |
If overrefined_boundary_limit
is set to a nonnegative value, then refinement and coarsening will produce meshes in which the refinement level of a boundary element is no more than that many levels greater than the level of any of its interior neighbors.
This may be counter-intuitive in the 1D-embedded-in-3D case: an edge has more interior neighbors than a face containing that edge.
If overrefined_boundary_limit
is negative, then level differences will be unlimited.
overrefined_boundary_limit
is 0 by default. This implies that adaptive coarsening can only be done on an interior element if any boundary elements on its sides are simultaneously coarsened.
Definition at line 930 of file mesh_refinement.h.
References _overrefined_boundary_limit.
|
inherited |
Definition at line 101 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().
Referenced by libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::DofMap::last_dof(), libMesh::MeshBase::n_active_local_elem(), libMesh::DofMap::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), and libMesh::MeshTools::weight().
bool libMesh::MeshRefinement::refine_and_coarsen_elements | ( | ) |
Refines and coarsens user-requested elements.
Will also refine/coarsen additional elements to satisfy level-one rule. It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.maintain_level_one
. New code should use face_level_mismatch_limit()
instead. bool libMesh::MeshRefinement::refine_elements | ( | ) |
Only refines the user-requested elements.
It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.maintain_level_one
, new code should use face_level_mismatch_limit()
instead. Real & libMesh::MeshRefinement::refine_fraction | ( | ) |
The refine_fraction
sets either a desired target or a desired maximum number of elements to flag for refinement, depending on which flag_elements_by method is called.
refine_fraction
must be in , and is 0.3 by default.
Definition at line 879 of file mesh_refinement.h.
References _refine_fraction, and _use_member_parameters.
void libMesh::MeshRefinement::set_enforce_mismatch_limit_prior_to_refinement | ( | bool | enforce | ) |
Set _enforce_mismatch_limit_prior_to_refinement option.
Defaults to false.
Definition at line 947 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
void libMesh::MeshRefinement::set_periodic_boundaries_ptr | ( | PeriodicBoundaries * | pb_ptr | ) |
Sets the PeriodicBoundaries
pointer.
void libMesh::MeshRefinement::switch_h_to_p_refinement | ( | ) |
Takes a mesh whose elements are flagged for h refinement and coarsening, and switches those flags to request p refinement and coarsening instead.
bool libMesh::MeshRefinement::test_level_one | ( | bool | libmesh_assert_yes = false | ) |
true
if the mesh satisfies the level one restriction, and false otherwise.Aborts the program if libmesh_assert_yes
is true and the mesh does not satisfy the level one restriction.
bool libMesh::MeshRefinement::test_unflagged | ( | bool | libmesh_assert_yes = false | ) |
true
if the mesh has no elements flagged to be coarsened or refined, and false otherwise.Aborts the program if libmesh_assert_yes is true and the mesh has flagged elements.
|
private |
Local dispatch function for getting the correct topological neighbor from the Elem class.
signed char & libMesh::MeshRefinement::underrefined_boundary_limit | ( | ) |
If underrefined_boundary_limit
is set to a nonnegative value, then refinement and coarsening will produce meshes in which the refinement level of an element is no more than that many levels greater than the level of any boundary elements on its sides.
If underrefined_boundary_limit
is negative, then level differences will be unlimited.
underrefined_boundary_limit
is 0 by default. This implies that adaptive coarsening can only be done on a boundary element if any interior elements it is on the side of are simultaneously coarsened.
Definition at line 935 of file mesh_refinement.h.
References _underrefined_boundary_limit.
void libMesh::MeshRefinement::uniformly_coarsen | ( | unsigned int | n = 1 | ) |
Attempts to uniformly coarsen the mesh n
times.
void libMesh::MeshRefinement::uniformly_p_coarsen | ( | unsigned int | n = 1 | ) |
Attempts to uniformly p coarsen the mesh n
times.
void libMesh::MeshRefinement::uniformly_p_refine | ( | unsigned int | n = 1 | ) |
Uniformly p refines the mesh n
times.
void libMesh::MeshRefinement::uniformly_refine | ( | unsigned int | n = 1 | ) |
Uniformly refines the mesh n
times.
|
private |
Updates the _new_nodes_map
.
|
private |
Definition at line 770 of file mesh_refinement.h.
Referenced by absolute_global_tolerance().
|
private |
Refinement parameter values.
Definition at line 758 of file mesh_refinement.h.
Referenced by coarsen_by_parents().
|
private |
Definition at line 762 of file mesh_refinement.h.
Referenced by coarsen_fraction().
|
private |
Definition at line 766 of file mesh_refinement.h.
Referenced by coarsen_threshold().
|
protectedinherited |
Definition at line 107 of file parallel_object.h.
Referenced by libMesh::ParallelObject::comm(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::operator=(), and libMesh::ParallelObject::processor_id().
|
private |
Definition at line 773 of file mesh_refinement.h.
Referenced by edge_level_mismatch_limit().
|
private |
This option enforces the mismatch level prior to refinement by checking if refining any element marked for refinement would cause a mismatch greater than the limit.
Applies to all mismatch methods.
Calling this with node_level_mismatch_limit()
= 1 would transform this mesh:
* o-------o-------o-------o-------o * | | | | | * | | | | | * | | | | | * | | | | | * | | | | | * o-------o---o---o-------o-------o * | | : | | | * | | : | | | * | o...o...o | | * | | : | | | * | | : | | | * o-------o---o---o-------o-------o * | | | | * | | | | * | | | | * | | | | * | | | | * o-------o-------o | * | | | | * | | | | * | | | | * | | | | * | | | | * o-------o-------o---------------o *
into this:
* o-------o-------o-------o-------o * | | | | | * | | | | | * | | | | | * | | | | | * | | | | | * o-------o-------o-------o-------o * | | | | | * | | | | | * | | | | | * | | | | | * | | | | | * o-------o-------o-------o-------o * | | | : | * | | | : | * | | | : | * | | | : | * | | | : | * o-------o-------o.......o.......o * | | | : | * | | | : | * | | | : | * | | | : | * | | | : | * o-------o-------o-------o-------o *
by moving the refinement flag to the indicated element.
Default value is false.
Definition at line 847 of file mesh_refinement.h.
Referenced by enforce_mismatch_limit_prior_to_refinement().
|
private |
Definition at line 772 of file mesh_refinement.h.
Referenced by face_level_mismatch_limit().
|
private |
Definition at line 764 of file mesh_refinement.h.
Referenced by max_h_level().
|
private |
|
private |
Definition at line 768 of file mesh_refinement.h.
Referenced by nelem_target().
|
private |
Data structure that holds the new nodes information.
Definition at line 740 of file mesh_refinement.h.
|
private |
Definition at line 774 of file mesh_refinement.h.
Referenced by node_level_mismatch_limit().
|
private |
Definition at line 776 of file mesh_refinement.h.
Referenced by overrefined_boundary_limit().
|
private |
Definition at line 864 of file mesh_refinement.h.
|
private |
Definition at line 760 of file mesh_refinement.h.
Referenced by refine_fraction().
|
private |
Definition at line 777 of file mesh_refinement.h.
Referenced by underrefined_boundary_limit().
|
private |
For backwards compatibility, we initialize this as false and then set it to true if the user uses any of the refinement parameter accessor functions.
Definition at line 752 of file mesh_refinement.h.
Referenced by absolute_global_tolerance(), coarsen_by_parents(), coarsen_fraction(), coarsen_threshold(), max_h_level(), nelem_target(), and refine_fraction().