|
virtual void | ComputeStronglyImposedDoFs ([[maybe_unused]] std::unordered_map< std::size_t, X > &dofs, [[maybe_unused]] std::size_t offset) const |
| Computes the set of global DoFs with strongly imposed Dirichlet boundary conditions. More...
|
|
virtual void | ComputeGlobalDoFOffset (std::size_t *dofOffset, std::size_t offset) const =0 |
| Computes the offset onto the global degrees of freedom for each component. More...
|
|
virtual std::size_t * | ComputeDoFMapping (std::size_t *dofMapping, std::size_t elementIdx, std::size_t offset) const =0 |
| Computes the mapping between local dof numbers for an element and the global dof numbers. More...
|
|
virtual X * | ComputeBasisFunctions (X *basis, std::size_t elementIdx, const Vector< DIM > &pt)=0 |
| Computes the basis functions for each component at the specified point of the specified element. More...
|
|
virtual FuncAndGradData< DIM, X > * | ComputeGradBasisFunctions (FuncAndGradData< DIM, X > *basis, std::size_t elementIdx, const Vector< DIM > &pt)=0 |
| Computes the basis functions and first order derivatives for each component at the specified point of the specified element. More...
|
|
virtual FuncAndGradData< DIM, X > * | ComputeGradValueBasisFunctions (FuncAndGradData< DIM, X > *basis, std::size_t elementIdx, const Vector< DIM > &pt) |
| Computes the basis functions and first order derivatives of those basis functions for each component at the specified point of the specified element. More...
|
|
virtual FuncGradAndHessianData< DIM, X > * | ComputeHessianBasisFunctions ([[maybe_unused]] FuncGradAndHessianData< DIM, X > *basis, [[maybe_unused]] std::size_t elementIdx, [[maybe_unused]] const Vector< DIM > &pt) |
| Computes the basis functions, first order derivatives, and second order derivatives for each component at the specified point of the specified element. More...
|
|
virtual std::vector< X > * | ComputeDoFAtBasis (std::vector< X > *dofs, [[maybe_unused]] std::size_t elementIdx) |
| Computes the basis functions of the space evaluated by the functional for each degree of freedom. More...
|
|
virtual std::vector< X > * | ComputeDoFAtBasisProjection (std::vector< X > *dofs, std::size_t elementIdx) |
| Computes the value projection of the basis functions of the space evaluated by the functional for each degree of freedom. More...
|
|
virtual Vector< DIM > * | ComputeLocalAnalyticityEstimate (Vector< DIM > *analyticity, [[maybe_unused]] std::size_t elementIdx, [[maybe_unused]] const X *dofs) |
| Computes the local analyticity estimate of the element using Legendre coefficients. More...
|
|
virtual std::size_t | CodomainDimensionSize () const =0 |
| Gets ths size of the codomain of the fuctions in the space. More...
|
|
virtual std::size_t * | FillPolynomialDegree (std::size_t element, std::size_t *nextPolydeg) const =0 |
| Populates an array with polynomial degree for each component of the result for the specified element. More...
|
|
virtual void | SetPolynomialDegree ([[maybe_unused]] const std::map< std::size_t, const std::size_t * > &elementPolydegs, const DoFChangeList< X > &dofs) |
| Set the polynomial degree of the specified elements and update the DoFs of the specified functions. More...
|
|
virtual void | SetPolynomialDegree ([[maybe_unused]] const std::size_t *polydeg, const DoFChangeList< X > &dofs) |
| Set the polynomial degree of the all elements and update the DoFs of the specified functions. More...
|
|
virtual void | ComputeNumberLocalDoFs (std::size_t elementIdx, std::size_t *numberDofs) const =0 |
| Gets the number of degrees of freedom for an element in the space per component. More...
|
|
virtual std::vector< X >::iterator | Interpolate (typename std::vector< X >::iterator dofsBegin, typename std::vector< X >::iterator dofsEnd, const X *value) const =0 |
| Fill the degrees of freedom for this space by interpolating the specified constant function. More...
|
|
virtual void | OnMeshChanged (const PFEMesh< DIM > &previousMesh, const typename FEMesh< DIM >::Modifications &changes, const DoFChangeList< X > &dofs)=0 |
| Event notification from mesh that the mesh has been changed. More...
|
|
template<std::size_t DIM, typename X>
class ptems::DiscreteFunctionSpaceInterface< DIM, X >
An interface declaration for DiscreteFunctionSpace which removes the size of the Codomain.
- Template Parameters
-
DIM | The dimension of the domain (and mesh) |
X | The type of the result of the functions (double, std::complex, etc) |
template<std::size_t DIM, typename X >
Computes the basis functions for each component at the specified point of the specified element.
The point is the local point defined on the reference element (for elements with a single reference element) or the bounding box (for elements with multiple reference elements).
The passed pointer is a continuous array of all the basis functions for the first component, followed by all the basis functions for the second etc. The number of basis functions MUST be the same as ComputeNumberLocalDoFs calculates
- Warning
- Subclasses MUST add the number of basis given by ComputeNumberLocalDoFs for each component and return basis plus the sum of the number of basis functions of all components as computed by ComputeNumberLocalDoFs. Failure to do this is undefined behaviour (and could lead to segfaults)
- Note
- For virtual element the returned values are the value projections of the basis functions
- Parameters
-
basis | Pointer to the first basis function to compute. This pointer can be treated as if it is an array containing the number of DoFs for the first component as computed by ComputeNumberLocalDoFs(), followed by the number of DoFs for the second component as computed by ComputeNumberLocalDoFs(), etc. |
elementIdx | The element index to get the basis functions for |
pt | The local point in the reference element or bounding box to get the basis functions for |
- Returns
- Pointer to past the end of the array of basis functions computed. Must be equal to
basis+x
, where x
is the sum of the array entries computed by ComputeNumberLocalDoFs
Implemented in ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Computes the mapping between local dof numbers for an element and the global dof numbers.
The passed pointer is a continuous array of all the dofs for the first component, followed by all the dofs for the second etc. The number of dofs MUST be the same as ComputeNumberLocalDoFs calculates
- Note
- Implementations of this function can cache this value for performance IF the number only changes when the mesh changes. The implementation must then invalidate the cached value when OnMeshChanged is called.
- Exceptions
-
std::logic_error | If the underlying mesh is invalid for the type of space; e.g., nonconforming mesh for a conforming space. |
std::out_of_range | if elementIdx is not less than the number of elements in the underlying mesh |
- Parameters
-
dofMapping | Pointer to the first global dof index to compute. This pointer can be treated as if it is an array containing the number of DoFs for the first component as computed by ComputeNumberLocalDoFs(), followed by the number of DoFs for the second component as computed by ComputeNumberLocalDoFs(), etc. |
elementIdx | Index of the element to get the local to global mapping of the degrees of freedom for |
offset | Offset to add to the global DoF numbers |
- Returns
- Pointer to past the end of the array of global dof indices computed. Must be equal to
dofMapping+x
, where x
is the sum of the array entries computed by ComputeNumberLocalDoFs
Implemented in ptems::VirtualElementSpace< HBasis, 2, X, N >, ptems::PiecewiseConstant< DIM, X, N >, ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, ptems::DiscontinuousSpace< LegendrePolynomials< DIM >, DIM, double, 1 >, ptems::DiscontinuousSpace< LagrangePolynomials< DIM >, DIM, double, 1 >, ptems::ContinuousLagrangeSpace< 2, X, N >, ptems::ContinuousLagrangeSpace< 1, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Computes the offset onto the global degrees of freedom for each component.
- Note
- Implementations of this function can cache this value for performance IF the number only changes when the mesh changes. The implementation must then invalidate the cached value when OnMeshChanged is called.
- Exceptions
-
std::logic_error | If the underlying mesh is invalid for the type of space; e.g., nonconforming mesh for a conforming space. |
- Parameters
-
dofOffset | Pointer to array of length of number of components + 1 to store the the offset into the global DoFs for the DoFs for each component (first N entries) and the total number of globals DoFs (last entry) |
offset | Offset to add to the global DoF numbers |
Implemented in ptems::VirtualElementSpace< HBasis, 2, X, N >, ptems::PiecewiseConstant< DIM, X, N >, ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, ptems::DiscontinuousSpace< LegendrePolynomials< DIM >, DIM, double, 1 >, ptems::DiscontinuousSpace< LagrangePolynomials< DIM >, DIM, double, 1 >, ptems::ContinuousLagrangeSpace< 2, X, N >, ptems::ContinuousLagrangeSpace< 1, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Computes the basis functions and first order derivatives for each component at the specified point of the specified element.
The point is the local point defined on the reference element (for elements with a single reference element) or the bounding box (for elements with multiple reference elements).
The passed pointer is a continuous array of all the basis functions for the first component, followed by all the basis functions for the second etc. The number of basis functions MUST be the same as ComputeNumberLocalDoFs calculates
- Note
- For virtual element the returned values are the value and gradient projections of the basis functions
- Warning
- Subclasses MUST add the number of basis given by ComputeNumberLocalDoFs for each component and return basis plus the sum of the number of basis functions of all components as computed by ComputeNumberLocalDoFs. Failure to do this is undefined behaviour (and could lead to segfaults)
- Parameters
-
basis | Pointer to the first basis function to compute. This pointer can be treated as if it is an array containing the number of DoFs for the first component as computed by ComputeNumberLocalDoFs(), followed by the number of DoFs for the second component as computed by ComputeNumberLocalDoFs(), etc. |
elementIdx | The element index to get the basis functions for |
pt | The local point in the reference element or bounding box to get the basis functions for |
- Returns
- Pointer to past the end of the array of basis functions computed. Must be equal to
basis+x
, where x
is the sum of the array entries computed by ComputeNumberLocalDoFs
Implemented in ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Computes the basis functions and first order derivatives of those basis functions for each component at the specified point of the specified element.
The point is the local point defined on the reference element (for elements with a single reference element) or the bounding box (for elements with multiple reference elements).
The passed pointer is a continuous array of all the basis functions for the first component, followed by all the basis functions for the second etc. The number of basis functions MUST be the same as ComputeNumberLocalDoFs calculates
- Note
- Only relevant for virtual element spaces - the returned values are the value and gradient of the value projection of the basis functions; for other methods this returns the same as ComputeGradBasisFunctions
- Warning
- Subclasses MUST add the number of basis given by ComputeNumberLocalDoFs for each component and return basis plus the sum of the number of basis functions of all components as computed by ComputeNumberLocalDoFs. Failure to do this is undefined behaviour (and could lead to segfaults)
- Parameters
-
basis | Pointer to the first basis function to compute. This pointer can be treated as if it is an array containing the number of DoFs for the first component as computed by ComputeNumberLocalDoFs(), followed by the number of DoFs for the second component as computed by ComputeNumberLocalDoFs(), etc. |
elementIdx | The element index to get the basis functions for |
pt | The local point in the reference element or bounding box to get the basis functions for |
- Returns
- Pointer to past the end of the array of basis functions computed. Must be equal to
basis+x
, where x
is the sum of the array entries computed by ComputeNumberLocalDoFs
template<std::size_t DIM, typename X >
Computes the basis functions, first order derivatives, and second order derivatives for each component at the specified point of the specified element.
The point is the local point defined on the reference element (for elements with a single reference element), or the bounding box (for elements with multiple reference elements).
The passed pointer is a continuous array of all the basis functions for the first component, followed by all the basis functions for the second etc. The number of basis functions MUST be the same as ComputeNumberLocalDoFs calculates
- Warning
- Subclasses MUST add the number of basis given by ComputeNumberLocalDoFs for each component and return basis plus the sum of the number of basis functions of all components as computed by ComputeNumberLocalDoFs. Failure to do this is undefined behaviour (and could lead to segfaults)
- Exceptions
-
- Parameters
-
basis | Pointer to the first basis function to compute. This pointer can be treated as if it is an array containing the number of DoFs for the first component as computed by ComputeNumberLocalDoFs(), followed by the number of DoFs for the second component as computed by ComputeNumberLocalDoFs(), etc. |
elementIdx | The element index to get the basis functions for |
pt | The local point in the reference element or bounding box to get the basis functions for |
- Returns
- Pointer to past the end of the array of basis functions computed. Must be equal to
basis+x
, where x
is the sum of the array entries computed by ComputeNumberLocalDoFs
template<std::size_t DIM, typename X >
Gets the number of degrees of freedom for an element in the space per component.
- Note
- Implementations of this function can cache this value for performance IF the number only changes when the mesh changes. The implementation must then invalidate the cached value when OnMeshChanged is called.
- Exceptions
-
std::logic_error | If the underlying mesh is invalid for the type of space; e.g., nonconforming mesh for a conforming space. |
std::out_of_range | if elementIdx is not less than the number of elements in the underlying mesh |
- Parameters
-
elementIdx | Index of the element to get the number of local degrees of freedom for |
numberDofs | Pointer to array of length of number of components to store the local number of degrees of freedom for the specified element per component |
Implemented in ptems::PiecewiseConstant< DIM, X, N >, ptems::VirtualElementSpace< HBasis, 2, X, N >, ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, ptems::DiscontinuousSpace< LegendrePolynomials< DIM >, DIM, double, 1 >, ptems::DiscontinuousSpace< LagrangePolynomials< DIM >, DIM, double, 1 >, ptems::ContinuousLagrangeSpace< 2, X, N >, ptems::ContinuousLagrangeSpace< 1, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Fill the degrees of freedom for this space by interpolating the specified constant function.
- Exceptions
-
std::logic_error | If dofsEnd-dofsBegin is less than the number of degrees of freedom to be populated |
- Warning
- Note that
dofsEnd-dofsBegin
may be larger than the number of degrees of freedom in the space. Implementations of this function MUST ONLY populate the same number degrees of degrees of freedom as NumberGlobalDoFs() and return the iterator to dofsBegin+NumberGlobalDoFs()
- Parameters
-
dofsBegin | Iterator pointing to the start of the degrees of freedom to fill |
dofsEnd | Iterator pointing to the end of the degrees of freedom to fill |
value | Pointer to array containing the constants for each component |
- Returns
- Iterator pointing to past the last degree of freedom populated by the interpolation. Must be
dofsBegin+NumberGlobalDoFs()
.
Implemented in ptems::VirtualElementSpace< HBasis, 2, X, N >, ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, ptems::ContinuousLagrangeSpace< 2, X, N >, ptems::ContinuousLagrangeSpace< 1, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.
template<std::size_t DIM, typename X >
Gets the global number of degrees of freedom for the space.
- Note
- Implementations of this function can cache this value for performance IF the number only changes when the mesh changes. The implementation must then invalidate the cached value when OnMeshChanged is called.
- Exceptions
-
std::logic_error | If the underlying mesh is invalid for the type of space; e.g., nonconforming mesh for a conforming space. |
- Returns
- Global number of degrees of freedom
Implemented in ptems::VirtualElementSpace< HBasis, 2, X, N >, ptems::PiecewiseConstant< DIM, X, N >, ptems::DiscontinuousSpace< Polynomials, DIM, X, N >, ptems::DiscontinuousSpace< LegendrePolynomials< DIM >, DIM, double, 1 >, ptems::DiscontinuousSpace< LagrangePolynomials< DIM >, DIM, double, 1 >, ptems::ContinuousLagrangeSpace< 2, X, N >, ptems::ContinuousLagrangeSpace< 1, X, N >, and ptems::DiscreteCartesianProductSpace< DIM, X, N >.