Base type for refinement strategies for \(hp\)-adaptive refinement. More...
#include <ptems/hpstrategies.hpp>
Classes | |
struct | RefinementDataImpl |
Implentation of HPRefinementData which hides type of the estimator and function containers. More... | |
Public Member Functions | |
HPRefinementStrategy (const PDiscreteFunctionSpace< DIM, X, N > &space, std::size_t minP=1) | |
Creates the base type for a \(hp\)-refinement strategy. More... | |
const PDiscreteFunctionSpace< DIM, X, N > & | Space () |
Gets the finite element space the refinement strategy is on. More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptWithStrategyAndDefaultSmoothing (const Estimators &estimators, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor, and with default mesh smoothing options (default constructed MeshSmoother). More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptWithStrategyAndDefaultSmoothing (const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space, and with default mesh smoothing options (default constructed MeshSmoother). More... | |
template<typename MarkingStrategy , typename Estimators , typename DiscreteFuncs , typename... Args, typename = typename DiscreteFuncs::value_type> | |
FEMesh< DIM >::Modifications | AdaptWithStrategyAndDefaultSmoothing (const Estimators &estimators, const DiscreteFuncs &funcs, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space, and with default mesh smoothing options (default constructed MeshSmoother). More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptConformingWithStrategy (const Estimators &estimators, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor, with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()). More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptConformingWithStrategy (const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()). More... | |
template<typename MarkingStrategy , typename Estimators , typename DiscreteFuncs , typename... Args, typename = typename DiscreteFuncs::value_type> | |
FEMesh< DIM >::Modifications | AdaptConformingWithStrategy (const Estimators &estimators, const DiscreteFuncs &funcs, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()). More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptWithStrategy (const Estimators &estimators, MeshSmoother smoother, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor and with the specified mesh smoothing options. More... | |
template<typename MarkingStrategy , typename Estimators , typename... Args> | |
FEMesh< DIM >::Modifications | AdaptWithStrategy (const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, MeshSmoother smoother, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space and with the specified mesh smoothing options. More... | |
template<typename MarkingStrategy , typename Estimators , typename DiscreteFuncs , typename... Args, typename = typename DiscreteFuncs::value_type> | |
FEMesh< DIM >::Modifications | AdaptWithStrategy (const Estimators &estimators, const DiscreteFuncs &funcs, MeshSmoother smoother, Args... args) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space and with the specified mesh smoothing options. More... | |
template<typename Container , typename Estimators , typename = typename Container::value_type> | |
FEMesh< DIM >::Modifications | Adapt (const Container &flags, const Estimators &estimators, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform. More... | |
template<typename Container , typename Estimators , typename = typename Container::value_type> | |
FEMesh< DIM >::Modifications | Adapt (const Container &flags, const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform. More... | |
template<typename Container , typename Estimators , typename DiscreteFuncs , typename = typename Container::value_type> | |
FEMesh< DIM >::Modifications | Adapt (const Container &flags, const Estimators &estimators, const DiscreteFuncs &funcs, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform. More... | |
template<typename Container , typename Estimators > | |
FEMesh< DIM >::Modifications | Adapt (const Container &refine, const Container &coarsen, const Estimators &estimators, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen. More... | |
template<typename Container , typename Estimators > | |
FEMesh< DIM >::Modifications | Adapt (const Container &refine, const Container &coarsen, const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen. More... | |
template<typename Container , typename Estimators , typename DiscreteFuncs > | |
FEMesh< DIM >::Modifications | Adapt (const Container &refine, const Container &coarsen, const Estimators &estimators, const DiscreteFuncs &funcs, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen. More... | |
template<typename Func , typename Estimators , typename = std::enable_if_t<std::is_same_v<decltype(std::declval<Func>()(std::declval<std::size_t>())), AdaptationType>> | |
FEMesh< DIM >::Modifications | Adapt (Func flagFunction, const Estimators &estimators, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine. More... | |
template<typename Func , typename Estimators , typename = std::enable_if_t<std::is_same_v<decltype(std::declval<Func>()(std::declval<std::size_t>())), AdaptationType>> | |
FEMesh< DIM >::Modifications | Adapt (Func flagFunction, const Estimators &estimators, const DiscreteFunction< DIM, X, N, N > &func, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine. More... | |
template<typename Func , typename Estimators , typename DiscreteFuncs , typename = std::enable_if_t<std::is_same_v<decltype(std::declval<Func>()(std::declval<std::size_t>())), AdaptationType>> | |
FEMesh< DIM >::Modifications | Adapt (Func flagFunction, const Estimators &estimators, const DiscreteFuncs &funcs, MeshSmoother smoother=MeshSmoother{}) |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine. More... | |
Protected Member Functions | |
virtual bool | ShouldPolydegAdapt (const HPRefinementData< DIM, X, N > &data, std::size_t element, bool refine)=0 |
Method called by the adaptation routines to decide if \(p\)-refinement should be performed for an element. More... | |
virtual void | PostProcessSpaceRefine ([[maybe_unused]] const HPRefinementData< DIM, X, N > &data, [[maybe_unused]] const std::vector< AdaptationType > &pRefinements) |
Method called by the adaptation routines after \(p\)-refinement, but before \(h\)-refinement. More... | |
virtual void | PostProcessMeshRefine ([[maybe_unused]] const HPRefinementData< DIM, X, N > &data, [[maybe_unused]] const typename FEMesh< DIM >::Modifications &changes, [[maybe_unused]] const std::vector< AdaptationType > &pRefinements) |
Method called by the adaptation routines after both \(h\)-refinement and \(p\)-refinement. More... | |
Base type for refinement strategies for \(hp\)-adaptive refinement.
An implementation of a \(hp\)-adaptive refinement strategy should derive from this function and override the virtual methods.
DIM | The dimension of the mesh and spaces to refine |
X | The type of the result of the functions (double, std::complex, etc) for each space |
N | The size of the resulting vector space (N=1 for scalars) for each space |
|
inline |
Creates the base type for a \(hp\)-refinement strategy.
space | The function space to refine (containing the mesh to refine) |
minP | Minimum polynomial degree. Coarsen will not occur if the polynomial degree of ANY component will fall below this minimum (default = 1) |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform.
A container of flags can be one of the following:
Container | Container type containing AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
flags | Container of AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
funcs | List of functions defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform.
A container of flags can be one of the following:
Container | Container type containing AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
flags | Container of AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
func | Function defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and using a container of flags indicating the refinement to perform.
A container of flags can be one of the following:
Container | Container type containing AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
flags | Container of AdaptationType or std::size_t, or map from std::size_t to AdaptationType |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen.
Container | Container type for refinement and coarsen flags |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
refine | Container of indices of elements to refine |
coarsen | Container of indices of elements to coarsen |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
funcs | List of functions defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen.
Container | Container type for refinement and coarsen flags |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
refine | Container of indices of elements to refine |
coarsen | Container of indices of elements to coarsen |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
func | Function defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a set of elements to refine and coarsen.
Container | Container type for refinement and coarsen flags |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
refine | Container of indices of elements to refine |
coarsen | Container of indices of elements to coarsen |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine.
Func | A function type which takes a std::size_t, and returns an AdaptionType; e.g., of form AdaptionType operator()(std::size_t idx) . |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
flagFunction | Function which takes an element index in range [0, Mesh()->ElementCount()), and returns an AdaptionType flag value indicating if the element should be refined, coarsened, or left 'as-is' |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
funcs | List of functions defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine.
Func | A function type which takes a std::size_t, and returns an AdaptionType; e.g., of form AdaptionType operator()(std::size_t idx) . |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
flagFunction | Function which takes an element index in range [0, Mesh()->ElementCount()), and returns an AdaptionType flag value indicating if the element should be refined, coarsened, or left 'as-is' |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
func | Function defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a function for deciding which elements to refine.
Func | A function type which takes a std::size_t, and returns an AdaptionType; e.g., of form AdaptionType operator()(std::size_t idx) . |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
flagFunction | Function which takes an element index in range [0, Mesh()->ElementCount()), and returns an AdaptionType flag value indicating if the element should be refined, coarsened, or left 'as-is' |
estimators | Error indicators for each element in mesh, necessary for checking convergence against expected |
smoother | Specifies options for smoothing the mesh during refinemnt. Default options are as for a default constructed MeshSmoother object |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor, with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
funcs | List of functions defined on the space to use for the refinement strategy |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space with mesh smoothing options for conforming meshes (i.e., MeshSmoother::Conforming()).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
func | Function defined on the space to use for the refinement strategy |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space and with the specified mesh smoothing options.
Convenience method for call to
std::out_of_range | May be thrown if length of the esitmators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
funcs | List of functions defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space and with the specified mesh smoothing options.
Convenience method for call to
std::out_of_range | May be thrown if length of the esitmators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
func | Function defined on the space to use for the refinement strategy |
smoother | Specifies options for smoothing the mesh during refinemnt. |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor and with the specified mesh smoothing options.
Convenience method for call to
std::out_of_range | May be thrown if length of the esitmators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
smoother | Specifies options for smoothing the mesh during refinemnt. |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor, and with default mesh smoothing options (default constructed MeshSmoother).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified functions defined on the space, and with default mesh smoothing options (default constructed MeshSmoother).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
DiscreteFuncs | Type of the list of functions, must be random access container. |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
funcs | List of functions defined on the space to use for the refinement strategy |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inline |
Perform \(hp\)-adaptive refinement on the contained space and mesh using a marking strategy functor object which takes error indicators as the first argument to the constructor with the specified function defined on the space, and with default mesh smoothing options (default constructed MeshSmoother).
Convenience method for call to
std::out_of_range | May be thrown if length of the estimators is not number of elements in mesh |
MarkingStrategy | The type of the marking strategy to use. The constructor of this type must take the error indicators as the first argument Must be explicitly specified |
Estimators | Type of the list of error indicators, must be random access container of the same length as the number of elements on the mesh |
Args | Type of extra arguments to pass to the MarkingStrategy constructor |
estimators | Error indicators for each element in mesh, passed to first argument of MarkingStrategy constructor. |
func | Function defined on the space to use for the refinement strategy |
args | Extra arguments to pass to the MarkingStrategy constructor |
|
inlineprotectedvirtual |
Method called by the adaptation routines after both \(h\)-refinement and \(p\)-refinement.
Can be used to for any post-processing.
data | Error indicators and functions defined on the mesh |
changes | Modifications performed to the mesh ( \(h\)-refinements) |
pRefinements | Vector, with one entry per element, denoting the type of \(p\)-adaptation performed (refinement, coarsening, or none) |
|
inlineprotectedvirtual |
Method called by the adaptation routines after \(p\)-refinement, but before \(h\)-refinement.
Can be used to for any post-processing.
data | Error indicators and functions defined on the mesh |
pRefinements | Vector, with one entry per element, denoting the type of \(p\)-adaptation performed (refinement, coarsening, or none) |
|
protectedpure virtual |
Method called by the adaptation routines to decide if \(p\)-refinement should be performed for an element.
data | Error indicators and functions defiend on the mesh |
element | Index of the element |
refine | true if performing refinement of element, false if performing coarsening |
|
inline |
Gets the finite element space the refinement strategy is on.