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) const |
bool | test_unflagged (bool libmesh_assert_yes=false) const |
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... | |
Elem * | add_elem (std::unique_ptr< Elem > elem) |
Same as the function above, but makes it clear that the MeshRefinement object (actually, its Mesh) takes ownership of the Elem which is passed in, so the user is not responsible for deleting it. 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 & | allow_unrefined_patches () |
This flag defaults to false in order to maintain the original behavior of the code, which was to always eliminate unrefined element patches. 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) const |
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) const |
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 | _allow_unrefined_patches |
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 885 of file mesh_refinement.h.
|
explicit |
Constructor.
Definition at line 94 of file mesh_refinement.C.
|
private |
|
default |
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. Definition at line 1335 of file mesh_refinement.C.
References _mesh, clear(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::is_children_on_boundary_side(), libMesh::MeshBase::is_serial(), libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), TIMPI::Communicator::max(), libMesh::BoundaryInfo::remove(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::BoundaryInfo::transfer_boundary_ids_from_children(), update_nodes_map(), and libMesh::MeshBase::update_parallel_id_counts().
Referenced by coarsen_elements(), refine_and_coarsen_elements(), and uniformly_coarsen().
|
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. Definition at line 1468 of file mesh_refinement.C.
References _mesh, libMesh::as_range(), clear(), libMesh::ParallelObject::comm(), libMesh::MeshBase::is_prepared(), libMesh::MeshBase::is_replicated(), libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::MeshBase::libmesh_assert_valid_parallel_ids(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), TIMPI::Communicator::max(), libMesh::Elem::REFINE, libMesh::Partitioner::set_node_processor_ids(), update_nodes_map(), and libMesh::MeshBase::update_parallel_id_counts().
Referenced by refine_and_coarsen_elements(), refine_elements(), and uniformly_refine().
|
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. Definition at line 1600 of file mesh_refinement.C.
References _edge_level_mismatch_limit, _mesh, _node_level_mismatch_limit, _overrefined_boundary_limit, _underrefined_boundary_limit, libMesh::ParallelObject::comm(), eliminate_unrefined_patches(), libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), limit_level_mismatch_at_edge(), limit_level_mismatch_at_node(), limit_overrefined_boundary(), limit_underrefined_boundary(), make_coarsening_compatible(), make_flags_parallel_consistent(), and make_refinement_compatible().
Referenced by coarsen_elements(), refine_and_coarsen_elements(), and refine_elements().
|
inline |
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 936 of file mesh_refinement.h.
References _absolute_global_tolerance, and _use_member_parameters.
Referenced by main().
Adds the element elem
to the mesh.
Definition at line 209 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::add_elem(), and libMesh::libmesh_assert().
Referenced by libMesh::Elem::refine().
Same as the function above, but makes it clear that the MeshRefinement object (actually, its Mesh) takes ownership of the Elem which is passed in, so the user is not responsible for deleting it.
The version of add_elem() taking a dumb pointer will eventually be deprecated in favor of this version.
Definition at line 215 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::add_elem(), and libMesh::libmesh_assert().
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.
Definition at line 140 of file mesh_refinement.C.
References _mesh, _new_nodes_map, libMesh::TopologyMap::add_node(), libMesh::MeshBase::add_point(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::as_parent_node(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::embedding_matrix(), libMesh::TopologyMap::find(), libMesh::DofObject::invalid_id, libMesh::DofObject::invalid_processor_id, libMesh::invalid_uint, libMesh::libmesh_assert(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ptr(), libMesh::MeshBase::node_ptr(), libMesh::Elem::point(), libMesh::DofObject::processor_id(), and libMesh::Real.
Referenced by libMesh::Elem::refine().
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.
Definition at line 673 of file mesh_refinement_flagging.C.
References _mesh.
Referenced by main().
|
inline |
This flag defaults to false in order to maintain the original behavior of the code, which was to always eliminate unrefined element patches.
If you set this flag to true, then the MeshRefinement::eliminate_unrefined_patches() function essentially does nothing, allowing such patches to persist. This may be particularly useful in e.g. 1D meshes where having unrefined patches does not introduce additional hanging nodes.
Definition at line 967 of file mesh_refinement.h.
References _allow_unrefined_patches.
void libMesh::MeshRefinement::clean_refinement_flags | ( | ) |
Sets the refinement flag to Elem::DO_NOTHING
for each element in the mesh.
Definition at line 681 of file mesh_refinement_flagging.C.
References _mesh, libMesh::Elem::DO_NOTHING, and libMesh::Elem::INACTIVE.
Referenced by flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_nelem_target(), libMesh::EquationSystems::init(), libMesh::EquationSystems::read(), libMesh::EquationSystems::reinit_mesh(), uniformly_coarsen(), and uniformly_refine().
void libMesh::MeshRefinement::clear | ( | ) |
Deletes all the data that are currently stored.
Definition at line 133 of file mesh_refinement.C.
References _new_nodes_map, and libMesh::TopologyMap::clear().
Referenced by _coarsen_elements(), and _refine_elements().
|
inline |
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 900 of file mesh_refinement.h.
References _coarsen_by_parents, and _use_member_parameters.
Referenced by main().
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._children_on_boundary = true
. A child's boundary ID may be lost during coarsening if it differs from its siblings on that parent side. Definition at line 610 of file mesh_refinement.C.
References _coarsen_elements(), _face_level_mismatch_limit, _mesh, _smooth_flags(), libMesh::Elem::DO_NOTHING, libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), make_coarsening_compatible(), make_flags_parallel_consistent(), libMesh::MeshBase::prepare_for_use(), and test_level_one().
Referenced by libMesh::EquationSystems::reinit_solutions(), and BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen().
|
inline |
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 \( [0,1] \), and is 0 by default.
Definition at line 912 of file mesh_refinement.h.
References _coarsen_fraction, and _use_member_parameters.
Referenced by assemble_and_solve(), and main().
|
inline |
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 \( [0,1] \), and is 0.1 by default.
Definition at line 924 of file mesh_refinement.h.
References _coarsen_threshold, and _use_member_parameters.
Referenced by main().
|
inlineinherited |
Parallel::Communicator
object used by this mesh. Definition at line 97 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), _coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), _refine_elements(), _smooth_flags(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::EigenSystem::add_matrices(), libMesh::System::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_variable(), libMesh::System::add_variables(), libMesh::System::add_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::MeshCommunication::assign_global_indices(), libMesh::Partitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::MeshBase::cache_elem_data(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::DofMap::computed_sparsity_already(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ContinuationSystem::ContinuationSystem(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::PetscMatrix< libMesh::Number >::create_submatrix_nosort(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::RBEIMEvaluation::distribute_bfs(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), flag_elements_by_mean_stddev(), flag_elements_by_nelem_target(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::RBEIMEvaluation::get_eim_basis_function_node_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_side_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_value(), libMesh::MeshBase::get_info(), libMesh::System::get_info(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::RBEIMConstruction::get_max_abs_value(), libMesh::RBEIMConstruction::get_node_max_abs_value(), libMesh::RBEIMEvaluation::get_parametrized_function_node_value(), libMesh::RBEIMEvaluation::get_parametrized_function_side_value(), libMesh::RBEIMEvaluation::get_parametrized_function_value(), libMesh::RBEIMConstruction::get_random_point(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBEIMConstruction::inner_product(), integrate_function(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::MeshTools::libmesh_assert_equal_points(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_linesearch_shellfunc(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_recalculate_monitor(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_interface(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_precheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), limit_level_mismatch_at_edge(), limit_level_mismatch_at_node(), limit_overrefined_boundary(), limit_underrefined_boundary(), libMesh::LinearImplicitSystem::LinearImplicitSystem(), main(), make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_bcids_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::DofMap::n_constrained_dofs(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), MixedOrderTest::n_neighbor_links(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::SparsityPattern::Build::n_nonzeros(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::RBEIMConstruction::node_inner_product(), libMesh::MeshBase::operator==(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::InterMeshProjection::project_system_vectors(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO::read_header(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEIMEvaluation::read_in_interior_basis_functions(), libMesh::RBEIMEvaluation::read_in_node_basis_functions(), libMesh::RBEIMEvaluation::read_in_side_basis_functions(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::MeshBase::recalculate_n_partitions(), refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), scale_mesh_and_plot(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::RBEIMEvaluation::side_distribute_bfs(), libMesh::RBEIMEvaluation::side_gather_bfs(), libMesh::RBEIMConstruction::side_inner_product(), libMesh::Partitioner::single_partition(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::RBEIMConstruction::store_eim_solutions_for_training_set(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), ConstraintOperatorTest::test1DCoarseningNewNodes(), ConstraintOperatorTest::test1DCoarseningOperator(), test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), test_unflagged(), DofMapTest::testBadElemFECombo(), SystemsTest::testBlockRestrictedVarNDofs(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), MeshInputTest::testExodusIGASidesets(), MeshTriangulationTest::testFoundCenters(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), PointLocatorTest::testPlanar(), MeshTriangulationTest::testPoly2TriRefinementBase(), SystemsTest::testProjectCubeWithMeshFunction(), BoundaryInfoTest::testRenumber(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshTriangulationTest::testTriangulatorInterp(), MeshTriangulationTest::testTriangulatorMeshedHoles(), libMesh::MeshTools::total_weight(), libMesh::RBConstruction::train_reduced_basis_with_POD(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::Poly2TriTriangulator::triangulate(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().
|
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.
Definition at line 222 of file mesh_refinement.C.
References _mesh, libMesh::ParallelObject::comm(), libMesh::DofObject::id(), libMesh::index_range(), libMesh::libmesh_assert(), TIMPI::Communicator::min(), libMesh::Elem::parent(), std::sqrt(), and TIMPI::Communicator::sum().
Referenced by flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), and flag_elements_by_nelem_target().
|
inline |
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 947 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. If the _allow_unrefined_patches flag (default false) is set to true, then this function simpy returns false (indicating that no changes were made).
Definition at line 369 of file mesh_refinement_smoothing.C.
References _allow_unrefined_patches, _mesh, libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::Elem::INACTIVE, int, libMesh::libmesh_assert(), TIMPI::Communicator::max(), libMesh::Elem::REFINE, and libMesh::remote_elem.
Referenced by _smooth_flags().
|
inline |
Get/set the _enforce_mismatch_limit_prior_to_refinement flag.
The default value for this flag is false.
Definition at line 986 of file mesh_refinement.h.
References _enforce_mismatch_limit_prior_to_refinement.
Referenced by get_enforce_mismatch_limit_prior_to_refinement(), limit_level_mismatch_at_edge(), limit_level_mismatch_at_node(), and set_enforce_mismatch_limit_prior_to_refinement().
|
private |
Definition at line 549 of file mesh_refinement_smoothing.C.
References _enforce_mismatch_limit_prior_to_refinement, libMesh::Elem::DO_NOTHING, EDGE, libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::level(), libMesh::Elem::p_level(), POINT, libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::Elem::set_p_refinement_flag(), and libMesh::Elem::set_refinement_flag().
|
inline |
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 942 of file mesh_refinement.h.
References _face_level_mismatch_limit.
Referenced by libMesh::EquationSystems::reinit_solutions().
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.
Definition at line 647 of file mesh_refinement_flagging.C.
References libMesh::MeshRefinement::ElementFlagging::flag_elements().
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 \( [0,1] \).
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.
Definition at line 445 of file mesh_refinement_flagging.C.
References _coarsen_by_parents, _coarsen_fraction, _max_h_level, _mesh, _refine_fraction, _use_member_parameters, TIMPI::Communicator::allgather(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), dim, libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::invalid_uint, libMesh::libmesh_assert(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_elem(), libMesh::Elem::parent(), libMesh::Real, libMesh::Elem::REFINE, and libMesh::Elem::set_refinement_flag().
Referenced by main().
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 \( [0,1] \).
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.
Definition at line 44 of file mesh_refinement_flagging.C.
References _coarsen_by_parents, _coarsen_fraction, _max_h_level, _mesh, _refine_fraction, _use_member_parameters, clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::invalid_uint, libMesh::libmesh_assert(), TIMPI::Communicator::max(), TIMPI::Communicator::min(), libMesh::Elem::parent(), libMesh::Real, and libMesh::Elem::REFINE.
Referenced by assemble_and_solve(), and main().
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 \( [0,1] \).
Definition at line 170 of file mesh_refinement_flagging.C.
References _absolute_global_tolerance, _coarsen_by_parents, _coarsen_fraction, _coarsen_threshold, _max_h_level, _mesh, _refine_fraction, libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::MeshBase::n_active_elem(), libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::Real, libMesh::Elem::REFINE, and std::sqrt().
Referenced by main().
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 \( [0,1] \).
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.
Definition at line 583 of file mesh_refinement_flagging.C.
References _coarsen_fraction, _max_h_level, _mesh, _refine_fraction, _use_member_parameters, libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::ErrorVectorReal, libMesh::invalid_uint, libMesh::libmesh_assert(), libMesh::ErrorVector::mean(), libMesh::Real, libMesh::Elem::REFINE, std::sqrt(), and libMesh::ErrorVector::variance().
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. Definition at line 237 of file mesh_refinement_flagging.C.
References _coarsen_by_parents, _coarsen_fraction, _coarsen_threshold, _max_h_level, _mesh, _nelem_target, _refine_fraction, TIMPI::Communicator::allgather(), libMesh::Elem::child_ref_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), dim, libMesh::Elem::has_children(), libMesh::index_range(), libMesh::Elem::level(), libMesh::libmesh_assert(), TIMPI::Communicator::max(), libMesh::MeshBase::max_elem_id(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_elem(), libMesh::MeshBase::query_elem_ptr(), libMesh::Real, libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::set_refinement_flag().
Referenced by main().
|
inline |
_enforce_mismatch_limit_prior_to_refinement
flag, false by default.Definition at line 973 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
|
inline |
MeshBase
object associated with this object. Definition at line 340 of file mesh_refinement.h.
References _mesh.
|
inline |
MeshBase
object associated with this object. Definition at line 346 of file mesh_refinement.h.
References _mesh.
|
private |
Local dispatch function for checking the correct has_neighbor function from the Elem class.
Definition at line 1813 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::Elem::has_neighbor(), libMesh::Elem::has_topological_neighbor(), and libMesh::libmesh_assert().
Referenced by make_coarsening_compatible(), and make_refinement_compatible().
|
private |
Definition at line 126 of file mesh_refinement_smoothing.C.
References _enforce_mismatch_limit_prior_to_refinement, _mesh, libMesh::ParallelObject::comm(), EDGE, enforce_mismatch_limit_prior_to_refinement(), TIMPI::Communicator::max(), libMesh::Elem::parent(), and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
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
Definition at line 39 of file mesh_refinement_smoothing.C.
References _enforce_mismatch_limit_prior_to_refinement, _mesh, libMesh::ParallelObject::comm(), enforce_mismatch_limit_prior_to_refinement(), TIMPI::Communicator::max(), libMesh::MeshBase::n_nodes(), POINT, and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
private |
Definition at line 256 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::ParallelObject::comm(), TIMPI::Communicator::max(), and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
private |
Definition at line 310 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::ParallelObject::comm(), TIMPI::Communicator::max(), and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
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.
Definition at line 779 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::as_range(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::MeshBase::elem_ref(), TIMPI::Communicator::get_unique_tag(), libMesh::Elem::has_children(), has_topological_neighbor(), libMesh::Elem::INACTIVE, libMesh::MeshBase::is_replicated(), libMesh::MeshBase::is_serial(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::MeshTools::max_level(), TIMPI::Communicator::min(), libMesh::ParallelObject::n_processors(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), TIMPI::Communicator::receive(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, TIMPI::Communicator::send(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::MeshBase::sub_point_locator(), libMesh::Parallel::sync_dofobject_data_by_id(), and topological_neighbor().
Referenced by _smooth_flags(), coarsen_elements(), and refine_and_coarsen_elements().
bool libMesh::MeshRefinement::make_flags_parallel_consistent | ( | ) |
Copy refinement flags on ghost elements from their local processors.
true
if any flags changed. Definition at line 751 of file mesh_refinement.C.
References _mesh, libMesh::ParallelObject::comm(), TIMPI::Communicator::min(), libMesh::Elem::p_refinement_flag(), libMesh::SyncRefinementFlags::parallel_consistent, libMesh::Elem::refinement_flag(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), and libMesh::Parallel::sync_dofobject_data_by_id().
Referenced by _smooth_flags(), coarsen_elements(), refine_and_coarsen_elements(), refine_elements(), and libMesh::HPCoarsenTest::select_refinement().
|
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.
Definition at line 1159 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::Elem::has_children(), has_topological_neighbor(), libMesh::Elem::INACTIVE, libMesh::Elem::level(), libMesh::libmesh_assert(), TIMPI::Communicator::min(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::MeshBase::sub_point_locator(), and topological_neighbor().
Referenced by _smooth_flags(), refine_and_coarsen_elements(), and refine_elements().
|
inline |
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 918 of file mesh_refinement.h.
References _max_h_level, and _use_member_parameters.
Referenced by assemble_and_solve(), and main().
|
inlineinherited |
Definition at line 103 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, libMesh::libmesh_assert(), and TIMPI::Communicator::size().
Referenced by libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::System::add_vector(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_scalar_dofs(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::MeshBase::get_info(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::prepare_send_list(), libMesh::DofMap::print_dof_constraints(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), WriteVecAndScalar::setupTests(), libMesh::RBEIMEvaluation::side_gather_bfs(), DistributedMeshTest::testRemoteElemError(), CheckpointIOTest::testSplitter(), uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::VTKIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().
|
inline |
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 930 of file mesh_refinement.h.
References _nelem_target, and _use_member_parameters.
Referenced by main().
|
inline |
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 952 of file mesh_refinement.h.
References _node_level_mismatch_limit.
|
private |
|
inline |
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 957 of file mesh_refinement.h.
References _overrefined_boundary_limit.
Referenced by libMesh::EquationSystems::reinit_solutions().
|
inlineinherited |
Definition at line 114 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and TIMPI::Communicator::rank().
Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::distribute_scalar_dofs(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::LaplaceMeshSmoother::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::ExodusII_IO::read_header(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::RBEIMEvaluation::side_gather_bfs(), ExodusTest< elem_type >::test_read_gold(), ExodusTest< elem_type >::test_write(), MeshInputTest::testAbaqusRead(), MeshInputTest::testCopyElementSolutionImpl(), MeshInputTest::testCopyElementVectorImpl(), MeshInputTest::testCopyNodalSolutionImpl(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaFileMappings(), MeshInputTest::testDynaNoSplines(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusFileMappings(), MeshInputTest::testExodusIGASidesets(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), MeshInputTest::testLowOrderEdgeBlocks(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), MeshInputTest::testSingleElementImpl(), WriteVecAndScalar::testSolution(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), libMesh::MeshTools::total_weight(), uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elemset_data(), libMesh::ExodusII_IO_Helper::write_elemsets(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodeset_data(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().
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. Definition at line 478 of file mesh_refinement.C.
References _coarsen_elements(), _face_level_mismatch_limit, _mesh, _refine_elements(), _smooth_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::MeshBase::libmesh_assert_valid_parallel_ids(), make_coarsening_compatible(), make_flags_parallel_consistent(), make_refinement_compatible(), TIMPI::Communicator::max(), libMesh::MeshBase::prepare_for_use(), libMesh::Elem::REFINE, test_level_one(), and test_unflagged().
Referenced by assemble_and_solve(), MixedDimensionNonUniformRefinement::build_mesh(), MixedDimensionNonUniformRefinementTriangle::build_mesh(), MixedDimensionNonUniformRefinement3D::build_mesh(), and main().
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. Definition at line 684 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _refine_elements(), _smooth_flags(), libMesh::Elem::DO_NOTHING, libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), make_flags_parallel_consistent(), make_refinement_compatible(), libMesh::MeshBase::prepare_for_use(), and test_level_one().
Referenced by main(), libMesh::EquationSystems::reinit_solutions(), BoundaryInfoTest::testBoundaryOnChildrenBoundaryIDs(), BoundaryInfoTest::testBoundaryOnChildrenBoundarySides(), BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), InfFERadialTest::testRefinement(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), and EquationSystemsTest::testSelectivePRefine().
|
inline |
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 \( [0,1] \), and is 0.3 by default.
Definition at line 906 of file mesh_refinement.h.
References _refine_fraction, and _use_member_parameters.
Referenced by assemble_and_solve(), and main().
|
inline |
Set _enforce_mismatch_limit_prior_to_refinement option.
Defaults to false.
Definition at line 979 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.
Referenced by main().
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.
Definition at line 654 of file mesh_refinement_flagging.C.
References _mesh, libMesh::Elem::DO_NOTHING, and libMesh::Elem::INACTIVE.
Referenced by main(), and EquationSystemsTest::testSelectivePRefine().
bool libMesh::MeshRefinement::test_level_one | ( | bool | libmesh_assert_yes = false | ) | const |
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.
Definition at line 355 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::ParallelObject::comm(), libMesh::Elem::level(), libMesh::libmesh_assert(), TIMPI::Communicator::max(), libMesh::out, libMesh::Elem::p_level(), libMesh::remote_elem, libMesh::MeshBase::sub_point_locator(), and topological_neighbor().
Referenced by coarsen_elements(), refine_and_coarsen_elements(), and refine_elements().
bool libMesh::MeshRefinement::test_unflagged | ( | bool | libmesh_assert_yes = false | ) | const |
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.
Definition at line 430 of file mesh_refinement.C.
References _mesh, libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::libmesh_assert(), TIMPI::Communicator::max(), libMesh::out, and libMesh::Elem::REFINE.
Referenced by refine_and_coarsen_elements().
|
private |
Local dispatch function for getting the correct topological neighbor from the Elem class.
Definition at line 1797 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::libmesh_assert(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::topological_neighbor().
Referenced by make_coarsening_compatible(), make_refinement_compatible(), and test_level_one().
|
inline |
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 962 of file mesh_refinement.h.
References _underrefined_boundary_limit.
Referenced by libMesh::EquationSystems::reinit_solutions().
void libMesh::MeshRefinement::uniformly_coarsen | ( | unsigned int | n = 1 | ) |
Attempts to uniformly coarsen the mesh n
times.
Definition at line 1709 of file mesh_refinement.C.
References _coarsen_elements(), _mesh, libMesh::as_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::MeshBase::elem_ref(), TIMPI::Communicator::get_unique_tag(), libMesh::Elem::INACTIVE, libMesh::MeshBase::is_replicated(), libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), TIMPI::Communicator::receive(), libMesh::Elem::refinement_flag(), TIMPI::Communicator::send(), libMesh::Elem::set_refinement_flag(), and libMesh::Parallel::sync_dofobject_data_by_id().
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), and libMesh::PetscDMWrapper::init_and_attach_petscdm().
void libMesh::MeshRefinement::uniformly_p_coarsen | ( | unsigned int | n = 1 | ) |
Attempts to uniformly p coarsen the mesh n
times.
Definition at line 1669 of file mesh_refinement.C.
References _mesh, and libMesh::Elem::JUST_COARSENED.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), and libMesh::AdjointRefinementEstimator::estimate_error().
void libMesh::MeshRefinement::uniformly_p_refine | ( | unsigned int | n = 1 | ) |
Uniformly p refines the mesh n
times.
Definition at line 1655 of file mesh_refinement.C.
References _mesh, and libMesh::Elem::JUST_REFINED.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), and main().
void libMesh::MeshRefinement::uniformly_refine | ( | unsigned int | n = 1 | ) |
Uniformly refines the mesh n
times.
Definition at line 1684 of file mesh_refinement.C.
References _mesh, _refine_elements(), clean_refinement_flags(), libMesh::MeshBase::prepare_for_use(), and libMesh::Elem::REFINE.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), OverlappingTestBase::build_quad_mesh(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), main(), OverlappingFunctorTest::run_coupling_functor_test(), OverlappingFunctorTest::run_partitioner_test(), MixedDimensionRefinedMeshTest::setUp(), SlitMeshRefinedMeshTest::setUp(), SlitMeshRefinedSystemTest::setUp(), BoundaryRefinedMeshTest::setUp(), ExtraIntegersTest::test_helper(), ElemTest< elem_type >::test_n_refinements(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), and SystemsTest::testProjectMatrix3D().
|
private |
Updates the _new_nodes_map
.
Definition at line 348 of file mesh_refinement.C.
References _mesh, _new_nodes_map, and libMesh::TopologyMap::init().
Referenced by _coarsen_elements(), and _refine_elements().
|
private |
Definition at line 795 of file mesh_refinement.h.
Referenced by absolute_global_tolerance(), and flag_elements_by_error_tolerance().
|
private |
Definition at line 804 of file mesh_refinement.h.
Referenced by allow_unrefined_patches(), and eliminate_unrefined_patches().
|
private |
Refinement parameter values.
Definition at line 783 of file mesh_refinement.h.
Referenced by coarsen_by_parents(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), and flag_elements_by_nelem_target().
|
private |
Definition at line 787 of file mesh_refinement.h.
Referenced by coarsen_fraction(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), flag_elements_by_mean_stddev(), and flag_elements_by_nelem_target().
|
private |
Definition at line 791 of file mesh_refinement.h.
Referenced by coarsen_threshold(), flag_elements_by_error_tolerance(), and flag_elements_by_nelem_target().
|
protectedinherited |
Definition at line 120 of file parallel_object.h.
Referenced by libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::ParallelObject::comm(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::operator=(), libMesh::ParallelObject::processor_id(), and libMesh::BoundaryInfo::regenerate_id_sets().
|
private |
Definition at line 798 of file mesh_refinement.h.
Referenced by _smooth_flags(), and 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 874 of file mesh_refinement.h.
Referenced by enforce_mismatch_limit_prior_to_refinement(), limit_level_mismatch_at_edge(), and limit_level_mismatch_at_node().
|
private |
Definition at line 797 of file mesh_refinement.h.
Referenced by coarsen_elements(), face_level_mismatch_limit(), make_coarsening_compatible(), make_refinement_compatible(), refine_and_coarsen_elements(), and refine_elements().
|
private |
Definition at line 789 of file mesh_refinement.h.
Referenced by flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), flag_elements_by_mean_stddev(), flag_elements_by_nelem_target(), and max_h_level().
|
private |
Reference to the mesh.
Definition at line 770 of file mesh_refinement.h.
Referenced by _coarsen_elements(), _refine_elements(), _smooth_flags(), add_elem(), add_node(), add_p_to_h_refinement(), clean_refinement_flags(), coarsen_elements(), create_parent_error_vector(), eliminate_unrefined_patches(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), flag_elements_by_mean_stddev(), flag_elements_by_nelem_target(), get_mesh(), has_topological_neighbor(), limit_level_mismatch_at_edge(), limit_level_mismatch_at_node(), limit_overrefined_boundary(), limit_underrefined_boundary(), make_coarsening_compatible(), make_flags_parallel_consistent(), make_refinement_compatible(), refine_and_coarsen_elements(), refine_elements(), switch_h_to_p_refinement(), test_level_one(), test_unflagged(), topological_neighbor(), uniformly_coarsen(), uniformly_p_coarsen(), uniformly_p_refine(), uniformly_refine(), and update_nodes_map().
|
private |
Definition at line 793 of file mesh_refinement.h.
Referenced by flag_elements_by_nelem_target(), and nelem_target().
|
private |
Data structure that holds the new nodes information.
Definition at line 765 of file mesh_refinement.h.
Referenced by add_node(), clear(), and update_nodes_map().
|
private |
Definition at line 799 of file mesh_refinement.h.
Referenced by _smooth_flags(), and node_level_mismatch_limit().
|
private |
Definition at line 801 of file mesh_refinement.h.
Referenced by _smooth_flags(), and overrefined_boundary_limit().
|
private |
Definition at line 891 of file mesh_refinement.h.
Referenced by has_topological_neighbor(), make_coarsening_compatible(), make_refinement_compatible(), test_level_one(), and topological_neighbor().
|
private |
Definition at line 785 of file mesh_refinement.h.
Referenced by flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_error_tolerance(), flag_elements_by_mean_stddev(), flag_elements_by_nelem_target(), and refine_fraction().
|
private |
Definition at line 802 of file mesh_refinement.h.
Referenced by _smooth_flags(), and 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 777 of file mesh_refinement.h.
Referenced by absolute_global_tolerance(), coarsen_by_parents(), coarsen_fraction(), coarsen_threshold(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_mean_stddev(), max_h_level(), nelem_target(), and refine_fraction().