NeoN
A framework for CFD software
Loading...
Searching...
No Matches
Namespaces | Classes | Concepts | Functions
NeoN::dsl Namespace Reference

Namespaces

namespace  detail
 
namespace  exp
 
namespace  imp
 
namespace  temporal
 

Classes

class  Coeff
 A class that represents a coefficient for the NeoN dsl. More...
 
class  DivLapOptimizer
 Fuses separate implicit divergence and Laplacian operators into a single GaussGreenDivLaplacian kernel. More...
 
class  Expression
 
class  FixedValueConstraints
 Post-assembly functor that pins a set of cells to prescribed values. More...
 
class  Operator
 
class  OperatorMixin
 
class  Optimizer
 Abstract base for DSL expression optimizers. More...
 
struct  PostAssemblyBase
 
class  SetReference
 Post-assembly functor that pins one cell's value to a reference, removing the constant null space that arises when all boundaries have Neumann (zero-gradient) conditions on operators such as laplacian or div+laplacian. More...
 
class  SpatialOperator
 
class  TemporalOperator
 

Concepts

concept  HasExplicitOperator
 
concept  HasImplicitOperator
 
concept  HasImplicitOperatorScalarMtx
 
concept  IsSpatialOperator
 
concept  HasTemporalExplicitOperator
 
concept  HasTemporalImplicitOperator
 
concept  HasTemporalImplicitOperatorScalarMtx
 
concept  HasTemporalOperator
 

Functions

Coeff operator* (const Coeff &lhs, const Coeff &rhs)
 
template<typename ValueType >
Expression< ValueType > operator+ (Expression< ValueType > lhs, const Expression< ValueType > &rhs)
 
template<typename ValueType >
Expression< ValueType > operator+ (Expression< ValueType > lhs, const SpatialOperator< ValueType > &rhs)
 
template<typename leftOperator , typename rightOperator >
Expression< typename leftOperator::VectorValueType > operator+ (leftOperator lhs, rightOperator rhs)
 
template<typename ValueType >
Expression< ValueType > operator* (scalar scale, const Expression< ValueType > &es)
 
template<typename ValueType >
Expression< ValueType > operator- (Expression< ValueType > lhs, const Expression< ValueType > &rhs)
 
template<typename ValueType >
Expression< ValueType > operator- (Expression< ValueType > lhs, const SpatialOperator< ValueType > &rhs)
 
template<typename leftOperator , typename rightOperator >
Expression< typename leftOperator::VectorValueType > operator- (leftOperator lhs, rightOperator rhs)
 
template<typename ExpressionType >
ExpressionType optimize (const ExpressionType &in)
 Apply the default optimizer pipeline to an expression.
 
template<typename ExpressionType >
ExpressionType optimize (const ExpressionType &in, const std::vector< std::shared_ptr< Optimizer< ExpressionType > > > &opts)
 Apply a caller-supplied optimizer pipeline to an expression.
 
template<typename VectorType , typename IndexType >
std::optional< la::SolverStatssolve (Expression< typename VectorType::ElementType, IndexType > &exp, VectorType &solution, scalar t, scalar dt, const Dictionary &fvSchemes, const Dictionary &fvSolution, std::vector< const PostAssemblyBase< typename VectorType::ElementType, IndexType > * > p={})
 
KOKKOS_INLINE_FUNCTION scalar copySign (const scalar mag, const scalar s)
 Returns |mag| carrying the sign of s (scalar overload).
 
KOKKOS_INLINE_FUNCTION scalar componentCopySign (const scalar mag, const scalar s)
 Componentwise sign-copy (scalar overload).
 
KOKKOS_INLINE_FUNCTION Vec3 componentCopySign (const Vec3 &mag, const Vec3 &s)
 Componentwise sign-copy (Vec3 overload — all 3 components).
 
KOKKOS_INLINE_FUNCTION scalar componentMag (const scalar value)
 Componentwise magnitude (scalar overload).
 
KOKKOS_INLINE_FUNCTION Vec3 componentMag (const Vec3 &value)
 Componentwise magnitude (Vec3 overload — keeps all 3 components, does NOT collapse to the L2 norm that the global mag(Vec3) returns).
 
KOKKOS_INLINE_FUNCTION scalar componentMax (const scalar lhs, const scalar rhs)
 Componentwise max (scalar overload).
 
KOKKOS_INLINE_FUNCTION Vec3 componentMax (const Vec3 &lhs, const Vec3 &rhs)
 Componentwise max (Vec3 overload — per component).
 
template<typename VectorType , typename MatrixValueType , typename RHSValueType , typename SystemMatrixType , typename BoundaryMatrixType >
void applyMatrixRelaxation (la::LinearSystem< MatrixValueType, RHSValueType, SystemMatrixType, BoundaryMatrixType > &ls, const VectorType &solution, scalar alpha)
 
template<typename VectorType >
void applyFieldRelaxation (VectorType &solution, const Vector< typename VectorType::ElementType > &previous, scalar alpha)
 
template<typename VectorType >
auto fieldRelaxationSnapshot (const VectorType &field)
 
template<typename ValueType >
SpatialOperator< ValueType > operator* (scalar scalarCoeff, SpatialOperator< ValueType > rhs)
 
template<typename ValueType >
SpatialOperator< ValueType > operator* (const Vector< scalar > &coeffVector, SpatialOperator< ValueType > rhs)
 
template<typename ValueType >
SpatialOperator< ValueType > operator* (const Coeff &coeff, SpatialOperator< ValueType > rhs)
 
template<typename ValueType >
TemporalOperator< ValueType > operator* (scalar scalarCoeff, TemporalOperator< ValueType > rhs)
 
template<typename ValueType >
TemporalOperator< ValueType > operator* (const Vector< scalar > &coeffVector, TemporalOperator< ValueType > rhs)
 
template<typename ValueType >
TemporalOperator< ValueType > operator* (const Coeff &coeff, TemporalOperator< ValueType > rhs)
 

Function Documentation

◆ applyFieldRelaxation()

template<typename VectorType >
void NeoN::dsl::applyFieldRelaxation ( VectorType &  solution,
const Vector< typename VectorType::ElementType > &  previous,
scalar  alpha 
)

Definition at line 299 of file solver.hpp.

◆ applyMatrixRelaxation()

template<typename VectorType , typename MatrixValueType , typename RHSValueType , typename SystemMatrixType , typename BoundaryMatrixType >
void NeoN::dsl::applyMatrixRelaxation ( la::LinearSystem< MatrixValueType, RHSValueType, SystemMatrixType, BoundaryMatrixType > &  ls,
const VectorType &  solution,
scalar  alpha 
)

Definition at line 210 of file solver.hpp.

◆ componentCopySign() [1/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::dsl::componentCopySign ( const scalar  mag,
const scalar  s 
)

Componentwise sign-copy (scalar overload).

Definition at line 137 of file solver.hpp.

◆ componentCopySign() [2/2]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::dsl::componentCopySign ( const Vec3 mag,
const Vec3 s 
)

Componentwise sign-copy (Vec3 overload — all 3 components).

Definition at line 143 of file solver.hpp.

◆ componentMag() [1/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::dsl::componentMag ( const scalar  value)

Componentwise magnitude (scalar overload).

Definition at line 149 of file solver.hpp.

◆ componentMag() [2/2]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::dsl::componentMag ( const Vec3 value)

Componentwise magnitude (Vec3 overload — keeps all 3 components, does NOT collapse to the L2 norm that the global mag(Vec3) returns).

Definition at line 153 of file solver.hpp.

◆ componentMax() [1/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::dsl::componentMax ( const scalar  lhs,
const scalar  rhs 
)

Componentwise max (scalar overload).

Definition at line 159 of file solver.hpp.

◆ componentMax() [2/2]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::dsl::componentMax ( const Vec3 lhs,
const Vec3 rhs 
)

Componentwise max (Vec3 overload — per component).

Definition at line 165 of file solver.hpp.

◆ copySign()

KOKKOS_INLINE_FUNCTION scalar NeoN::dsl::copySign ( const scalar  mag,
const scalar  s 
)

Returns |mag| carrying the sign of s (scalar overload).

Definition at line 131 of file solver.hpp.

◆ fieldRelaxationSnapshot()

template<typename VectorType >
auto NeoN::dsl::fieldRelaxationSnapshot ( const VectorType &  field)

Definition at line 332 of file solver.hpp.

◆ operator*() [1/8]

template<typename ValueType >
SpatialOperator< ValueType > NeoN::dsl::operator* ( const Coeff coeff,
SpatialOperator< ValueType >  rhs 
)

Definition at line 256 of file spatialOperator.hpp.

◆ operator*() [2/8]

template<typename ValueType >
TemporalOperator< ValueType > NeoN::dsl::operator* ( const Coeff coeff,
TemporalOperator< ValueType >  rhs 
)

Definition at line 294 of file temporalOperator.hpp.

◆ operator*() [3/8]

Coeff NeoN::dsl::operator* ( const Coeff lhs,
const Coeff rhs 
)
inline

Definition at line 61 of file coeff.hpp.

◆ operator*() [4/8]

template<typename ValueType >
SpatialOperator< ValueType > NeoN::dsl::operator* ( const Vector< scalar > &  coeffVector,
SpatialOperator< ValueType >  rhs 
)

Definition at line 248 of file spatialOperator.hpp.

◆ operator*() [5/8]

template<typename ValueType >
TemporalOperator< ValueType > NeoN::dsl::operator* ( const Vector< scalar > &  coeffVector,
TemporalOperator< ValueType >  rhs 
)

Definition at line 286 of file temporalOperator.hpp.

◆ operator*() [6/8]

template<typename ValueType >
SpatialOperator< ValueType > NeoN::dsl::operator* ( scalar  scalarCoeff,
SpatialOperator< ValueType >  rhs 
)

Definition at line 239 of file spatialOperator.hpp.

◆ operator*() [7/8]

template<typename ValueType >
TemporalOperator< ValueType > NeoN::dsl::operator* ( scalar  scalarCoeff,
TemporalOperator< ValueType >  rhs 
)

Definition at line 277 of file temporalOperator.hpp.

◆ operator*() [8/8]

template<typename ValueType >
Expression< ValueType > NeoN::dsl::operator* ( scalar  scale,
const Expression< ValueType > &  es 
)
inline

Definition at line 611 of file expression.hpp.

◆ operator+() [1/3]

template<typename ValueType >
Expression< ValueType > NeoN::dsl::operator+ ( Expression< ValueType >  lhs,
const Expression< ValueType > &  rhs 
)
inline

Definition at line 585 of file expression.hpp.

◆ operator+() [2/3]

template<typename ValueType >
Expression< ValueType > NeoN::dsl::operator+ ( Expression< ValueType >  lhs,
const SpatialOperator< ValueType > &  rhs 
)
inline

Definition at line 593 of file expression.hpp.

◆ operator+() [3/3]

template<typename leftOperator , typename rightOperator >
Expression< typename leftOperator::VectorValueType > NeoN::dsl::operator+ ( leftOperator  lhs,
rightOperator  rhs 
)
inline

Definition at line 601 of file expression.hpp.

◆ operator-() [1/3]

template<typename ValueType >
Expression< ValueType > NeoN::dsl::operator- ( Expression< ValueType >  lhs,
const Expression< ValueType > &  rhs 
)
inline

Definition at line 628 of file expression.hpp.

◆ operator-() [2/3]

template<typename ValueType >
Expression< ValueType > NeoN::dsl::operator- ( Expression< ValueType >  lhs,
const SpatialOperator< ValueType > &  rhs 
)
inline

Definition at line 636 of file expression.hpp.

◆ operator-() [3/3]

template<typename leftOperator , typename rightOperator >
Expression< typename leftOperator::VectorValueType > NeoN::dsl::operator- ( leftOperator  lhs,
rightOperator  rhs 
)
inline

Definition at line 644 of file expression.hpp.

◆ optimize() [1/2]

template<typename ExpressionType >
ExpressionType NeoN::dsl::optimize ( const ExpressionType &  in)

Apply the default optimizer pipeline to an expression.

Runs every built-in optimizer (currently DivLapOptimizer) in sequence and returns the resulting expression. Each optimizer may replace, remove, or add operators; later optimizers see the output of earlier ones.

Template Parameters
ExpressionTypeThe DSL expression type.
Parameters
inExpression to optimize.
Returns
Optimized expression.

Definition at line 110 of file optimizer.hpp.

◆ optimize() [2/2]

template<typename ExpressionType >
ExpressionType NeoN::dsl::optimize ( const ExpressionType &  in,
const std::vector< std::shared_ptr< Optimizer< ExpressionType > > > &  opts 
)

Apply a caller-supplied optimizer pipeline to an expression.

Runs each optimizer in opts in order, passing the output of one as the input to the next.

Template Parameters
ExpressionTypeThe DSL expression type.
Parameters
inExpression to optimize.
optsOrdered list of optimizers to apply.
Returns
Optimized expression.

Definition at line 131 of file optimizer.hpp.

◆ solve()

template<typename VectorType , typename IndexType >
std::optional< la::SolverStats > NeoN::dsl::solve ( Expression< typename VectorType::ElementType, IndexType > &  exp,
VectorType &  solution,
scalar  t,
scalar  dt,
const Dictionary fvSchemes,
const Dictionary fvSolution,
std::vector< const PostAssemblyBase< typename VectorType::ElementType, IndexType > * >  p = {} 
)

Definition at line 95 of file solver.hpp.