AMR Namespace Reference
|
Developer Documentation
|
Namespaces | |
| namespace | internal |
Classes | |
| class | AMRIndicatorBase |
| class | AMRRegion |
| Type-erased wrapper representing a geometric region for adaptive mesh refinement. More... | |
| class | BinaryOpIndicatorComposite |
| class | JumpIndicator |
| class | SphereAMRRegion |
| Represents a spherical region for adaptive mesh refinement. More... | |
| class | SphericalShellAMRRegion |
| Represents a spherical shell region for adaptive mesh refinement (AMR). More... | |
| class | SSEDIndicator |
Typedefs | |
| template<int dim> | |
| using | MarkCellsForRefinementType = std::function< bool(dealii::Triangulation< dim > &)> |
Functions | |
| template<typename number > | |
| bool | now (const AdaptiveMeshingData< number > &amr, const int n_time_step) |
| template<int dim, typename VectorType , typename number = typename VectorType::value_type> | |
| void | refine_grid (const MarkCellsForRefinementType< dim > &mark_cells_for_refinement, const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors, const std::function< void()> &setup_dof_system, const AdaptiveMeshingData< number > &amr, dealii::Triangulation< dim > &tria, const int n_time_step, const std::function< void()> &post=std::function< void()>(), const std::function< void()> &pre=std::function< void()>()) |
| template<int dim, typename VectorType , typename number > | |
| void | refine_grid (const std::function< bool(dealii::Triangulation< dim > &)> &mark_cells_for_refinement, const std::function< void(std::vector< VectorType * > &)> &attach_vectors, const std::function< void()> &setup_dof_system, const AdaptiveMeshingData< number > &amr, dealii::DoFHandler< dim > &dof_handler, const int n_time_step, const std::function< void()> &post=std::function< void()>(), const std::function< void()> &pre=std::function< void()>()) |
| template<int dim, typename number > | |
| bool | mark_fixed_number (dealii::Triangulation< dim > &tria, const dealii::Vector< number > &indicator, const AdaptiveMeshingData< number > &amr_data, dealii::types::global_cell_index max_n_cells=std::numeric_limits< dealii::types::global_cell_index >::max()) |
| template<int dim, typename number > | |
| bool | mark_fixed_fraction (dealii::Triangulation< dim > &tria, const dealii::Vector< number > &indicator, const AdaptiveMeshingData< number > &amr_data) |
| template<int dim, typename number > | |
| bool | set_refinement_flags_in_regions (dealii::Triangulation< dim > &tria, const std::vector< AMRRegion< dim, number > > ®ions={}, bool do_coarsening=false) |
| Marks cells in a triangulation for refinement if their centers fall inside specified regions. | |
| template<int dim, typename VectorType , typename number > | |
| void | refine_grid (const MarkCellsForRefinementType< dim > &mark_cells_for_refinement, const std::function< void(std::vector< VectorType * > &)> &attach_vectors, const std::function< void()> &setup_dof_system, const AdaptiveMeshingData< number > &amr, dealii::DoFHandler< dim > &dof_handler, const int n_time_step, const std::function< void()> &post, const std::function< void()> &pre) |
| template void | refine_grid (const MarkCellsForRefinementType< 1 > &, const AttachDoFHandlerAndVectorsType< 1, dealii::LinearAlgebra::distributed::Vector< double > > &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::Triangulation< 1 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template void | refine_grid (const MarkCellsForRefinementType< 2 > &, const AttachDoFHandlerAndVectorsType< 2, dealii::LinearAlgebra::distributed::Vector< double > > &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::Triangulation< 2 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template void | refine_grid (const MarkCellsForRefinementType< 3 > &, const AttachDoFHandlerAndVectorsType< 3, dealii::LinearAlgebra::distributed::Vector< double > > &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::Triangulation< 3 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template void | refine_grid (const MarkCellsForRefinementType< 1 > &, const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::DoFHandler< 1 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template void | refine_grid (const MarkCellsForRefinementType< 2 > &, const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::DoFHandler< 2 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template void | refine_grid (const MarkCellsForRefinementType< 3 > &, const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> &, const std::function< void()> &, const AdaptiveMeshingData< double > &, dealii::DoFHandler< 3 > &, const int, const std::function< void()> &, const std::function< void()> &) |
| template bool | mark_fixed_number (dealii::Triangulation< 1 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data, dealii::types::global_cell_index max_n_cells) |
| template bool | mark_fixed_number (dealii::Triangulation< 2 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data, dealii::types::global_cell_index max_n_cells) |
| template bool | mark_fixed_number (dealii::Triangulation< 3 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data, dealii::types::global_cell_index max_n_cells) |
| template bool | mark_fixed_fraction (dealii::Triangulation< 1 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data) |
| template bool | mark_fixed_fraction (dealii::Triangulation< 2 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data) |
| template bool | mark_fixed_fraction (dealii::Triangulation< 3 > &tria, const dealii::Vector< double > &indicator, const AdaptiveMeshingData< double > &amr_data) |
Typedef Documentation
◆ MarkCellsForRefinementType
| using MeltPoolDG::AMR::MarkCellsForRefinementType = typedef std::function<bool(dealii::Triangulation<dim> &)> |
Type alias definition for the lambda function that determines how the mesh is to be refined. If this function determines that the mesh does not change, it return false, true otherwise.
Function Documentation
◆ mark_fixed_fraction() [1/4]
| template bool MeltPoolDG::AMR::mark_fixed_fraction | ( | dealii::Triangulation< 1 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data | ||
| ) |
◆ mark_fixed_fraction() [2/4]
| template bool MeltPoolDG::AMR::mark_fixed_fraction | ( | dealii::Triangulation< 2 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data | ||
| ) |
◆ mark_fixed_fraction() [3/4]
| template bool MeltPoolDG::AMR::mark_fixed_fraction | ( | dealii::Triangulation< 3 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data | ||
| ) |
◆ mark_fixed_fraction() [4/4]
| bool MeltPoolDG::AMR::mark_fixed_fraction | ( | dealii::Triangulation< dim > & | tria, |
| const dealii::Vector< number > & | indicator, | ||
| const AdaptiveMeshingData< number > & | amr_data | ||
| ) |
Marks cells for refinement or coarsening based on the provided indicator.
The marking strategy follows the approach described in deal.II’s documentation for GridRefinement::refine_and_coarsen_fixed_fraction().
- Parameters
-
tria Triangulation whose cells are to be marked for refinement or coarsening. Smaller values indicate a lower need for refinement. indicator Vector of refinement indicators for the active cells. amr_data Object defining the lower and upper fractions of cells to refine or coarsen.
◆ mark_fixed_number() [1/4]
| template bool MeltPoolDG::AMR::mark_fixed_number | ( | dealii::Triangulation< 1 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data, | ||
| dealii::types::global_cell_index | max_n_cells | ||
| ) |
◆ mark_fixed_number() [2/4]
| template bool MeltPoolDG::AMR::mark_fixed_number | ( | dealii::Triangulation< 2 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data, | ||
| dealii::types::global_cell_index | max_n_cells | ||
| ) |
◆ mark_fixed_number() [3/4]
| template bool MeltPoolDG::AMR::mark_fixed_number | ( | dealii::Triangulation< 3 > & | tria, |
| const dealii::Vector< double > & | indicator, | ||
| const AdaptiveMeshingData< double > & | amr_data, | ||
| dealii::types::global_cell_index | max_n_cells | ||
| ) |
◆ mark_fixed_number() [4/4]
| bool MeltPoolDG::AMR::mark_fixed_number | ( | dealii::Triangulation< dim > & | tria, |
| const dealii::Vector< number > & | indicator, | ||
| const AdaptiveMeshingData< number > & | amr_data, | ||
| dealii::types::global_cell_index | max_n_cells = std::numeric_limits<dealii::types::global_cell_index>::max() |
||
| ) |
Marks cells for refinement or coarsening based on the provided indicator.
The marking strategy follows the approach described in deal.II’s documentation for GridRefinement::refine_and_coarsen_fixed_number().
- Parameters
-
tria Triangulation whose cells are to be marked for refinement or coarsening. Smaller values indicate a lower need for refinement. indicator Vector of refinement indicators for the active cells. amr_data Object defining the lower and upper fractions of cells to refine or coarsen. max_n_cells Maximum number of total cells allowed in the triangulation.
◆ now()
|
inline |
◆ refine_grid() [1/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 1 > & | , |
| const AttachDoFHandlerAndVectorsType< 1, dealii::LinearAlgebra::distributed::Vector< double > > & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::Triangulation< 1 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [2/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 1 > & | , |
| const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::DoFHandler< 1 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [3/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 2 > & | , |
| const AttachDoFHandlerAndVectorsType< 2, dealii::LinearAlgebra::distributed::Vector< double > > & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::Triangulation< 2 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [4/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 2 > & | , |
| const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::DoFHandler< 2 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [5/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 3 > & | , |
| const AttachDoFHandlerAndVectorsType< 3, dealii::LinearAlgebra::distributed::Vector< double > > & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::Triangulation< 3 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [6/9]
| template void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< 3 > & | , |
| const std::function< void(std::vector< dealii::LinearAlgebra::distributed::Vector< double > * > &)> & | , | ||
| const std::function< void()> & | , | ||
| const AdaptiveMeshingData< double > & | , | ||
| dealii::DoFHandler< 3 > & | , | ||
| const int | , | ||
| const std::function< void()> & | , | ||
| const std::function< void()> & | |||
| ) |
◆ refine_grid() [7/9]
| void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< dim > & | mark_cells_for_refinement, |
| const AttachDoFHandlerAndVectorsType< dim, VectorType > & | attach_vectors, | ||
| const std::function< void()> & | setup_dof_system, | ||
| const AdaptiveMeshingData< number > & | amr, | ||
| dealii::Triangulation< dim > & | tria, | ||
| const int | n_time_step, | ||
| const std::function< void()> & | post = std::function<void()>(), |
||
| const std::function< void()> & | pre = std::function<void()>() |
||
| ) |
Refine the mesh in
- Parameters
-
tria if the n_time_step is chosen to be refined by now(). mark_cells_for_refinement lambda function of type MarkCellsForRefinementType, see its documentation for info attach_vectors lambda function of type AttachDoFHandlerAndVectorsType, that attaches all DoFHandlers and their respective DoFVectors that ought to be transferred to the new mesh setup_dof_system setup the dof system, this includes: - distribute DoFs on the new mesh
- create partitioning for the new mesh
- setup constraints on the new mesh
- reinit the MatrixFree object for the new DoFs (ScratchData::build())
- initialize all DoF vectors for the new DoF
post this optional lambda function is run after AMR was executed pre this optional lambda function is run before AMR was executed
◆ refine_grid() [8/9]
| void MeltPoolDG::AMR::refine_grid | ( | const MarkCellsForRefinementType< dim > & | mark_cells_for_refinement, |
| const std::function< void(std::vector< VectorType * > &)> & | attach_vectors, | ||
| const std::function< void()> & | setup_dof_system, | ||
| const AdaptiveMeshingData< number > & | amr, | ||
| dealii::DoFHandler< dim > & | dof_handler, | ||
| const int | n_time_step, | ||
| const std::function< void()> & | post, | ||
| const std::function< void()> & | pre | ||
| ) |
◆ refine_grid() [9/9]
| void MeltPoolDG::AMR::refine_grid | ( | const std::function< bool(dealii::Triangulation< dim > &)> & | mark_cells_for_refinement, |
| const std::function< void(std::vector< VectorType * > &)> & | attach_vectors, | ||
| const std::function< void()> & | setup_dof_system, | ||
| const AdaptiveMeshingData< number > & | amr, | ||
| dealii::DoFHandler< dim > & | dof_handler, | ||
| const int | n_time_step, | ||
| const std::function< void()> & | post = std::function< void()>(), |
||
| const std::function< void()> & | pre = std::function< void()>() |
||
| ) |
Same as above, but for only one
- Parameters
-
dof_handler
◆ set_refinement_flags_in_regions()
| bool MeltPoolDG::AMR::set_refinement_flags_in_regions | ( | dealii::Triangulation< dim > & | tria, |
| const std::vector< AMRRegion< dim, number > > & | regions = {}, |
||
| bool | do_coarsening = false |
||
| ) |
Marks cells in a triangulation for refinement if their centers fall inside specified regions.
This function iterates over all active cells in the given triangulation and sets the refine flag for each cell whose center lies within any of the provided adaptive mesh refinement regions. Optionally, if the cell center does not lie within any region and the refine flag has not been already set for the cell, the coarsen flag is set.
- Parameters
-
tria The triangulation whose cells will be marked for refinement. regions A list of AMR regions. If a cell center lies inside any of those regions, the corresponding refinement flag will be set. do_coarsening If set, all cells which are not inside any of the regions and not yet marked for * refinement are marked for coarsening.
- Returns
- Returns
trueif any refine or coarsen flag has been set, otherwise returnsfalse.
- Note
- If no regions are provided, the function returns immediately.
Generated by