Responsible for mesh refinement algorithms and data. More...
#include <mesh_refinement.h>
Classes | |
class | ElementFlagging |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Private Types | |
enum | NeighborType { POINT, EDGE } |
Private Member Functions | |
MeshRefinement (const MeshRefinement &) | |
MeshRefinement & | operator= (const MeshRefinement &) |
bool | _coarsen_elements () |
bool | _refine_elements () |
void | _smooth_flags (bool refining, bool coarsening) |
bool | limit_level_mismatch_at_node (const unsigned int max_mismatch) |
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 () |
void | create_parent_error_vector (const ErrorVector &error_per_cell, ErrorVector &error_per_parent, Real &parent_error_min, Real &parent_error_max) |
void | update_nodes_map () |
bool | make_coarsening_compatible () |
bool | make_refinement_compatible () |
Elem * | topological_neighbor (Elem *elem, const PointLocatorBase *point_locator, const unsigned int side) |
bool | has_topological_neighbor (const Elem *elem, const PointLocatorBase *point_locator, const Elem *neighbor) |
bool | enforce_mismatch_limit_prior_to_refinement (Elem *elem, NeighborType nt, unsigned max_mismatch) |
Private Attributes | |
TopologyMap | _new_nodes_map |
MeshBase & | _mesh |
bool | _use_member_parameters |
bool | _coarsen_by_parents |
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 |
PeriodicBoundaries * | _periodic_boundaries |
Responsible for mesh refinement algorithms and data.
This is the MeshRefinement
class. This class implements adaptive mesh refinement algorithms for a MeshBase
.
Definition at line 58 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 855 of file mesh_refinement.h.
|
explicit |
Constructor.
Definition at line 93 of file mesh_refinement.C.
|
private |
libMesh::MeshRefinement::~MeshRefinement | ( | ) |
Destructor. Deletes all the elements that are currently stored.
Definition at line 127 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 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::element_ptr_range(), libMesh::MeshBase::get_boundary_info(), libMesh::MeshBase::is_serial(), libMesh::Elem::JUST_COARSENED, libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::Parallel::Communicator::max(), 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 1461 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_replicated(), libMesh::Elem::JUST_REFINED, 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::Parallel::Communicator::max(), 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 1592 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::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 906 of file mesh_refinement.h.
References _absolute_global_tolerance, and _use_member_parameters.
Adds the element elem
to the mesh.
Definition at line 210 of file mesh_refinement.C.
References _mesh, and libMesh::MeshBase::add_elem().
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 141 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::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 654 of file mesh_refinement_flagging.C.
References _mesh, and libMesh::MeshBase::element_ptr_range().
void libMesh::MeshRefinement::clean_refinement_flags | ( | ) |
Sets the refinement flag to Elem::DO_NOTHING
for each element in the mesh.
Definition at line 662 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 134 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 870 of file mesh_refinement.h.
References _coarsen_by_parents, and _use_member_parameters.
bool libMesh::MeshRefinement::coarsen_elements | ( | ) |
Only coarsens the user-requested elements. Some elements will not be coarsened to satisfy the level one rule. It is possible that for a given set of refinement flags there is actually no change upon calling this member function.
true
if the mesh actually changed (hence data needs to be projected) and false
otherwise.maintain_level_one
, new code should use face_level_mismatch_limit() instead. Definition at line 607 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, 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 , and is 0 by default.
Definition at line 882 of file mesh_refinement.h.
References _coarsen_fraction, and _use_member_parameters.
|
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 , and is 0.1 by default.
Definition at line 894 of file mesh_refinement.h.
References _coarsen_threshold, and _use_member_parameters.
|
inlineinherited |
Parallel::Communicator
object used by this mesh. Definition at line 89 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::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), _refine_elements(), _smooth_flags(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::ImplicitSystem::add_matrix(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), 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::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::PetscDMWrapper::check_section_n_dofs(), 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::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), 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(), eliminate_unrefined_patches(), libMesh::EpetraVector< T >::EpetraVector(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), flag_elements_by_elem_fraction(), flag_elements_by_error_fraction(), flag_elements_by_nelem_target(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), 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_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(), 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::FEMSystem::mesh_position_set(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), 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::MeshBase::prepare_for_use(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), 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::MeshBase::recalculate_n_partitions(), refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::CheckpointIO::select_split_config(), 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::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), test_level_one(), test_unflagged(), libMesh::MeshTools::total_weight(), uniformly_coarsen(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), 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().
|
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 219 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::ParallelObject::comm(), libMesh::DofObject::id(), std::max(), std::min(), libMesh::Parallel::Communicator::min(), libMesh::Elem::parent(), and libMesh::Parallel::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 917 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 380 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::Parallel::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 951 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 551 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 912 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 628 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 .
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 434 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(), libMesh::Parallel::Communicator::allgather(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::invalid_uint, libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_elem(), libMesh::Elem::parent(), libMesh::Real, libMesh::Elem::REFINE, and libMesh::Elem::set_refinement_flag().
void libMesh::MeshRefinement::flag_elements_by_error_fraction | ( | const ErrorVector & | error_per_cell, |
const Real | refine_fraction = 0.3 , |
||
const Real | coarsen_fraction = 0.0 , |
||
const unsigned int | max_level = libMesh::invalid_uint |
||
) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
. The two fractions refine_fraction
and coarsen_fraction
must be in .
All the function arguments except error_per_cell have been deprecated, and will be removed in future libMesh releases - to control these parameters, set the corresponding member variables.
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, std::max(), libMesh::Parallel::Communicator::max(), std::min(), libMesh::Parallel::Communicator::min(), libMesh::Elem::parent(), libMesh::Real, and libMesh::Elem::REFINE.
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 .
Definition at line 166 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, create_parent_error_vector(), libMesh::ErrorVectorReal, libMesh::DofObject::id(), libMesh::MeshBase::n_active_elem(), libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::Real, and libMesh::Elem::REFINE.
void libMesh::MeshRefinement::flag_elements_by_mean_stddev | ( | const ErrorVector & | error_per_cell, |
const Real | refine_fraction = 1.0 , |
||
const Real | coarsen_fraction = 0.0 , |
||
const unsigned int | max_level = libMesh::invalid_uint |
||
) |
Flags elements for coarsening and refinement based on the computed error passed in error_per_cell
. This method picks the top refine_fraction
* stddev
+ mean
elements for refinement and the bottom mean
- coarsen_fraction
* stddev
elements for coarsening. The two fractions refine_fraction
and coarsen_fraction
must be in .
All the function arguments except error_per_cell have been deprecated, and will be removed in future libMesh releases - to control these parameters, set the corresponding member variables.
Definition at line 568 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::ErrorVectorReal, libMesh::invalid_uint, std::max(), libMesh::ErrorVector::mean(), libMesh::Real, libMesh::Elem::REFINE, 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 229 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::Parallel::Communicator::allgather(), libMesh::Elem::child_ref_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), create_parent_error_vector(), libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), libMesh::MeshBase::mesh_dimension(), std::min(), libMesh::MeshBase::n_active_elem(), libMesh::MeshBase::query_elem_ptr(), libMesh::Real, libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::set_refinement_flag().
|
inline |
_enforce_mismatch_limit_prior_to_refinement
flag, false by default.Definition at line 938 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
|
inline |
MeshBase
object associated with this object. Definition at line 324 of file mesh_refinement.h.
References _mesh.
|
inline |
MeshBase
object associated with this object. Definition at line 330 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 1805 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::Elem::has_neighbor(), and libMesh::Elem::has_topological_neighbor().
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(), std::max(), libMesh::Parallel::Communicator::max(), 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(), std::max(), libMesh::Parallel::Communicator::max(), 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(), libMesh::Elem::level(), libMesh::Parallel::Communicator::max(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::Elem::set_p_refinement_flag(), and libMesh::Elem::set_refinement_flag().
Referenced by _smooth_flags().
|
private |
Definition at line 316 of file mesh_refinement_smoothing.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::ParallelObject::comm(), libMesh::Elem::level(), libMesh::Parallel::Communicator::max(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().
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::MeshBase::active_element_ptr_range(), libMesh::MeshBase::ancestor_elements_begin(), libMesh::MeshBase::ancestor_elements_end(), libMesh::Parallel::any_source, 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::Parallel::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::MeshBase::level_elements_begin(), libMesh::MeshBase::level_elements_end(), std::max(), libMesh::MeshTools::max_level(), libMesh::Parallel::Communicator::min(), 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::Parallel::Communicator::receive(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Parallel::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(), topological_neighbor(), and libMesh::Parallel::wait().
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(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::Parallel::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::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::Parallel::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(), side, 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 888 of file mesh_refinement.h.
References _max_h_level, and _use_member_parameters.
|
inlineinherited |
Definition at line 95 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().
Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), 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::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::MeshBase::get_info(), 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::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::partition(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), 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::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), 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 900 of file mesh_refinement.h.
References _nelem_target, and _use_member_parameters.
|
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 922 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 927 of file mesh_refinement.h.
References _overrefined_boundary_limit.
Referenced by libMesh::EquationSystems::reinit_solutions().
|
inlineinherited |
Definition at line 101 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().
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::FEMSystem::assembly(), libMesh::EquationSystems::build_discontinuous_solution_vector(), 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::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::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::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::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::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::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::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(), make_coarsening_compatible(), 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::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::System::read_legacy_data(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), 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::CheckpointIO::select_split_config(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::MeshTools::total_weight(), uniformly_coarsen(), libMesh::Parallel::Packing< T >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), 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_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::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::System::write_parallel_data(), 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::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 475 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::MeshBase::libmesh_assert_valid_parallel_ids(), make_coarsening_compatible(), make_flags_parallel_consistent(), make_refinement_compatible(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::prepare_for_use(), libMesh::Elem::REFINE, test_level_one(), and test_unflagged().
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 682 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, make_flags_parallel_consistent(), make_refinement_compatible(), libMesh::out, libMesh::MeshBase::prepare_for_use(), and test_level_one().
Referenced by libMesh::EquationSystems::reinit_solutions().
|
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 , and is 0.3 by default.
Definition at line 876 of file mesh_refinement.h.
References _refine_fraction, and _use_member_parameters.
|
inline |
Set _enforce_mismatch_limit_prior_to_refinement option. Defaults to false.
Definition at line 944 of file mesh_refinement.h.
References enforce_mismatch_limit_prior_to_refinement().
void libMesh::MeshRefinement::set_periodic_boundaries_ptr | ( | PeriodicBoundaries * | pb_ptr | ) |
Sets the PeriodicBoundaries
pointer.
void libMesh::MeshRefinement::switch_h_to_p_refinement | ( | ) |
Takes a mesh whose elements are flagged for h refinement and coarsening, and switches those flags to request p refinement and coarsening instead.
Definition at line 635 of file mesh_refinement_flagging.C.
References _mesh, libMesh::Elem::DO_NOTHING, libMesh::MeshBase::element_ptr_range(), and libMesh::Elem::INACTIVE.
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 352 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::Parallel::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 | ) |
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 427 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::Elem::COARSEN, libMesh::ParallelObject::comm(), libMesh::Parallel::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 1789 of file mesh_refinement.C.
References _mesh, _periodic_boundaries, libMesh::Elem::neighbor_ptr(), side, 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 932 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 1701 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::Parallel::any_source, libMesh::as_range(), clean_refinement_flags(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::ParallelObject::comm(), libMesh::MeshBase::elem_ref(), libMesh::Parallel::Communicator::get_unique_tag(), libMesh::Elem::INACTIVE, libMesh::MeshBase::is_replicated(), 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::Parallel::Communicator::receive(), libMesh::Elem::refinement_flag(), libMesh::Parallel::Communicator::send(), libMesh::Elem::set_refinement_flag(), libMesh::Parallel::sync_dofobject_data_by_id(), and libMesh::Parallel::wait().
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), and libMesh::AdjointRefinementEstimator::estimate_error().
void libMesh::MeshRefinement::uniformly_p_coarsen | ( | unsigned int | n = 1 | ) |
Attempts to uniformly p coarsen the mesh n
times.
Definition at line 1661 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 1647 of file mesh_refinement.C.
References _mesh, libMesh::MeshBase::active_element_ptr_range(), and libMesh::Elem::JUST_REFINED.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), and libMesh::AdjointRefinementEstimator::estimate_error().
void libMesh::MeshRefinement::uniformly_refine | ( | unsigned int | n = 1 | ) |
Uniformly refines the mesh n
times.
Definition at line 1676 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(), and libMesh::AdjointRefinementEstimator::estimate_error().
|
private |
Updates the _new_nodes_map
Definition at line 345 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 767 of file mesh_refinement.h.
Referenced by absolute_global_tolerance(), and flag_elements_by_error_tolerance().
|
private |
Refinement parameter values
Definition at line 755 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 759 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 763 of file mesh_refinement.h.
Referenced by coarsen_threshold(), flag_elements_by_error_tolerance(), and flag_elements_by_nelem_target().
|
protectedinherited |
Definition at line 107 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 770 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 844 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 769 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 761 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 742 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 765 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 737 of file mesh_refinement.h.
Referenced by add_node(), clear(), and update_nodes_map().
|
private |
Definition at line 771 of file mesh_refinement.h.
Referenced by _smooth_flags(), and node_level_mismatch_limit().
|
private |
Definition at line 773 of file mesh_refinement.h.
Referenced by _smooth_flags(), and overrefined_boundary_limit().
|
private |
Definition at line 861 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 757 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 774 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 749 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().