NeoN
A framework for CFD software
Loading...
Searching...
No Matches
NeoN Namespace Reference

Integer types used throughout NeoN. More...

Namespaces

namespace  detail
namespace  finiteVolume
namespace  Logging
namespace  dsl
namespace  la
namespace  timeIntegration

Classes

class  Array
 An executor-aware contiguous container for structural and indexing data. More...
class  SupportsCopyTo
 MixinClass signaling copyTo is supported. More...
class  Collection
 A type-erased interface collection types. More...
class  CollectionMixin
 A mixin class for collection of documents in a database to simplify the implementation of common operations. More...
class  Database
class  Document
 A class representing a document in a database. More...
class  Dictionary
 A class representing a dictionary that stores key-value pairs. More...
class  NeoNException
 Custom exception class for NeoN. More...
class  CPUExecutor
 Executor for handling multicore CPU based parallelization. More...
class  GPUExecutor
 Executor for GPU offloading. More...
class  SerialExecutor
 Reference executor for serial CPU execution. More...
class  AllocatorStrategy
class  AllocatorContext
class  KokkosAllocator
class  UmpireAllocator
class  UmpirePoolAllocator
class  Vector
 An executor-aware contiguous container for numerical data with vector-style arithmetic semantics. More...
class  SymmTensor
 A class for the representation of a symmetric 3x3 tensor. More...
class  Tensor
 A class for the representation of a 3x3 tensor. More...
class  Vec3
 A class for the representation of a 3D Vec3. More...
class  BaseClassData
 Represents the data for a base class. More...
class  BaseClassDocumentation
 Provides a mechanism for registering and retrieving documentation for base and derived classes. More...
struct  RegisterDocumentation
 Template struct for registering documentation of a base class. More...
class  DerivedClassDocumentation
 Class representing the documentation for a derived class. More...
struct  Parameters
class  RuntimeSelectionFactory
 A factory class for runtime selection of derived classes. More...
class  RuntimeSelectionFactory< Base, Parameters< Args... > >
class  SegmentedVectorView
 A class representing a segment of indices. More...
class  SegmentedVector
 Data structure that stores a segmented fields or a vector of vectors. More...
class  ArgList
class  Time
class  TokenList
 A class representing a list of tokens. More...
class  View
class  BoundaryData
 Represents the boundary fields for a computational domain. More...
struct  NoWaitAccess
 Passkey granting non-draining access to BoundaryData's value storage. More...
class  Field
 Represents the domain fields for a computational domain. More...
class  Error
 Base class for consistent error representation. More...
class  DimensionMismatch
 Error for handling two containers of incompatible lengths. More...
class  BoundaryMesh
 Represents boundaries of an unstructured mesh. More...
struct  TrackingMeshView
 Read-only views of a TrackingMesh, captured by value inside kernels. More...
class  TrackingMesh
 Connectivity for locating points (e.g. particles) in an UnstructuredMesh and interpolating cell values to them, on the executor (CPU or GPU). More...
class  UnstructuredMesh
 Represents an unstructured mesh in NeoN. More...

Concepts

concept  parallelForKernel
concept  parallelForContainerKernel
concept  hasView
 Concept, for any type which has the 'view' method.

Typedefs

using DocumentValidator = std::function<bool(const Dictionary&)>
 A type alias for a function that validates a Dictionary object.
using Executor = std::variant<SerialExecutor, CPUExecutor, GPUExecutor>
using Input = std::variant<Dictionary, TokenList>
using DefaultAllocator = KokkosAllocator
using label = int32_t
using localIdx = int32_t
using globalIdx = int64_t
using sizeType = std::size_t
using mpi_label_t = int
typedef float scalar
using word = std::string
using labelVector = NeoN::Vector<label>
using localIdxVector = NeoN::Vector<localIdx>
using scalarVector = NeoN::Vector<scalar>
using vectorVector = NeoN::Vector<Vec3>

Enumerations

enum class  MemorySpace { CPU , GPU }
enum class  TrackingFaceType : label { internal = 0 , cyclic = 1 , escape = 2 }
 What happens to a point that leaves a cell through a face. More...

Functions

bool hasSerialBackend () noexcept
bool hasCpuBackend () noexcept
bool hasGpuBackend () noexcept
template<template< typename > class ContType, typename ValueType, typename Inner>
void map (ContType< ValueType > &cont, const Inner inner, std::pair< localIdx, localIdx > range={0, 0})
 Map a field using a specific executor.
template<template< typename > class ContType, typename ValueType>
void fill (ContType< ValueType > &cont, const std::type_identity_t< ValueType > value, std::pair< localIdx, localIdx > range={0, 0})
 Fill the field with a vector value using a specific executor.
template<template< typename > class ContType, typename ValueType>
void setContainer (ContType< ValueType > &cont, const View< const std::type_identity_t< ValueType > > view, std::pair< localIdx, localIdx > range={0, 0})
 Set the container with a view of values using a specific executor.
template<typename... Args>
auto copyToHosts (Args &... cont)
template<template< typename > class ContType, typename ValueType>
bool equal (ContType< ValueType > &cont, ValueType value)
template<template< typename > class ContType, typename ValueType>
bool equal (const ContType< ValueType > &cont1, const ContType< ValueType > &cont2)
template<template< typename > class ContType, typename ValueType>
bool equal (const ContType< ValueType > &cont, View< ValueType > view2)
template<typename Type>
void validateRegistration (const Type &field, const std::string &errorMessage)
 Validates that a field is registered in the database.
bool hasId (const Dictionary &doc)
 Checks if a Dictionary object has an "id" key.
const std::string & name (const NeoN::Document &doc)
 Retrieves the name of a Document.
std::string & name (NeoN::Document &doc)
 Retrieves the name of a Document.
std::string demangle (const char *mangledName)
template<typename T, typename Container, typename Key>
void logBadAnyCast (const std::bad_any_cast &e, const Key &key, const Container &data)
void logOutRange (const std::out_of_range &e, const std::string &key, const std::unordered_map< std::string, std::any > &data)
std::ostream & operator<< (std::ostream &os, const Dictionary &in)
void fence (const Executor &exec)
Executor createDefaultExecutor (std::unique_ptr< AllocatorStrategy > strategy=std::make_unique< DefaultAllocator >())
std::string executorName (const Executor &exec)
MemorySpace memorySpace (const Executor &exec)
std::shared_ptr< const Logging::BaseLogger > getLogger (const Executor &exec)
void setLogger (Executor &exec, std::shared_ptr< Logging::BaseLogger > logger)
bool operator== (const Executor &lhs, const Executor &rhs)
 Checks if two executors are equal, i.e. they are of the same type.
bool operator!= (const Executor &lhs, const Executor &rhs)
 Checks if two executors are not equal, i.e. they are not of the same type.
void initialize (int argc, char *argv[])
void finalize ()
template<class DataClass>
DataClass read (Input input)
template<typename ExecutorType>
void fenceIfLogger (const ExecutorType &exec)
template<typename ExecutorType, parallelForKernel Kernel>
void parallelFor (const ExecutorType &, std::pair< localIdx, localIdx > range, const Kernel &kernel, std::string name)
template<parallelForKernel Kernel>
void parallelFor (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel, std::string name="parallelFor")
template<typename Executor, template< typename > class ContType, typename ValueType, parallelForContainerKernel< ValueType > Kernel>
void parallelFor (const Executor &, ContType< ValueType > &container, const Kernel &kernel, std::string name="parallelFor")
template<template< typename > class ContType, typename ValueType, parallelForContainerKernel< ValueType > Kernel>
void parallelFor (ContType< ValueType > &cont, const Kernel &kernel, std::string name="parallelFor")
template<typename Executor, typename Kernel, typename T>
void parallelReduce (const Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel, T &value)
template<typename Kernel, typename T>
void parallelReduce (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel, T &value)
template<typename Executor, typename ValueType, typename Kernel, typename T>
void parallelReduce (const Executor &exec, Vector< ValueType > &field, const Kernel &kernel, T &value)
template<typename ValueType, typename Kernel, typename T>
void parallelReduce (Vector< ValueType > &field, const Kernel &kernel, T &value)
template<typename Executor, typename Kernel>
void parallelScan (const Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel)
template<typename Kernel>
void parallelScan (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel)
template<typename Executor, typename Kernel, typename ReturnType>
void parallelScan (const Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel, ReturnType &returnValue)
template<typename Kernel, typename ReturnType>
void parallelScan (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, const Kernel &kernel, ReturnType &returnValue)
template<>
KOKKOS_INLINE_FUNCTION localIdx one< localIdx > ()
template<>
KOKKOS_INLINE_FUNCTION localIdx zero< localIdx > ()
KOKKOS_INLINE_FUNCTION scalar mag (const scalar &s)
template<>
KOKKOS_INLINE_FUNCTION scalar one< scalar > ()
template<>
KOKKOS_INLINE_FUNCTION scalar zero< scalar > ()
template<>
KOKKOS_INLINE_FUNCTION scalar inv< scalar > (scalar in)
KOKKOS_INLINE_FUNCTION SymmTensor operator* (const scalar s, const SymmTensor &st)
KOKKOS_INLINE_FUNCTION Vec3 operator& (const SymmTensor &s, const Vec3 &v)
 Symmetric matrix-vector product S·v.
KOKKOS_INLINE_FUNCTION scalar mag (const SymmTensor &s)
 Frobenius norm.
KOKKOS_INLINE_FUNCTION scalar magSqr (const SymmTensor &s)
 Frobenius norm squared.
KOKKOS_INLINE_FUNCTION SymmTensor symm (const Tensor &t)
 Symmetric part of a full tensor: ½(T + T^T).
KOKKOS_INLINE_FUNCTION Tensor twoSymm (const Tensor &t)
 T + T^T (= 2*symm(T)) as a full tensor.
KOKKOS_INLINE_FUNCTION SymmTensor devTwoSymm (const Tensor &t)
 T + T^T - (2/3)*tr(T)*I — used for viscous stress.
std::ostream & operator<< (std::ostream &out, const SymmTensor &s)
template<>
KOKKOS_INLINE_FUNCTION SymmTensor zero< SymmTensor > ()
template<>
KOKKOS_INLINE_FUNCTION SymmTensor one< SymmTensor > ()
template<>
KOKKOS_INLINE_FUNCTION SymmTensor inv< SymmTensor > (SymmTensor)
KOKKOS_INLINE_FUNCTION Tensor operator* (const scalar s, const Tensor &t)
KOKKOS_INLINE_FUNCTION Vec3 operator& (const Tensor &t, const Vec3 &v)
 Matrix-vector product T·v.
KOKKOS_INLINE_FUNCTION Vec3 operator& (const Vec3 &v, const Tensor &t)
 Row-vector times matrix v·T.
KOKKOS_INLINE_FUNCTION scalar mag (const Tensor &t)
 Frobenius norm.
KOKKOS_INLINE_FUNCTION scalar magSqr (const Tensor &t)
 Frobenius norm squared.
std::ostream & operator<< (std::ostream &out, const Tensor &t)
template<>
KOKKOS_INLINE_FUNCTION Tensor zero< Tensor > ()
template<>
KOKKOS_INLINE_FUNCTION Tensor one< Tensor > ()
template<>
KOKKOS_INLINE_FUNCTION Tensor inv< Tensor > (Tensor)
template<typename T>
KOKKOS_INLINE_FUNCTION T one ()
template<typename T>
KOKKOS_INLINE_FUNCTION T zero ()
template<typename T>
KOKKOS_INLINE_FUNCTION T inv (T)
KOKKOS_INLINE_FUNCTION Vec3 operator* (const scalar &sclr, Vec3 rhs)
KOKKOS_INLINE_FUNCTION Vec3 operator* (const Vec3 &lhs, Vec3 rhs)
 compute component wise product
KOKKOS_INLINE_FUNCTION scalar operator& (const Vec3 &lhs, Vec3 rhs)
 inner product
KOKKOS_INLINE_FUNCTION Vec3 operator^ (const Vec3 &lhs, Vec3 rhs)
 cross (vector) product, right-handed: lhs ^ rhs
KOKKOS_INLINE_FUNCTION Vec3 cross (const Vec3 &lhs, const Vec3 &rhs)
 cross (vector) product, spelled out for call sites that read better as a named function than as ^
KOKKOS_INLINE_FUNCTION Vec3 operator/ (const Vec3 &lhs, scalar rhs)
KOKKOS_INLINE_FUNCTION scalar mag (const Vec3 &vec)
std::ostream & operator<< (std::ostream &out, const Vec3 &vec)
template<>
KOKKOS_INLINE_FUNCTION Vec3 one< Vec3 > ()
template<>
KOKKOS_INLINE_FUNCTION Vec3 zero< Vec3 > ()
template<>
KOKKOS_INLINE_FUNCTION Vec3 inv< Vec3 > (Vec3 in)
template<typename IndexType>
IndexType segmentsFromIntervals (const Vector< IndexType > &intervals, Vector< IndexType > &offsets)
 Compute segment offsets from an input field corresponding to lengths by computing a prefix sum.
void logOutRange (const std::out_of_range &e, const sizeType &key, const std::vector< std::any > &data)
template<typename ValueType>
Vector< ValueType > operator+ (Vector< ValueType > lhs, const Vector< ValueType > &rhs)
 Adds two Vectors element-wise.
template<typename ValueType>
Vector< ValueType > operator- (Vector< ValueType > lhs, const Vector< ValueType > &rhs)
 Subtracts two Vectors element-wise.
template<typename ValueType>
requires requires(ValueType a, scalar b) { a* b; }
void scalarMul (Vector< ValueType > &vect, const scalar value)
template<typename ValueType>
void add (Vector< ValueType > &vect, const std::type_identity_t< ValueType > &value)
template<typename ValueType>
void add (Vector< ValueType > &vect1, const Vector< std::type_identity_t< ValueType > > &vect2)
template<typename ValueType>
void sub (Vector< ValueType > &vect, const std::type_identity_t< ValueType > &value)
template<typename ValueType>
void sub (Vector< ValueType > &vect1, const Vector< std::type_identity_t< ValueType > > &vect2)
template<typename ValueType>
requires requires(ValueType a, ValueType b) { a* b; }
void mul (Vector< ValueType > &vect, const std::type_identity_t< ValueType > &value)
template<typename ValueType>
requires requires(ValueType a, ValueType b) { a* b; }
void mul (Vector< ValueType > &vect1, const Vector< std::type_identity_t< ValueType > > &vect2)
template<unsigned int I>
Vector< scalar > getComponent (const Vector< Vec3 > &in)
 Given a Vector of Vec3 this function extracts a single component.
template<unsigned int I>
void setComponent (const Vector< scalar > &in, Vector< Vec3 > &out)
 Given a Vector of Vec3 this function sets a single component.
template<typename ValueType>
Vector< ValueType > take (const Vector< ValueType > &in, std::pair< localIdx, localIdx > range)
 Given a Vector and an index range [first, first+length] a subvector is created.
template<typename... Types>
requires (hasView<std::remove_reference_t<Types>> && ...)
auto views (Types &... args)
 Unpacks all views of the passed classes.
void validateRange (std::pair< localIdx, localIdx > range, sizeType size)
localIdx toLocalIdx (sizeType value)
void validateInput (bool condition, std::string_view message, const std::source_location location=std::source_location::current())
KOKKOS_INLINE_FUNCTION scalar pointToBarycentric (const Vec3 &x, const Vec3 &a, const Vec3 &b, const Vec3 &c, const Vec3 &d, scalar w[4])
 Barycentric coordinates w of x in the tetrahedron (a, b, c, d).
template<typename ValueType>
KOKKOS_INLINE_FUNCTION ValueType interpolateCellPoint (const TrackingMeshView &m, const View< const ValueType > &cellValues, const View< const ValueType > &pointValues, const label c, const Vec3 &x)
 Interpolate a field at x in cell c from cell and point values, as OpenFOAM's interpolationCellPoint.
KOKKOS_INLINE_FUNCTION bool pointInCell (const Vec3 &x, const label c, const TrackingMeshView &m)
 Is x inside cell c? Face-plane test, as OpenFOAM primitiveMesh::pointInCell (FACE_PLANES): x is not in front of any (outward-oriented) face plane of c.
KOKKOS_INLINE_FUNCTION label locateCell (Vec3 &x, label hint, const TrackingMeshView &m)
 Locate the cell containing x, starting from cell hint.
UnstructuredMesh createSingleCellMesh (const Executor exec)
 creates a mesh containing only a single cell @warn currently this is only a 2D mesh
UnstructuredMesh create1DUniformMesh (const Executor exec, const localIdx nCells, scalar lx=1.0)
 A factory function for a 1D uniform mesh.
UnstructuredMesh create2DUniformMesh (const Executor exec, localIdx nx, localIdx ny, scalar lx=1.0, scalar ly=1.0)
 A factory function for a 2D uniform mesh (single-layer hex slab).
UnstructuredMesh create3DUniformMesh (const Executor exec, localIdx nx, localIdx ny, localIdx nz, scalar lx=1.0, scalar ly=1.0, scalar lz=1.0)
 A factory function for a uniform 3D hex mesh.

Variables

constexpr scalar ROOTVSMALL = 1e-18
template<class baseClass>
bool RegisterDocumentation< baseClass >::REGISTERED = RegisterDocumentation<baseClass>::init()
template<class derivedClass>
bool RuntimeSelectionFactory< Base, Parameters< Args... > >::Register< derivedClass >::REGISTERED

Detailed Description

Integer types used throughout NeoN.

The following type aliases distinguish between different kinds of integer values:

  • label identifies mesh entities (e.g. cell number and face number)
  • localIdx indexes data that is local to a process or execution space, such as arrays, views, and local graph structures.
  • globalIdx identifies globally unique entities in distributed-memory computations.
  • sizeType represents sizes and counts (e.g. container sizes, iteration counts, and memory sizes) and should not be used to identify mesh entities.

The widths of label, localIdx, and globalIdx depend on the compile-time configuration (NeoN_DP_LABEL and NeoN_US_IDX).

Typedef Documentation

◆ DefaultAllocator

Definition at line 36 of file kokkos.hpp.

◆ DocumentValidator

using NeoN::DocumentValidator = std::function<bool(const Dictionary&)>

A type alias for a function that validates a Dictionary object.

This type alias represents a function that takes a Dictionary object as an argument and returns a boolean value indicating whether the Dictionary is valid or not.

Example usage:

DocumentValidator validator = [](const Dictionary& dict) -> bool {
// Validation logic here
return true; // or false based on validation
};
A class representing a dictionary that stores key-value pairs.
std::function< bool(const Dictionary &)> DocumentValidator
A type alias for a function that validates a Dictionary object.
Definition document.hpp:31

Definition at line 31 of file document.hpp.

◆ Executor

Definition at line 21 of file executor.hpp.

◆ globalIdx

using NeoN::globalIdx = int64_t

Definition at line 51 of file label.hpp.

◆ Input

using NeoN::Input = std::variant<Dictionary, TokenList>

Definition at line 15 of file input.hpp.

◆ label

using NeoN::label = int32_t

Definition at line 44 of file label.hpp.

◆ labelVector

Definition at line 15 of file vectorTypeDefs.hpp.

◆ localIdx

using NeoN::localIdx = int32_t

Definition at line 50 of file label.hpp.

◆ localIdxVector

Definition at line 16 of file vectorTypeDefs.hpp.

◆ mpi_label_t

using NeoN::mpi_label_t = int

Definition at line 57 of file label.hpp.

◆ scalar

typedef float NeoN::scalar

Definition at line 17 of file scalar.hpp.

◆ scalarVector

Definition at line 17 of file vectorTypeDefs.hpp.

◆ sizeType

using NeoN::sizeType = std::size_t

Definition at line 56 of file label.hpp.

◆ vectorVector

Definition at line 18 of file vectorTypeDefs.hpp.

◆ word

using NeoN::word = std::string

Definition at line 17 of file time.hpp.

Enumeration Type Documentation

◆ MemorySpace

enum class NeoN::MemorySpace
strong
Enumerator
CPU 
GPU 

Definition at line 17 of file allocator.hpp.

◆ TrackingFaceType

enum class NeoN::TrackingFaceType : label
strong

What happens to a point that leaves a cell through a face.

Enumerator
internal 

go to the neighbour cell

cyclic 

periodic: shift the position, continue in the partner cell

escape 

any other boundary: the point leaves the domain

Definition at line 17 of file trackingMesh.hpp.

Function Documentation

◆ add() [1/2]

template<typename ValueType>
void NeoN::add ( Vector< ValueType > & vect,
const std::type_identity_t< ValueType > & value )

◆ add() [2/2]

template<typename ValueType>
void NeoN::add ( Vector< ValueType > & vect1,
const Vector< std::type_identity_t< ValueType > > & vect2 )

◆ copyToHosts()

template<typename... Args>
auto NeoN::copyToHosts ( Args &... cont)

Definition at line 126 of file containerFreeFunctions.hpp.

◆ create1DUniformMesh()

UnstructuredMesh NeoN::create1DUniformMesh ( const Executor exec,
const localIdx nCells,
scalar lx = 1.0 )

A factory function for a 1D uniform mesh.

A 1D mesh in 3D space in which each cell has a left and a right boundary face. The 1D mesh is aligned with the x coordinate of Cartesian coordinate system.

◆ create2DUniformMesh()

UnstructuredMesh NeoN::create2DUniformMesh ( const Executor exec,
localIdx nx,
localIdx ny,
scalar lx = 1.0,
scalar ly = 1.0 )

A factory function for a 2D uniform mesh (single-layer hex slab).

Creates an nx × ny × 1 structured hex mesh on [0,Lx] × [0,Ly] × [0,1]. One cell thick in z, the standard quasi-2D finite-volume convention. Four boundary patches: left (x=0), right (x=Lx), bottom (y=0), top (y=Ly)

◆ create3DUniformMesh()

UnstructuredMesh NeoN::create3DUniformMesh ( const Executor exec,
localIdx nx,
localIdx ny,
localIdx nz,
scalar lx = 1.0,
scalar ly = 1.0,
scalar lz = 1.0 )

A factory function for a uniform 3D hex mesh.

Creates an nx × ny × nz structured hex mesh on [0,Lx] × [0,Ly] × [0,Lz]. Six boundary patches: left (x=0), right (x=Lx), bottom (y=0), top (y=Ly), front (z=0), back (z=Lz).

◆ createDefaultExecutor()

Executor NeoN::createDefaultExecutor ( std::unique_ptr< AllocatorStrategy > strategy = std::make_unique<DefaultAllocator>())
inline

Definition at line 34 of file executor.hpp.

◆ createSingleCellMesh()

UnstructuredMesh NeoN::createSingleCellMesh ( const Executor exec)

creates a mesh containing only a single cell @warn currently this is only a 2D mesh

a 2D mesh in 3D space with left, right, top, bottom boundary faces with the centre at (0.5, 0.5, 0.0) left, top, right, bottom faces and four boundaries one left, right, top, bottom

◆ cross()

KOKKOS_INLINE_FUNCTION Vec3 NeoN::cross ( const Vec3 & lhs,
const Vec3 & rhs )

cross (vector) product, spelled out for call sites that read better as a named function than as ^

Definition at line 185 of file vec3.hpp.

◆ demangle()

std::string NeoN::demangle ( const char * mangledName)

◆ devTwoSymm()

KOKKOS_INLINE_FUNCTION SymmTensor NeoN::devTwoSymm ( const Tensor & t)

T + T^T - (2/3)*tr(T)*I — used for viscous stress.

Definition at line 256 of file symmTensor.hpp.

◆ equal() [1/3]

template<template< typename > class ContType, typename ValueType>
bool NeoN::equal ( const ContType< ValueType > & cont,
View< ValueType > view2 )

Definition at line 169 of file containerFreeFunctions.hpp.

◆ equal() [2/3]

template<template< typename > class ContType, typename ValueType>
bool NeoN::equal ( const ContType< ValueType > & cont1,
const ContType< ValueType > & cont2 )

Definition at line 147 of file containerFreeFunctions.hpp.

◆ equal() [3/3]

template<template< typename > class ContType, typename ValueType>
bool NeoN::equal ( ContType< ValueType > & cont,
ValueType value )

Definition at line 132 of file containerFreeFunctions.hpp.

◆ executorName()

std::string NeoN::executorName ( const Executor & exec)
inline

Definition at line 54 of file executor.hpp.

◆ fence()

void NeoN::fence ( const Executor & exec)
inline

Definition at line 24 of file executor.hpp.

◆ fenceIfLogger()

template<typename ExecutorType>
void NeoN::fenceIfLogger ( const ExecutorType & exec)

Definition at line 80 of file parallelAlgorithms.hpp.

◆ fill()

template<template< typename > class ContType, typename ValueType>
void NeoN::fill ( ContType< ValueType > & cont,
const std::type_identity_t< ValueType > value,
std::pair< localIdx, localIdx > range = {0, 0} )

Fill the field with a vector value using a specific executor.

Parameters
fieldThe field to fill.
valueThe vector value to fill the field with.
rangeThe range to fill the field in. If not provided, the whole field is filled.

Definition at line 78 of file containerFreeFunctions.hpp.

◆ finalize()

void NeoN::finalize ( )
inline

Definition at line 46 of file initialization.hpp.

◆ getComponent()

template<unsigned int I>
Vector< scalar > NeoN::getComponent ( const Vector< Vec3 > & in)
nodiscard

Given a Vector of Vec3 this function extracts a single component.

Returns
The resulting scalar vector

◆ getLogger()

std::shared_ptr< const Logging::BaseLogger > NeoN::getLogger ( const Executor & exec)
inline

Definition at line 72 of file executor.hpp.

◆ hasCpuBackend()

bool NeoN::hasCpuBackend ( )
nodiscardnoexcept

◆ hasGpuBackend()

bool NeoN::hasGpuBackend ( )
nodiscardnoexcept

◆ hasId()

bool NeoN::hasId ( const Dictionary & doc)

Checks if a Dictionary object has an "id" key.

This function checks if the given Dictionary object has an "id" key.

Parameters
docThe Dictionary object to check.
Returns
true if the Dictionary has an "id" key, false otherwise.

◆ hasSerialBackend()

bool NeoN::hasSerialBackend ( )
nodiscardnoexcept

◆ initialize()

void NeoN::initialize ( int argc,
char * argv[] )
inline

Definition at line 21 of file initialization.hpp.

◆ interpolateCellPoint()

template<typename ValueType>
KOKKOS_INLINE_FUNCTION ValueType NeoN::interpolateCellPoint ( const TrackingMeshView & m,
const View< const ValueType > & cellValues,
const View< const ValueType > & pointValues,
const label c,
const Vec3 & x )

Interpolate a field at x in cell c from cell and point values, as OpenFOAM's interpolationCellPoint.

Finds the tet (cell centre, face base point, two consecutive face points) containing x, as OpenFOAM cellPointWeight::findTetrahedron, and blends the cell value with the three point values by the barycentric weights. If no tet contains x, the tet with the largest smallest weight is used. If the cell has no valid tet, the cell value is returned.

Parameters
mtracking mesh view
cellValuesfield value of every cell
pointValuesfield value of every mesh point (e.g. from volPointInterpolation)
ccell containing x
xposition

Definition at line 58 of file pointInterpolation.hpp.

◆ inv()

template<typename T>
KOKKOS_INLINE_FUNCTION T NeoN::inv ( T )

◆ inv< scalar >()

template<>
KOKKOS_INLINE_FUNCTION scalar NeoN::inv< scalar > ( scalar in)

Definition at line 39 of file scalar.hpp.

◆ inv< SymmTensor >()

template<>
KOKKOS_INLINE_FUNCTION SymmTensor NeoN::inv< SymmTensor > ( SymmTensor )

Definition at line 285 of file symmTensor.hpp.

◆ inv< Tensor >()

template<>
KOKKOS_INLINE_FUNCTION Tensor NeoN::inv< Tensor > ( Tensor )

Definition at line 244 of file tensor.hpp.

◆ inv< Vec3 >()

template<>
KOKKOS_INLINE_FUNCTION Vec3 NeoN::inv< Vec3 > ( Vec3 in)

Definition at line 211 of file vec3.hpp.

◆ locateCell()

KOKKOS_INLINE_FUNCTION label NeoN::locateCell ( Vec3 & x,
label hint,
const TrackingMeshView & m )

Locate the cell containing x, starting from cell hint.

The walk of OpenFOAM meshSearch::findCellWalk: if x is not in the current cell, test the neighbour cells (pointInCell); otherwise move to the neighbour whose centre is nearest to x, as long as that decreases the distance. For periodic meshes a neighbour across a cyclic face is the partner cell, seen from the shifted position x + shift (OpenFOAM's translational cyclic transform); x is shifted when the walk goes through the cyclic face.

Returns
the cell containing x (x possibly shifted), or -1 if the walk gets stuck, i.e. x has left the domain through a non-periodic boundary.

Definition at line 166 of file trackingMesh.hpp.

◆ logBadAnyCast()

template<typename T, typename Container, typename Key>
void NeoN::logBadAnyCast ( const std::bad_any_cast & e,
const Key & key,
const Container & data )

Definition at line 20 of file demangle.hpp.

◆ logOutRange() [1/2]

void NeoN::logOutRange ( const std::out_of_range & e,
const sizeType & key,
const std::vector< std::any > & data )

◆ logOutRange() [2/2]

void NeoN::logOutRange ( const std::out_of_range & e,
const std::string & key,
const std::unordered_map< std::string, std::any > & data )

◆ mag() [1/4]

KOKKOS_INLINE_FUNCTION scalar NeoN::mag ( const scalar & s)

Definition at line 23 of file scalar.hpp.

◆ mag() [2/4]

KOKKOS_INLINE_FUNCTION scalar NeoN::mag ( const SymmTensor & s)

Frobenius norm.

Definition at line 206 of file symmTensor.hpp.

◆ mag() [3/4]

KOKKOS_INLINE_FUNCTION scalar NeoN::mag ( const Tensor & t)

Frobenius norm.

Definition at line 205 of file tensor.hpp.

◆ mag() [4/4]

KOKKOS_INLINE_FUNCTION scalar NeoN::mag ( const Vec3 & vec)

Definition at line 193 of file vec3.hpp.

◆ magSqr() [1/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::magSqr ( const SymmTensor & s)

Frobenius norm squared.

Definition at line 217 of file symmTensor.hpp.

◆ magSqr() [2/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::magSqr ( const Tensor & t)

Frobenius norm squared.

Definition at line 217 of file tensor.hpp.

◆ map()

template<template< typename > class ContType, typename ValueType, typename Inner>
void NeoN::map ( ContType< ValueType > & cont,
const Inner inner,
std::pair< localIdx, localIdx > range = {0, 0} )

Map a field using a specific executor.

Parameters
contThe container to map.
innerThe function to apply to each element of the field.
rangeThe range to map the field in. If not provided, the whole field is mapped.

Definition at line 53 of file containerFreeFunctions.hpp.

◆ memorySpace()

MemorySpace NeoN::memorySpace ( const Executor & exec)
inline

Definition at line 64 of file executor.hpp.

◆ mul() [1/2]

template<typename ValueType>
requires requires(ValueType a, ValueType b) { a* b; }
void NeoN::mul ( Vector< ValueType > & vect,
const std::type_identity_t< ValueType > & value )

◆ mul() [2/2]

template<typename ValueType>
requires requires(ValueType a, ValueType b) { a* b; }
void NeoN::mul ( Vector< ValueType > & vect1,
const Vector< std::type_identity_t< ValueType > > & vect2 )

◆ name() [1/2]

const std::string & NeoN::name ( const NeoN::Document & doc)

Retrieves the name of a Document.

This function retrieves the name of the Document by looking up the "name" key in the Document's Dictionary object.

Parameters
docThe Document to retrieve the name from.
Returns
std::string The name of the Document.

◆ name() [2/2]

std::string & NeoN::name ( NeoN::Document & doc)

Retrieves the name of a Document.

This function retrieves the name of the Document by looking up the "name" key in the Document's Dictionary object.

Parameters
docThe Document to retrieve the name from.
Returns
std::string The name of the Document.

◆ one()

template<typename T>
KOKKOS_INLINE_FUNCTION T NeoN::one ( )

◆ one< localIdx >()

template<>
KOKKOS_INLINE_FUNCTION localIdx NeoN::one< localIdx > ( )

Definition at line 61 of file label.hpp.

◆ one< scalar >()

template<>
KOKKOS_INLINE_FUNCTION scalar NeoN::one< scalar > ( )

Definition at line 27 of file scalar.hpp.

◆ one< SymmTensor >()

template<>
KOKKOS_INLINE_FUNCTION SymmTensor NeoN::one< SymmTensor > ( )

Definition at line 279 of file symmTensor.hpp.

◆ one< Tensor >()

template<>
KOKKOS_INLINE_FUNCTION Tensor NeoN::one< Tensor > ( )

Definition at line 238 of file tensor.hpp.

◆ one< Vec3 >()

template<>
KOKKOS_INLINE_FUNCTION Vec3 NeoN::one< Vec3 > ( )

Definition at line 199 of file vec3.hpp.

◆ operator!=()

bool NeoN::operator!= ( const Executor & lhs,
const Executor & rhs )
inlinenodiscard

Checks if two executors are not equal, i.e. they are not of the same type.

Parameters
lhsThe first executor.
rhsThe second executor.
Returns
True if the executors not are equal, false otherwise.

Definition at line 117 of file executor.hpp.

◆ operator&() [1/4]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator& ( const SymmTensor & s,
const Vec3 & v )

Symmetric matrix-vector product S·v.

Definition at line 195 of file symmTensor.hpp.

◆ operator&() [2/4]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator& ( const Tensor & t,
const Vec3 & v )

Matrix-vector product T·v.

Definition at line 183 of file tensor.hpp.

◆ operator&() [3/4]

KOKKOS_INLINE_FUNCTION scalar NeoN::operator& ( const Vec3 & lhs,
Vec3 rhs )

inner product

Definition at line 166 of file vec3.hpp.

◆ operator&() [4/4]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator& ( const Vec3 & v,
const Tensor & t )

Row-vector times matrix v·T.

Definition at line 194 of file tensor.hpp.

◆ operator*() [1/4]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator* ( const scalar & sclr,
Vec3 rhs )

Definition at line 150 of file vec3.hpp.

◆ operator*() [2/4]

KOKKOS_INLINE_FUNCTION SymmTensor NeoN::operator* ( const scalar s,
const SymmTensor & st )

Definition at line 191 of file symmTensor.hpp.

◆ operator*() [3/4]

KOKKOS_INLINE_FUNCTION Tensor NeoN::operator* ( const scalar s,
const Tensor & t )

Definition at line 179 of file tensor.hpp.

◆ operator*() [4/4]

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator* ( const Vec3 & lhs,
Vec3 rhs )

compute component wise product

Definition at line 159 of file vec3.hpp.

◆ operator+()

template<typename ValueType>
Vector< ValueType > NeoN::operator+ ( Vector< ValueType > lhs,
const Vector< ValueType > & rhs )
nodiscard

Adds two Vectors element-wise.

Parameters
lhsLeft-hand Vector.
rhsRight-hand Vector.
Returns
A Vector containing the element-wise sum.

◆ operator-()

template<typename ValueType>
Vector< ValueType > NeoN::operator- ( Vector< ValueType > lhs,
const Vector< ValueType > & rhs )
nodiscard

Subtracts two Vectors element-wise.

Parameters
lhsLeft-hand Vector.
rhsRight-hand Vector.
Returns
A Vector containing the element-wise difference.

◆ operator/()

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator/ ( const Vec3 & lhs,
scalar rhs )

Definition at line 189 of file vec3.hpp.

◆ operator<<() [1/4]

std::ostream & NeoN::operator<< ( std::ostream & os,
const Dictionary & in )

◆ operator<<() [2/4]

std::ostream & NeoN::operator<< ( std::ostream & out,
const SymmTensor & s )

◆ operator<<() [3/4]

std::ostream & NeoN::operator<< ( std::ostream & out,
const Tensor & t )

◆ operator<<() [4/4]

std::ostream & NeoN::operator<< ( std::ostream & out,
const Vec3 & vec )

◆ operator==()

bool NeoN::operator== ( const Executor & lhs,
const Executor & rhs )
inlinenodiscard

Checks if two executors are equal, i.e. they are of the same type.

Parameters
lhsThe first executor.
rhsThe second executor.
Returns
True if the executors are equal, false otherwise.

Definition at line 90 of file executor.hpp.

◆ operator^()

KOKKOS_INLINE_FUNCTION Vec3 NeoN::operator^ ( const Vec3 & lhs,
Vec3 rhs )

cross (vector) product, right-handed: lhs ^ rhs

Definition at line 173 of file vec3.hpp.

◆ parallelFor() [1/4]

template<typename Executor, template< typename > class ContType, typename ValueType, parallelForContainerKernel< ValueType > Kernel>
void NeoN::parallelFor ( const Executor & ,
ContType< ValueType > & container,
const Kernel & kernel,
std::string name = "parallelFor" )

Definition at line 146 of file parallelAlgorithms.hpp.

◆ parallelFor() [2/4]

template<typename ExecutorType, parallelForKernel Kernel>
void NeoN::parallelFor ( const ExecutorType & ,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
std::string name )

Definition at line 91 of file parallelAlgorithms.hpp.

◆ parallelFor() [3/4]

template<parallelForKernel Kernel>
void NeoN::parallelFor ( const NeoN::Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
std::string name = "parallelFor" )

Definition at line 122 of file parallelAlgorithms.hpp.

◆ parallelFor() [4/4]

template<template< typename > class ContType, typename ValueType, parallelForContainerKernel< ValueType > Kernel>
void NeoN::parallelFor ( ContType< ValueType > & cont,
const Kernel & kernel,
std::string name = "parallelFor" )

Definition at line 178 of file parallelAlgorithms.hpp.

◆ parallelReduce() [1/4]

template<typename Executor, typename Kernel, typename T>
void NeoN::parallelReduce ( const Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
T & value )

Definition at line 184 of file parallelAlgorithms.hpp.

◆ parallelReduce() [2/4]

template<typename Executor, typename ValueType, typename Kernel, typename T>
void NeoN::parallelReduce ( const Executor & exec,
Vector< ValueType > & field,
const Kernel & kernel,
T & value )

Definition at line 225 of file parallelAlgorithms.hpp.

◆ parallelReduce() [3/4]

template<typename Kernel, typename T>
void NeoN::parallelReduce ( const NeoN::Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
T & value )

Definition at line 216 of file parallelAlgorithms.hpp.

◆ parallelReduce() [4/4]

template<typename ValueType, typename Kernel, typename T>
void NeoN::parallelReduce ( Vector< ValueType > & field,
const Kernel & kernel,
T & value )

Definition at line 254 of file parallelAlgorithms.hpp.

◆ parallelScan() [1/4]

template<typename Executor, typename Kernel>
void NeoN::parallelScan ( const Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel )

Definition at line 262 of file parallelAlgorithms.hpp.

◆ parallelScan() [2/4]

template<typename Executor, typename Kernel, typename ReturnType>
void NeoN::parallelScan ( const Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
ReturnType & returnValue )

Definition at line 280 of file parallelAlgorithms.hpp.

◆ parallelScan() [3/4]

template<typename Kernel>
void NeoN::parallelScan ( const NeoN::Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel )

Definition at line 272 of file parallelAlgorithms.hpp.

◆ parallelScan() [4/4]

template<typename Kernel, typename ReturnType>
void NeoN::parallelScan ( const NeoN::Executor & exec,
std::pair< localIdx, localIdx > range,
const Kernel & kernel,
ReturnType & returnValue )

Definition at line 295 of file parallelAlgorithms.hpp.

◆ pointInCell()

KOKKOS_INLINE_FUNCTION bool NeoN::pointInCell ( const Vec3 & x,
const label c,
const TrackingMeshView & m )

Is x inside cell c? Face-plane test, as OpenFOAM primitiveMesh::pointInCell (FACE_PLANES): x is not in front of any (outward-oriented) face plane of c.

Definition at line 134 of file trackingMesh.hpp.

◆ pointToBarycentric()

KOKKOS_INLINE_FUNCTION scalar NeoN::pointToBarycentric ( const Vec3 & x,
const Vec3 & a,
const Vec3 & b,
const Vec3 & c,
const Vec3 & d,
scalar w[4] )

Barycentric coordinates w of x in the tetrahedron (a, b, c, d).

GPU callable. x = w[0] a + w[1] b + w[2] c + w[3] d, with the w summing to 1.

Returns
the determinant of the tetrahedron edges (6 x its signed volume). If it is zero (degenerate tet), w = (1, 0, 0, 0).

Definition at line 23 of file pointInterpolation.hpp.

◆ read()

template<class DataClass>
DataClass NeoN::read ( Input input)

Definition at line 18 of file input.hpp.

◆ scalarMul()

template<typename ValueType>
requires requires(ValueType a, scalar b) { a* b; }
void NeoN::scalarMul ( Vector< ValueType > & vect,
const scalar value )

◆ segmentsFromIntervals()

template<typename IndexType>
IndexType NeoN::segmentsFromIntervals ( const Vector< IndexType > & intervals,
Vector< IndexType > & offsets )

Compute segment offsets from an input field corresponding to lengths by computing a prefix sum.

The offsets are computed by a prefix sum of the input values. So, with given input of {1, 2, 3, 4, 5} the offsets are {0, 1, 3, 6, 10, 15}. Note that the length of offView must be length of intervals + 1 and are all elements of offVIew are required to be zero

Parameters
[in]inThe values to compute the offsets from.
[in,out]offsetsThe field to store the resulting offsets in.

Definition at line 64 of file segmentedVector.hpp.

◆ setComponent()

template<unsigned int I>
void NeoN::setComponent ( const Vector< scalar > & in,
Vector< Vec3 > & out )

Given a Vector of Vec3 this function sets a single component.

Returns
The resulting scalar vector

◆ setContainer()

template<template< typename > class ContType, typename ValueType>
void NeoN::setContainer ( ContType< ValueType > & cont,
const View< const std::type_identity_t< ValueType > > view,
std::pair< localIdx, localIdx > range = {0, 0} )

Set the container with a view of values using a specific executor.

Parameters
contThe container to set.
viewThe view of values to set the container with.
rangeThe range to set the container in. If not provided, the whole container is set.

Definition at line 105 of file containerFreeFunctions.hpp.

◆ setLogger()

void NeoN::setLogger ( Executor & exec,
std::shared_ptr< Logging::BaseLogger > logger )
inline

Definition at line 78 of file executor.hpp.

◆ sub() [1/2]

template<typename ValueType>
void NeoN::sub ( Vector< ValueType > & vect,
const std::type_identity_t< ValueType > & value )

◆ sub() [2/2]

template<typename ValueType>
void NeoN::sub ( Vector< ValueType > & vect1,
const Vector< std::type_identity_t< ValueType > > & vect2 )

◆ symm()

KOKKOS_INLINE_FUNCTION SymmTensor NeoN::symm ( const Tensor & t)

Symmetric part of a full tensor: ½(T + T^T).

Definition at line 225 of file symmTensor.hpp.

◆ take()

template<typename ValueType>
Vector< ValueType > NeoN::take ( const Vector< ValueType > & in,
std::pair< localIdx, localIdx > range )

Given a Vector and an index range [first, first+length] a subvector is created.

Returns
The resulting subset vector

◆ toLocalIdx()

localIdx NeoN::toLocalIdx ( sizeType value)
inline

Converts a sizeType to localIdx, checking that the value fits.

Use this instead of a plain static_cast when converting container sizes or indices. A plain cast can silently wrap around if the value is larger than the maximum localIdx.

Parameters
valueThe unsigned value to convert, typically a size() result
Returns
The same value as a localIdx
Exceptions
std::length_errorif value is greater than the maximum localIdx

Definition at line 150 of file exceptions.hpp.

◆ twoSymm()

KOKKOS_INLINE_FUNCTION Tensor NeoN::twoSymm ( const Tensor & t)

T + T^T (= 2*symm(T)) as a full tensor.

Definition at line 239 of file symmTensor.hpp.

◆ validateInput()

void NeoN::validateInput ( bool condition,
std::string_view message,
const std::source_location location = std::source_location::current() )
inline

Definition at line 159 of file exceptions.hpp.

◆ validateRange()

void NeoN::validateRange ( std::pair< localIdx, localIdx > range,
sizeType size )
inline

Checks that the half-open range [begin, end) lies inside a container of the given size.

A range is valid if 0 <= begin <= end <= size. An empty range (begin == end) is valid, including at begin == end == size.

Parameters
rangeThe pair {begin, end}, where end is exclusive
sizeThe size of the container being indexed
Exceptions
std::out_of_rangeif begin < 0, begin > end, or end > size

Definition at line 127 of file exceptions.hpp.

◆ validateRegistration()

template<typename Type>
void NeoN::validateRegistration ( const Type & field,
const std::string & errorMessage )

Validates that a field is registered in the database.

Template Parameters
TypeThe type of the field.
Parameters
fieldThe field to validate.
errorMessageThe error message
Exceptions
std::runtime_errorif the field is not registered in the database.

Definition at line 121 of file database.hpp.

◆ views()

template<typename... Types>
requires (hasView<std::remove_reference_t<Types>> && ...)
auto NeoN::views ( Types &... args)

Unpacks all views of the passed classes.

Template Parameters
TypesTypes of the classes with views
Returns
Tuple containing the unpacked views (use structured bindings).

Definition at line 108 of file view.hpp.

◆ zero()

template<typename T>
KOKKOS_INLINE_FUNCTION T NeoN::zero ( )

◆ zero< localIdx >()

template<>
KOKKOS_INLINE_FUNCTION localIdx NeoN::zero< localIdx > ( )

Definition at line 67 of file label.hpp.

◆ zero< scalar >()

template<>
KOKKOS_INLINE_FUNCTION scalar NeoN::zero< scalar > ( )

Definition at line 33 of file scalar.hpp.

◆ zero< SymmTensor >()

template<>
KOKKOS_INLINE_FUNCTION SymmTensor NeoN::zero< SymmTensor > ( )

Definition at line 273 of file symmTensor.hpp.

◆ zero< Tensor >()

template<>
KOKKOS_INLINE_FUNCTION Tensor NeoN::zero< Tensor > ( )

Definition at line 232 of file tensor.hpp.

◆ zero< Vec3 >()

template<>
KOKKOS_INLINE_FUNCTION Vec3 NeoN::zero< Vec3 > ( )

Definition at line 205 of file vec3.hpp.

Variable Documentation

◆ RegisterDocumentation< baseClass >::REGISTERED

template<class baseClass>
bool NeoN::RegisterDocumentation< baseClass >::REGISTERED = RegisterDocumentation<baseClass>::init()

Definition at line 158 of file runtimeSelectionFactory.hpp.

◆ ROOTVSMALL

scalar NeoN::ROOTVSMALL = 1e-18
constexpr

Definition at line 20 of file scalar.hpp.

◆ RuntimeSelectionFactory< Base, Parameters< Args... > >::Register< derivedClass >::REGISTERED

template<class derivedClass>
bool NeoN::RuntimeSelectionFactory< Base, Parameters< Args... > >::Register< derivedClass >::REGISTERED
Initial value:
=
)
A factory class for runtime selection of derived classes.
A template class for registering derived classes with a base class.

Definition at line 409 of file runtimeSelectionFactory.hpp.