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
.
Responsible for mesh refinement algorithms and data.
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 |
|
private |
libMesh::MeshRefinement::~MeshRefinement | ( | ) |
Destructor.
Deletes all the elements that are currently stored.
Definition at line 128 of file mesh_refinement.C.
References clear().
|
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 1336 of file mesh_refinement.C.
References _mesh, clear(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), libMesh::MeshBase::get_boundary_info(), libMesh::MeshBase::is_serial(), libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::BoundaryInfo::remove(), libMesh::MeshCommunication::send_coarse_ghosts(), 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 1462 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::active_local_element_ptr_range(), libMesh::MeshBase::active_not_local_elements_begin(), libMesh::MeshBase::active_not_local_elements_end(), libMesh::as_range(), clear(), libMesh::ParallelObject::comm(), libMesh::MeshBase::element_ptr_range(), 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(), libMesh::Elem::REFINE, libMesh::Partitioner::set_node_processor_ids(), libMesh::MeshBase::unpartitioned_elements_begin(), libMesh::MeshBase::unpartitioned_elements_end(), 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 1594 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 909 of file mesh_refinement.h.
References _absolute_global_tolerance, and _use_member_parameters.
Referenced by build_mesh_refinement(), and main().
Adds the element elem
to the mesh.
Definition at line 211 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::add_elem(), and libMesh::libmesh_assert().
Referenced by libMesh::Elem::refine().
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 142 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(), and libMesh::DofObject::processor_id().
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 674 of file mesh_refinement_flagging.C.
References _mesh, and libMesh::MeshBase::element_ptr_range().
Referenced by main().
void libMesh::MeshRefinement::clean_refinement_flags | ( | ) |
Sets the refinement flag to Elem::DO_NOTHING
for each element in the mesh.
Definition at line 682 of file mesh_refinement_flagging.C.
References _mesh, libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), 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(), uniformly_coarsen(), and uniformly_refine().
void libMesh::MeshRefinement::clear | ( | ) |
Deletes all the data that are currently stored.
Definition at line 135 of file mesh_refinement.C.
References _new_nodes_map, and libMesh::TopologyMap::clear().
Referenced by _coarsen_elements(), _refine_elements(), and ~MeshRefinement().
|
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 873 of file mesh_refinement.h.
References _coarsen_by_parents, and _use_member_parameters.
Referenced by build_mesh_refinement(), and 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. Definition at line 608 of file mesh_refinement.C.
References _coarsen_elements(), _face_level_mismatch_limit, _mesh, _smooth_flags(), libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), make_coarsening_compatible(), make_flags_parallel_consistent(), libMesh::out, libMesh::MeshBase::prepare_for_use(), and test_level_one().
Referenced by libMesh::EquationSystems::reinit_solutions().
|
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 885 of file mesh_refinement.h.
References _coarsen_fraction, and _use_member_parameters.
Referenced by assemble_and_solve(), build_mesh_refinement(), 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 897 of file mesh_refinement.h.
References _coarsen_threshold, and _use_member_parameters.
Referenced by build_mesh_refinement(), and main().
|
inlineinherited |
Parallel::Communicator
object used by this mesh. Definition at line 94 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::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), _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::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DynaIO::add_spline_constraints(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), 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::MeshCommunication::assign_global_indices(), libMesh::DofMap::attach_matrix(), 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::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::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_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::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), 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::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), 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_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_preconditioner_apply(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), 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(), 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_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(), 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(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), 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::MeshTools::paranoid_n_levels(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), 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(), refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::BoundaryInfo::sync(), test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), test_unflagged(), SystemsTest::testBlockRestrictedVarNDofs(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), CheckpointIOTest::testSplitter(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), 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::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 220 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::ParallelObject::comm(), libMesh::DofObject::id(), libMesh::index_range(), libMesh::libmesh_assert(), libMesh::Elem::parent(), and std::sqrt().
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 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
Definition at line 368 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::Elem::DO_NOTHING, libMesh::Elem::INACTIVE, libMesh::libmesh_assert(), 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 954 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 539 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 915 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 648 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 446 of file mesh_refinement_flagging.C.
References _coarsen_by_parents, _coarsen_fraction, _max_h_level, _mesh, _refine_fraction, _use_member_parameters, libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::active_local_element_ptr_range(), 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, libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::active_local_element_ptr_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::invalid_uint, libMesh::libmesh_assert(), 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::MeshBase::active_element_ptr_range(), 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 584 of file mesh_refinement_flagging.C.
References _coarsen_fraction, _max_h_level, _mesh, _refine_fraction, _use_member_parameters, libMesh::MeshBase::active_element_ptr_range(), 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, libMesh::MeshBase::active_local_element_ptr_range(), 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(), 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 941 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
|
inline |
MeshBase
object associated with this object. Definition at line 333 of file mesh_refinement.h.
References _mesh.
|
inline |
MeshBase
object associated with this object. Definition at line 327 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 1807 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::MeshBase::active_element_ptr_range(), libMesh::ParallelObject::comm(), EDGE, enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::parent(), libMesh::Elem::REFINE, and swap().
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::MeshBase::active_element_ptr_range(), libMesh::ParallelObject::comm(), enforce_mismatch_limit_prior_to_refinement(), libMesh::MeshBase::n_nodes(), POINT, and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
private |
Definition at line 255 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::ParallelObject::comm(), and libMesh::Elem::REFINE.
Referenced by _smooth_flags().
|
private |
Definition at line 309 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::ParallelObject::comm(), 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 780 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::ancestor_elements_begin(), libMesh::MeshBase::ancestor_elements_end(), 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(), libMesh::Elem::has_children(), has_topological_neighbor(), libMesh::Elem::INACTIVE, libMesh::MeshBase::is_replicated(), libMesh::MeshBase::is_serial(), libMesh::Elem::level(), libMesh::MeshBase::level_elements_begin(), libMesh::MeshBase::level_elements_end(), libMesh::libmesh_assert(), libMesh::MeshTools::max_level(), libMesh::ParallelObject::n_processors(), libMesh::MeshBase::not_local_elements_begin(), libMesh::MeshBase::not_local_elements_end(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), 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(), 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 752 of file mesh_refinement.C.
References _mesh, libMesh::ParallelObject::comm(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), 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 1160 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::MeshBase::active_element_ptr_range(), 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(), 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 891 of file mesh_refinement.h.
References _max_h_level, and _use_member_parameters.
Referenced by assemble_and_solve(), and main().
|
inlineinherited |
Definition at line 100 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by 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::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EnsightIO::EnsightIO(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_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::partition(), 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(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::VTKIO::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 903 of file mesh_refinement.h.
References _nelem_target, and _use_member_parameters.
Referenced by build_mesh_refinement(), and 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 925 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 930 of file mesh_refinement.h.
References _overrefined_boundary_limit.
Referenced by libMesh::EquationSystems::reinit_solutions().
|
inlineinherited |
Definition at line 106 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), 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::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), 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_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), 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::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::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::DofMap::last_dof(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), 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::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::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), 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::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), 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::DistributedMesh::renumber_dof_objects(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusCopyElementSolution(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), 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::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::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), 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 476 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::MeshBase::element_ptr_range(), 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(), 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 683 of file mesh_refinement.C.
References _face_level_mismatch_limit, _mesh, _refine_elements(), _smooth_flags(), libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), make_flags_parallel_consistent(), make_refinement_compatible(), libMesh::out, libMesh::MeshBase::prepare_for_use(), and test_level_one().
Referenced by main(), libMesh::EquationSystems::reinit_solutions(), and EquationSystemsTest::testRefineThenReinitPreserveFlags().
|
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 879 of file mesh_refinement.h.
References _refine_fraction, and _use_member_parameters.
Referenced by assemble_and_solve(), build_mesh_refinement(), and main().
|
inline |
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.
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 655 of file mesh_refinement_flagging.C.
References _mesh, libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), and libMesh::Elem::INACTIVE.
Referenced by main().
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.
Definition at line 353 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::Elem::active(), libMesh::MeshBase::active_local_element_ptr_range(), libMesh::ParallelObject::comm(), libMesh::Elem::level(), libMesh::libmesh_assert(), 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 | ) |
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 428 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::libmesh_assert(), 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 1791 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 935 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 1703 of file mesh_refinement.C.
References _coarsen_elements(), _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::ancestor_elements_begin(), libMesh::MeshBase::ancestor_elements_end(), libMesh::as_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::MeshBase::elem_ref(), libMesh::Elem::INACTIVE, libMesh::MeshBase::is_replicated(), libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::MeshBase::not_local_elements_begin(), libMesh::MeshBase::not_local_elements_end(), libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::Elem::refinement_flag(), 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 1663 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), 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 1649 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), 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 1678 of file mesh_refinement.C.
References _mesh, _refine_elements(), libMesh::MeshBase::active_element_ptr_range(), 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(), SlitMeshRefinedMeshTest::setUp(), MixedDimensionRefinedMeshTest::setUp(), SlitMeshRefinedSystemTest::setUp(), BoundaryRefinedMeshTest::setUp(), ExtraIntegersTest::test_helper(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), and SystemsTest::testProjectMatrix3D().
|
private |
Updates the _new_nodes_map
.
Definition at line 346 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 770 of file mesh_refinement.h.
Referenced by absolute_global_tolerance(), and flag_elements_by_error_tolerance().
|
private |
Refinement parameter values.
Definition at line 758 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 762 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 766 of file mesh_refinement.h.
Referenced by coarsen_threshold(), flag_elements_by_error_tolerance(), and flag_elements_by_nelem_target().
|
protectedinherited |
Definition at line 112 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=(), and libMesh::ParallelObject::processor_id().
|
private |
Definition at line 773 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 847 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 772 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 764 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 745 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 768 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 740 of file mesh_refinement.h.
Referenced by add_node(), clear(), and update_nodes_map().
|
private |
Definition at line 774 of file mesh_refinement.h.
Referenced by _smooth_flags(), and node_level_mismatch_limit().
|
private |
Definition at line 776 of file mesh_refinement.h.
Referenced by _smooth_flags(), and overrefined_boundary_limit().
|
private |
Definition at line 864 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 760 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 777 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 752 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().