SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::discretization::blocks Namespace Reference

Namespaces

namespace  detail
 
namespace  keys
 

Classes

struct  barotropic_constant
 This field holds the effective potential level on the stellar isobar. The level is solved together with the fixed total mass. The barotropic_constant name is retained as an internal coordinate identity. In the density formulation its value is Us, the gravitational potential minus the centrifugal potential on the surface; it is not the polytropic EOS constant K. More...
 
struct  block
 Base class for all block types in the discretization framework. More...
 
class  BlockVectorView
 Build a non-owning view of a packed layout as a span. More...
 
struct  density
 The density field used to represent the distribution of mass in the system. This is a scalar field that is associated with the mass density of the system. The density field is used to enforce the mass conservation condition in the weak form. More...
 
struct  displacement
 The displacement field is a 3 vector H1 field (C0 continuous) that is used to represent continuous nodal displacement over the entire domain. More...
 
struct  field
 The field struct is a tag type that is used to identify a field in the discretization. It is used to group together terms that belong to the same field. Each field should have a unique name and a list of terms that belong to it. More...
 
struct  FieldDescriptor
 Runtime descriptor for a field, containing its name. Two FieldDescriptors are equal if they have identical names. More...
 
struct  frame_acceleration
 Uniform translation reaction, one global scalar per Cartesian axis, to be paired with BarycenterConstraint (for example when an external companion potential acts on the star). It must vanish in a physical equilibrium. More...
 
struct  global_scalar
 A global scalar is a term that has a single value over the entire domain (think angular momentum or total mass). Broadly we need to separate these from the other terms since they require different (often less enriched) information at compile time. More...
 
struct  gravity
 The gravity field contains the scalar potential. The primal formulation solves the potential and obtains its gradient by differentiation. More...
 
struct  residual_block
 Final class for residual blocks with a fixed index, derived from residual_block_base. More...
 
struct  residual_block_base
 Base class for residual blocks, derived from block. More...
 
struct  rotation
 The rotational field, represented as the angular velocity term, given that we currently only model rigid rotation this is a global scalar. A future extension which models differential rotation will likely need to modify this to some vector field or other more complex representation of the rotation. More...
 
struct  SpatialTermTraits
 Helper struct representing the traits of some spatial term type, including its functional space, support, family, order, and rank. More...
 
struct  surface_deformation
 The surface corollary field to the full displacement field. This is in some ways more general than the others in so far as it is not pointwise defined over the domain. Rather, it is some general field of numbers, divorced from the underlying discrimination, that is used to represent the surface deformation of the system. This may be used, for example to represent spherical harmonic coefficients of the surface deformation. For more information see the surface and deformation systems. More...
 
struct  SystemLayout
 Describe the independently ordered physical state and residual coordinates of a discrete system. More...
 
struct  term
 The term struct is a tag type that is used to identify a term in the discretization. It is used to group together terms that belong to the same field. Each term should have a unique name and a list of blocks that belong to it. Note that generally you should always use term rather than term_base as term associates to a particular field at compile time. More...
 
struct  term_base
 The term_base struct is a tag type that is used to identify a term in the discretization. It is used to group together terms that belong to the same field. Each term should have a unique name and a list of blocks that belong to it. Generally you should always use term rather than term_base as term associates to a particular field at compile time. More...
 
struct  TermDescriptor
 Runtime descriptor for a term, containing its associated field and name. Two TermDescriptors are equal if they have identical fields and names. More...
 
struct  value_block
 Final class for value blocks with a fixed index, derived from value_block_base. More...
 
struct  value_block_base
 Base class for value blocks, derived from block. More...
 

Concepts

concept  Field
 Concept for field types in the discretization framework. To be a field a type must derive from the field base class.
 
concept  Term
 Concept for term types in the discretization framework. To be a term a type must derive from term_base, must have a field_type member, and that field_type member must be a valid field.
 
concept  HasFunctionalSpace
 Concept for term types that have a functional space. To have a functional space a type must first be a valid Term and must have a FunctionalSpace member type.
 
concept  HasSupport
 Concept for term types that have a domain over which they are supported. To have support a type must first be a valid Term and must have a Support member type.
 
concept  HasQuantity
 Concept for term types that have a physical quantity associated with them. To have a quantity a type must first be a valid Term and must have a Quantity member type.
 
concept  HasValueBlock
 Concept for term types that have a value block associated with them. To have a value block a type must first be a valid Term and must have a value member type.
 
concept  HasResidualBlock
 Concept for term types that have a residual block associated with them. To have a residual block a type must first be a valid Term and must have a residual member type.
 
concept  SpatialTerm
 Concept for term types that are spatial terms. A spatial term is a term that has a functional space (HasFunctionalSpace) and a support (HasSupport).
 
concept  GlobalScalarTerm
 Concept for term types that are global scalar terms. A global scalar term is a term that has support (HasSupport) but does not have a functional space (HasFunctionalSpace) and is derived from the global_scalar class.
 
concept  SystemLayoutType
 Compile time check for a SystemLayout type, e.g. SystemLayout<Values, Residuals>.
 
concept  ScalarTraceTerm
 A unique scalar boundary value is available for continuous scalar fields and scalar globals.
 

Typedefs

template<HasFunctionalSpace TermT>
using FunctionalSpaceOf = std::remove_cvref_t<TermT>::FunctionalSpace
 Extract the functional space type associated with a given term type. Will have a type of whatever TermT::FunctionalSpace is.
 
template<HasSupport TermT>
using SupportOf = std::remove_cvref_t<TermT>::Support
 Extract the support type associated with a given term type. Will have a type of whatever TermT::Support is.
 
template<HasQuantity TermT>
using QuantityOf = std::remove_cvref_t<TermT>::Quantity
 Extract the quantity type associated with a given term type. Will have a type of whatever TermT::Quantity is.
 
template<SystemLayoutType Layout, typename Scalar = double>
using StateView = BlockVectorView<RepresentedValueKind::value, Layout, Scalar>
 A convenient alias for a view of the physical state coefficients.
 
template<SystemLayoutType Layout, typename Scalar = double>
using ResidualView = BlockVectorView<RepresentedValueKind::residual, Layout, Scalar>
 A convenient alias for a view of the residual coefficients.
 

Enumerations

enum class  RepresentedValueKind { value , residual }
 Enum representing the kind of value a block represents, either a physical quantity (value) or a residual (residual). More...
 

Functions

std::size_t checked_block_size (std::span< const std::size_t > sizes)
 Sum some memory span with checking for if any element is too large to fit in a size_t.
 
template<SystemLayoutType Layout, typename SizeResolver>
constexpr std::remove_cvref_t< Layout > make_system_layout (const SizeResolver &size)
 Build both coordinate orderings from the same physical size resolver.
 

Variables

constexpr int DYNAMIC_BLOCK_SIZE = -1
 
template<Field FieldT>
constexpr FieldDescriptor field_descriptor {.name = FieldT::name}
 Create a FieldDescriptor for a given field type.
 
template<Term TermT>
constexpr TermDescriptor term_descriptor
 Create a TermDescriptor for a given term type.
 

Typedef Documentation

◆ FunctionalSpaceOf

template<HasFunctionalSpace TermT>
using serif::discretization::blocks::FunctionalSpaceOf = std::remove_cvref_t<TermT>::FunctionalSpace

Extract the functional space type associated with a given term type. Will have a type of whatever TermT::FunctionalSpace is.

Template Parameters
TermTThe term type from which to extract the functional space type.
Todo
For consistency with other types consider renaming TermT::FunctionalSpace to TermT::functional_space. This would require updating all term definitions to use the new naming convention. CLion or some other IDE should be able to handle this refactor easily.

◆ QuantityOf

template<HasQuantity TermT>
using serif::discretization::blocks::QuantityOf = std::remove_cvref_t<TermT>::Quantity

Extract the quantity type associated with a given term type. Will have a type of whatever TermT::Quantity is.

Template Parameters
TermTThe term type from which to extract the quantity type.
Todo
For consistency with other types consider renaming TermT::Quantity to TermT::quantity. This would require updating all term definitions to use the new naming convention. CLion or some other IDE should be able to handle this refactor easily.

◆ ResidualView

template<SystemLayoutType Layout, typename Scalar = double>
using serif::discretization::blocks::ResidualView = BlockVectorView<RepresentedValueKind::residual, Layout, Scalar>

A convenient alias for a view of the residual coefficients.

Template Parameters
LayoutThe block layout type, e.g. SystemLayout.
ScalarThe scalar type of the coefficients, e.g. double.

◆ StateView

template<SystemLayoutType Layout, typename Scalar = double>
using serif::discretization::blocks::StateView = BlockVectorView<RepresentedValueKind::value, Layout, Scalar>

A convenient alias for a view of the physical state coefficients.

Template Parameters
LayoutThe block layout type, e.g. SystemLayout.
ScalarThe scalar type of the coefficients, e.g. double.

◆ SupportOf

template<HasSupport TermT>
using serif::discretization::blocks::SupportOf = std::remove_cvref_t<TermT>::Support

Extract the support type associated with a given term type. Will have a type of whatever TermT::Support is.

Template Parameters
TermTThe term type from which to extract the support type.
Todo
For consistency with other types consider renaming TermT::Support to TermT::support. This would require updating all term definitions to use the new naming convention. CLion or some other IDE should be able to handle this refactor easily.

Enumeration Type Documentation

◆ RepresentedValueKind

Enum representing the kind of value a block represents, either a physical quantity (value) or a residual (residual).

Generally this is mostly used in the solver/normalization system.

Enumerator
value 

A value representing a physical quantity (e.g., temperature, pressure).

residual 

A residual representing the difference between the current state and the desired state in a numerical method.

Function Documentation

◆ checked_block_size()

std::size_t serif::discretization::blocks::checked_block_size ( std::span< const std::size_t > sizes)
nodiscard

Sum some memory span with checking for if any element is too large to fit in a size_t.

Parameters
sizesA span of sizes to sum
Returns
The sum of the sizes
Exceptions
std::overflow_errorIf an element of sizes is too large to fit in a size_t
Todo
Really this does not need to be specific to this module, this might more generally be named something like "safe sum" and moved to a more general location.

◆ make_system_layout()

template<SystemLayoutType Layout, typename SizeResolver>
std::remove_cvref_t< Layout > serif::discretization::blocks::make_system_layout ( const SizeResolver & size)
nodiscardconstexpr

Build both coordinate orderings from the same physical size resolver.

Parameters
sizeA callable whose templated operator()<Coordinate>() returns that coordinate's coefficient count.

Variable Documentation

◆ DYNAMIC_BLOCK_SIZE

int serif::discretization::blocks::DYNAMIC_BLOCK_SIZE = -1
inlineconstexpr

◆ field_descriptor

template<Field FieldT>
FieldDescriptor serif::discretization::blocks::field_descriptor {.name = FieldT::name}
inlineconstexpr

Create a FieldDescriptor for a given field type.

Template Parameters
FieldTThe field type for which to create the descriptor.

◆ term_descriptor

template<Term TermT>
TermDescriptor serif::discretization::blocks::term_descriptor
inlineconstexpr
Initial value:
{
.name = TermT::name
}
constexpr FieldDescriptor field_descriptor
Create a FieldDescriptor for a given field type.
Definition runtime.hpp:53

Create a TermDescriptor for a given term type.

Template Parameters
TermTThe term type for which to create the descriptor.