Hermes2D
3.0
|
#include <adapt.h>
Public Member Functions | |
Adapt (std::vector< SpaceSharedPtr< Scalar > > spaces, ErrorCalculator< Scalar > *error_calculator, AdaptivityStoppingCriterion< Scalar > *strategy=nullptr) | |
Adapt (SpaceSharedPtr< Scalar > space, ErrorCalculator< Scalar > *error_calculator, AdaptivityStoppingCriterion< Scalar > *strategy=nullptr) | |
Adapt (ErrorCalculator< Scalar > *error_calculator, AdaptivityStoppingCriterion< Scalar > *strategy=nullptr) | |
virtual | ~Adapt () |
Destructor. Deallocates allocated private data. | |
void | free () |
Deallocates allocated private data. | |
bool | adapt (std::vector< RefinementSelectors::Selector< Scalar > * > refinement_selectors) |
Refines elements based on results from the ErrorCalculator class. More... | |
bool | adapt (RefinementSelectors::Selector< Scalar > *refinement_selector) |
Refines elements based on results from the ErrorCalculator class. More... | |
void | set_strategy (AdaptivityStoppingCriterion< Scalar > *strategy) |
void | set_regularization_level (int regularization) |
virtual bool | isOkay () const |
Internal checking. | |
std::string | getClassName () const |
void | set_spaces (std::vector< SpaceSharedPtr< Scalar > > spaces) |
Set spaces. | |
void | set_space (SpaceSharedPtr< Scalar > space) |
MeshFunctionSharedPtr< double > | get_refinementInfoMeshFunction (int component=-1) |
Protected Member Functions | |
void | set_defaults () |
Set default values. | |
void | init_adapt (std::vector< RefinementSelectors::Selector< Scalar > * > &refinement_selectors, ElementToRefine ***element_refinement_location, MeshSharedPtr *meshes) |
Initialization. | |
int | calculate_attempted_element_refinements_count () |
Return the number of element where a refinement will be sought. | |
void | adapt_postprocess (MeshSharedPtr *meshes, int element_refinements_count) |
Handle meshes and spaces at the end of the routine. | |
void | deinit_adapt (ElementToRefine ***element_refinement_location) |
Deinitialization. | |
void | init () |
Common code for the constructors. | |
void | apply_refinement (const ElementToRefine &elem_ref) |
Apply a single refinement. More... | |
virtual void | apply_refinements (ElementToRefine *elems_to_refine, int num_elem_to_process) |
Apply a vector of refinements. More... | |
void | fix_shared_mesh_refinements (MeshSharedPtr *meshes, ElementToRefine *&elems_to_refine, int &num_elem_to_process, ElementToRefine ***refinement_location, RefinementSelectors::Selector< Scalar > **refinement_selectors) |
Fixes refinements of a mesh which is shared among multiple components of a multimesh. More... | |
void | homogenize_shared_mesh_orders (MeshSharedPtr *meshes) |
Enforces the same order to an element of a mesh which is shared among multiple components. More... | |
Protected Attributes | |
AdaptivityStoppingCriterion < Scalar > * | strategy |
Current strategy. | |
int | num |
Number of solution components (as in wf->neq). | |
int | regularization |
Regularization (max. level of hanging nodes) level. | |
std::vector< MeshSharedPtr > | meshes |
Meshes. | |
std::vector< SpaceSharedPtr < Scalar > > | spaces |
Spaces. | |
ErrorCalculator< Scalar > * | errorCalculator |
Error calculator. | |
ElementToRefine * | elements_to_refine |
Information about performed refinements. | |
int | elements_to_refine_count |
MeshFunctionSharedPtr< double > | refinementInfoMeshFunction [H2D_MAX_COMPONENTS] |
Mesh function for postprocessing the information about which elements have been refined - on component basis. | |
MeshFunctionSharedPtr< double > | refinementInfoMeshFunctionGlobal |
Mesh function for postprocessing the information about which elements have been refined - for the whole system. | |
![]() | |
unsigned char | num_threads_used |
std::string | exceptionMessageCaughtInParallelBlock |
Friends | |
template<typename T , typename S > | |
class | AdaptSolver |
Evaluation of an error between a (coarse) solution and a reference solution and adaptivity. The class provides basic functionality necessary to adaptively refine elements. Given a reference solution and a coarse solution, it calculates error estimates and it acts as a container for the calculated errors. For default values of attributes, see the method set_defaults().
Hermes::Hermes2D::Adapt< Scalar >::Adapt | ( | std::vector< SpaceSharedPtr< Scalar > > | spaces, |
ErrorCalculator< Scalar > * | error_calculator, | ||
AdaptivityStoppingCriterion< Scalar > * | strategy = nullptr |
||
) |
bool Hermes::Hermes2D::Adapt< Scalar >::adapt | ( | std::vector< RefinementSelectors::Selector< Scalar > * > | refinement_selectors | ) |
Refines elements based on results from the ErrorCalculator class.
[in] | refinement_selectors | Vector of selectors. |
bool Hermes::Hermes2D::Adapt< Scalar >::adapt | ( | RefinementSelectors::Selector< Scalar > * | refinement_selector | ) |
Refines elements based on results from the ErrorCalculator class.
[in] | refinement_selector | A pointer to a selector which will select a refinement. |
|
protected |
|
protectedvirtual |
|
protected |
Fixes refinements of a mesh which is shared among multiple components of a multimesh.
If a mesh is shared among components, it has to be refined similarly in order to avoid inconsistency.
[in] | meshes | An array of meshes of components. |
[in] | elems_to_refine | An array of refinements. |
[in] | num_elem_to_process | Length of the array elems_to_refine. |
[in] | idx | A 2D array that translates a pair (a component index, an element id) to an index of a refinement in the vector of refinements. If the index is below zero, a given element was not refined. |
[in] | refinement_selectors | Selectors used by the adaptivity. The selector is used to correct orders of modified refinements using RefinementSelectors::Selector::update_shared_mesh_orders(). |
MeshFunctionSharedPtr< double > Hermes::Hermes2D::Adapt< Scalar >::get_refinementInfoMeshFunction | ( | int | component = -1 | ) |
|
protected |
void Hermes::Hermes2D::Adapt< Scalar >::set_regularization_level | ( | int | regularization | ) |
void Hermes::Hermes2D::Adapt< Scalar >::set_strategy | ( | AdaptivityStoppingCriterion< Scalar > * | strategy | ) |
Set the current strategy.
[in] | strategy | The strategy, see the info for AdaptivityStoppingCriterion. |