NeoN
A framework for CFD software
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NeoN::dsl::SetReference< ValueType, IndexType > Class Template Reference

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...

#include <expression.hpp>

Inheritance diagram for NeoN::dsl::SetReference< ValueType, IndexType >:
NeoN::dsl::PostAssemblyBase< VectorType, IndexType >

Public Member Functions

 SetReference (localIdx refCell, ValueType refValue)
 
void operator() (la::LinearSystem< ValueType, ValueType, la::CSRMatrix< ValueType, IndexType > > &ls) const override
 
void applyScalarMatrix (la::LinearSystem< scalar, ValueType, la::CSRMatrix< scalar, IndexType >, la::COOMatrix< scalar, IndexType > > &ls) const override
 Segregated scalar-matrix / ValueType-rhs form. The scalar diagonal scales the ValueType reference value (scalar * Vec3 broadcasts), so the same pin applies to every component of the right-hand side.
 
- Public Member Functions inherited from NeoN::dsl::PostAssemblyBase< VectorType, IndexType >
virtual ~PostAssemblyBase ()=default
 
virtual void operator() (la::LinearSystem< VectorType, VectorType, la::CSRMatrix< VectorType, IndexType > > &) const
 
virtual void applyScalarMatrix (la::LinearSystem< scalar, VectorType, la::CSRMatrix< scalar, IndexType >, la::COOMatrix< scalar, IndexType > > &) const
 Apply to the segregated scalar-matrix / VectorType-rhs form (a scalar coefficient matrix with a VectorType right-hand side). Default no-op; functors that support the segregated form override this. A distinct name (rather than an operator() overload) avoids colliding with the same-type signature when VectorType == scalar.
 

Detailed Description

template<typename ValueType, typename IndexType = localIdx>
class NeoN::dsl::SetReference< ValueType, IndexType >

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.

Modifies the assembled linear system in-place: A[refCell, refCell] += A[refCell, refCell] (doubles the diagonal) rhs[refCell] += A[refCell, refCell] * refValue

For distributed systems only the rank that owns the reference cell (assumed to be rank 0 for local cell index 0) applies the modification; all other ranks skip it. For non-distributed systems every rank applies it independently (each holds a full copy). @TODO allow to set a refPoint instead of a refCell, make the refCell a global cellID

Definition at line 66 of file expression.hpp.

Constructor & Destructor Documentation

◆ SetReference()

template<typename ValueType , typename IndexType = localIdx>
NeoN::dsl::SetReference< ValueType, IndexType >::SetReference ( localIdx  refCell,
ValueType  refValue 
)
inline

Definition at line 70 of file expression.hpp.

Member Function Documentation

◆ applyScalarMatrix()

template<typename ValueType , typename IndexType = localIdx>
void NeoN::dsl::SetReference< ValueType, IndexType >::applyScalarMatrix ( la::LinearSystem< scalar, ValueType, la::CSRMatrix< scalar, IndexType >, la::COOMatrix< scalar, IndexType > > &  ls) const
inlineoverride

Segregated scalar-matrix / ValueType-rhs form. The scalar diagonal scales the ValueType reference value (scalar * Vec3 broadcasts), so the same pin applies to every component of the right-hand side.

Definition at line 104 of file expression.hpp.

◆ operator()()

template<typename ValueType , typename IndexType = localIdx>
void NeoN::dsl::SetReference< ValueType, IndexType >::operator() ( la::LinearSystem< ValueType, ValueType, la::CSRMatrix< ValueType, IndexType > > &  ls) const
inlineoverride

Definition at line 72 of file expression.hpp.


The documentation for this class was generated from the following file: