NeoN
A framework for CFD software
|
Namespaces | |
namespace | detail |
namespace | dsl |
namespace | finiteVolume |
namespace | la |
namespace | timeIntegration |
Classes | |
class | ArgList |
class | Array |
A class to contain the data and executors for a field and define some basic operations. 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... | |
class | BoundaryData |
Represents the boundary fields for a computational domain. More... | |
class | BoundaryMesh |
Represents boundaries of an unstructured mesh. 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 | CPUExecutor |
Executor for handling multicore CPU based parallelization. More... | |
class | Database |
class | DerivedClassDocumentation |
Class representing the documentation for a derived class. More... | |
class | Dictionary |
A class representing a dictionary that stores key-value pairs. More... | |
class | DimensionMismatch |
Error for handling two containers of incompatible lengths. More... | |
class | Document |
A class representing a document in a database. More... | |
class | Error |
Base class for consistent error representation. More... | |
class | Field |
Represents the domain fields for a computational domain. More... | |
class | GPUExecutor |
Executor for GPU offloading. More... | |
class | NeoNException |
Custom exception class for NeoN. More... | |
struct | Parameters |
struct | RegisterDocumentation |
Template struct for registering documentation of a base class. More... | |
class | RuntimeSelectionFactory |
A factory class for runtime selection of derived classes. More... | |
class | RuntimeSelectionFactory< Base, Parameters< Args... > > |
class | SegmentedVector |
Data structure that stores a segmented fields or a vector of vectors. More... | |
class | SegmentedVectorView |
A class representing a segment of indices. More... | |
class | SerialExecutor |
Reference executor for serial CPU execution. More... | |
class | StencilDataBase |
A class that represents a stencil database. More... | |
class | Time |
class | TokenList |
A class representing a list of tokens. More... | |
class | UnstructuredMesh |
Represents an unstructured mesh in NeoN. More... | |
class | Vec3 |
A class for the representation of a 3D Vec3. More... | |
class | Vector |
A class to contain the data and executors for a field and define some basic operations. More... | |
class | View |
Concepts | |
concept | parallelForKernel |
concept | parallelForContainerKernel |
concept | hasView |
Concept, for any type which has the 'view' method. | |
Typedefs | |
using | DocumentValidator = std::function< bool(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 | label = int32_t |
using | localIdx = int32_t |
using | globalIdx = int64_t |
using | size_t = 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 > |
Functions | |
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 (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) |
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. | |
template<class DataClass > | |
DataClass | read (Input input) |
template<typename Executor , parallelForKernel Kernel> | |
void | parallelFor (const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name="parallelFor") |
template<parallelForKernel Kernel> | |
void | parallelFor (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, std::string name="parallelFor") |
template<typename Executor , template< typename > class ContType, typename ValueType , parallelForContainerKernel< ValueType > Kernel> | |
void | parallelFor (const Executor &exec, ContType< ValueType > &container, Kernel kernel, std::string name="parallelFor") |
template<template< typename > class ContType, typename ValueType , parallelForContainerKernel< ValueType > Kernel> | |
void | parallelFor (ContType< ValueType > &cont, Kernel kernel, std::string name="parallelFor") |
template<typename Executor , typename Kernel , typename T > | |
void | parallelReduce (const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, T &value) |
template<typename Kernel , typename T > | |
void | parallelReduce (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, T &value) |
template<typename Executor , typename ValueType , typename Kernel , typename T > | |
void | parallelReduce (const Executor &exec, Vector< ValueType > &field, Kernel kernel, T &value) |
template<typename ValueType , typename Kernel , typename T > | |
void | parallelReduce (Vector< ValueType > &field, Kernel kernel, T &value) |
template<typename Executor , typename Kernel > | |
void | parallelScan (const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel) |
template<typename Kernel > | |
void | parallelScan (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel) |
template<typename Executor , typename Kernel , typename ReturnType > | |
void | parallelScan (const Executor &exec, std::pair< localIdx, localIdx > range, Kernel kernel, ReturnType &returnValue) |
template<typename Kernel , typename ReturnType > | |
void | parallelScan (const NeoN::Executor &exec, std::pair< localIdx, localIdx > range, 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<typename T > | |
KOKKOS_INLINE_FUNCTION T | one () |
template<typename T > | |
KOKKOS_INLINE_FUNCTION T | zero () |
KOKKOS_INLINE_FUNCTION Vec3 | operator* (const scalar &sclr, Vec3 rhs) |
KOKKOS_INLINE_FUNCTION scalar | operator& (const Vec3 &lhs, Vec3 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<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 std::size_t &key, const std::vector< std::any > &data) |
template<typename ValueType > | |
Vector< ValueType > | operator+ (Vector< ValueType > lhs, const Vector< ValueType > &rhs) |
Arithmetic add operator, addition of two fields. | |
template<typename ValueType > | |
Vector< ValueType > | operator- (Vector< ValueType > lhs, const Vector< ValueType > &rhs) |
Arithmetic subtraction operator, subtraction one field from another. | |
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<typename... Types> requires (hasView<std::remove_reference_t<Types>> && ...) | |
auto | views (Types &... args) |
Unpacks all views of the passed classes. | |
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) |
A factory function for a 1D mesh. | |
Variables | |
constexpr scalar | ROOTVSMALL = 1e-18 |
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:
Definition at line 30 of file document.hpp.
using NeoN::Executor = typedef std::variant<SerialExecutor, CPUExecutor, GPUExecutor> |
Definition at line 16 of file executor.hpp.
using NeoN::globalIdx = typedef int64_t |
using NeoN::Input = typedef std::variant<Dictionary, TokenList> |
using NeoN::label = typedef int32_t |
using NeoN::labelVector = typedef NeoN::Vector<label> |
Definition at line 13 of file vectorTypeDefs.hpp.
using NeoN::localIdx = typedef int32_t |
using NeoN::localIdxVector = typedef NeoN::Vector<localIdx> |
Definition at line 14 of file vectorTypeDefs.hpp.
using NeoN::mpi_label_t = typedef int |
typedef float NeoN::scalar |
Definition at line 14 of file scalar.hpp.
using NeoN::scalarVector = typedef NeoN::Vector<scalar> |
Definition at line 15 of file vectorTypeDefs.hpp.
using NeoN::size_t = typedef std::size_t |
using NeoN::vectorVector = typedef NeoN::Vector<Vec3> |
Definition at line 16 of file vectorTypeDefs.hpp.
using NeoN::word = typedef std::string |
void NeoN::add | ( | Vector< ValueType > & | vect, |
const std::type_identity_t< ValueType > & | value | ||
) |
void NeoN::add | ( | Vector< ValueType > & | vect1, |
const Vector< std::type_identity_t< ValueType > > & | vect2 | ||
) |
auto NeoN::copyToHosts | ( | Args &... | cont | ) |
Definition at line 118 of file containerFreeFunctions.hpp.
UnstructuredMesh NeoN::create1DUniformMesh | ( | const Executor | exec, |
const localIdx | nCells | ||
) |
A factory function for a 1D mesh.
A 1D mesh in 3D space in which each cell has a left and a right face. The 1D mesh is aligned with the x coordinate of Cartesian coordinate system.
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
std::string NeoN::demangle | ( | const char * | mangledName | ) |
bool NeoN::equal | ( | const ContType< ValueType > & | cont, |
View< ValueType > | view2 | ||
) |
Definition at line 161 of file containerFreeFunctions.hpp.
bool NeoN::equal | ( | const ContType< ValueType > & | cont1, |
const ContType< ValueType > & | cont2 | ||
) |
Definition at line 139 of file containerFreeFunctions.hpp.
bool NeoN::equal | ( | ContType< ValueType > & | cont, |
ValueType | value | ||
) |
Definition at line 124 of file containerFreeFunctions.hpp.
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.
field | The field to fill. |
value | The vector value to fill the field with. |
range | The range to fill the field in. If not provided, the whole field is filled. |
Definition at line 73 of file containerFreeFunctions.hpp.
bool NeoN::hasId | ( | Dictionary | doc | ) |
Checks if a Dictionary object has an "id" key.
This function checks if the given Dictionary object has an "id" key.
doc | The Dictionary object to check. |
void NeoN::logBadAnyCast | ( | const std::bad_any_cast & | e, |
const Key & | key, | ||
const Container & | data | ||
) |
Definition at line 19 of file demangle.hpp.
void NeoN::logOutRange | ( | const std::out_of_range & | e, |
const std::size_t & | key, | ||
const std::vector< std::any > & | data | ||
) |
void NeoN::logOutRange | ( | const std::out_of_range & | e, |
const std::string & | key, | ||
const std::unordered_map< std::string, std::any > & | data | ||
) |
Definition at line 20 of file scalar.hpp.
void NeoN::map | ( | ContType< ValueType > & | cont, |
const Inner | inner, | ||
std::pair< localIdx, localIdx > | range = {0, 0} |
||
) |
Map a field using a specific executor.
cont | The container to map. |
inner | The function to apply to each element of the field. |
range | The range to map the field in. If not provided, the whole field is mapped. |
Definition at line 51 of file containerFreeFunctions.hpp.
void NeoN::mul | ( | Vector< ValueType > & | vect, |
const std::type_identity_t< ValueType > & | value | ||
) |
void NeoN::mul | ( | Vector< ValueType > & | vect1, |
const Vector< std::type_identity_t< ValueType > > & | vect2 | ||
) |
const std::string & NeoN::name | ( | const NeoN::Document & | doc | ) |
std::string & NeoN::name | ( | NeoN::Document & | doc | ) |
KOKKOS_INLINE_FUNCTION T NeoN::one | ( | ) |
Definition at line 24 of file scalar.hpp.
Checks if two executors are not equal, i.e. they are not of the same type.
lhs | The first executor. |
rhs | The second executor. |
Definition at line 51 of file executor.hpp.
Vector< ValueType > NeoN::operator+ | ( | Vector< ValueType > | lhs, |
const Vector< ValueType > & | rhs | ||
) |
Arithmetic add operator, addition of two fields.
lhs | The field to add with this field. |
rhs | The field to add with this field. |
Vector< ValueType > NeoN::operator- | ( | Vector< ValueType > | lhs, |
const Vector< ValueType > & | rhs | ||
) |
Arithmetic subtraction operator, subtraction one field from another.
lhs | The field to subtract from. |
rhs | The field to subtract by. |
std::ostream & NeoN::operator<< | ( | std::ostream & | os, |
const Dictionary & | in | ||
) |
std::ostream & NeoN::operator<< | ( | std::ostream & | out, |
const Vec3 & | vec | ||
) |
Checks if two executors are equal, i.e. they are of the same type.
lhs | The first executor. |
rhs | The second executor. |
Definition at line 24 of file executor.hpp.
void NeoN::parallelFor | ( | const Executor & | exec, |
ContType< ValueType > & | container, | ||
Kernel | kernel, | ||
std::string | name = "parallelFor" |
||
) |
Definition at line 80 of file parallelAlgorithms.hpp.
void NeoN::parallelFor | ( | const Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
std::string | name = "parallelFor" |
||
) |
Definition at line 28 of file parallelAlgorithms.hpp.
void NeoN::parallelFor | ( | const NeoN::Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
std::string | name = "parallelFor" |
||
) |
Definition at line 56 of file parallelAlgorithms.hpp.
void NeoN::parallelFor | ( | ContType< ValueType > & | cont, |
Kernel | kernel, | ||
std::string | name = "parallelFor" |
||
) |
Definition at line 111 of file parallelAlgorithms.hpp.
void NeoN::parallelReduce | ( | const Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
T & | value | ||
) |
Definition at line 117 of file parallelAlgorithms.hpp.
void NeoN::parallelReduce | ( | const Executor & | exec, |
Vector< ValueType > & | field, | ||
Kernel | kernel, | ||
T & | value | ||
) |
Definition at line 158 of file parallelAlgorithms.hpp.
void NeoN::parallelReduce | ( | const NeoN::Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
T & | value | ||
) |
Definition at line 149 of file parallelAlgorithms.hpp.
void NeoN::parallelReduce | ( | Vector< ValueType > & | field, |
Kernel | kernel, | ||
T & | value | ||
) |
Definition at line 187 of file parallelAlgorithms.hpp.
void NeoN::parallelScan | ( | const Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel | ||
) |
Definition at line 193 of file parallelAlgorithms.hpp.
void NeoN::parallelScan | ( | const Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
ReturnType & | returnValue | ||
) |
Definition at line 209 of file parallelAlgorithms.hpp.
void NeoN::parallelScan | ( | const NeoN::Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel | ||
) |
Definition at line 203 of file parallelAlgorithms.hpp.
void NeoN::parallelScan | ( | const NeoN::Executor & | exec, |
std::pair< localIdx, localIdx > | range, | ||
Kernel | kernel, | ||
ReturnType & | returnValue | ||
) |
Definition at line 224 of file parallelAlgorithms.hpp.
DataClass NeoN::read | ( | Input | input | ) |
void NeoN::scalarMul | ( | Vector< ValueType > & | vect, |
const scalar | value | ||
) |
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
[in] | in | The values to compute the offsets from. |
[in,out] | offsets | The field to store the resulting offsets in. |
Definition at line 26 of file segmentedVector.hpp.
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.
cont | The container to set. |
view | The view of values to set the container with. |
range | The range to set the container in. If not provided, the whole container is set. |
Definition at line 100 of file containerFreeFunctions.hpp.
void NeoN::sub | ( | Vector< ValueType > & | vect, |
const std::type_identity_t< ValueType > & | value | ||
) |
void NeoN::sub | ( | Vector< ValueType > & | vect1, |
const Vector< std::type_identity_t< ValueType > > & | vect2 | ||
) |
void NeoN::validateRegistration | ( | const Type & | field, |
const std::string & | errorMessage | ||
) |
Validates that a field is registered in the database.
Type | The type of the field. |
field | The field to validate. |
errorMessage | The error message |
std::runtime_error | if the field is not registered in the database. |
Definition at line 120 of file database.hpp.
auto NeoN::views | ( | Types &... | args | ) |
KOKKOS_INLINE_FUNCTION T NeoN::zero | ( | ) |
KOKKOS_INLINE_FUNCTION localIdx NeoN::zero< localIdx > | ( | ) |
KOKKOS_INLINE_FUNCTION scalar NeoN::zero< scalar > | ( | ) |
Definition at line 30 of file scalar.hpp.
KOKKOS_INLINE_FUNCTION Vec3 NeoN::zero< Vec3 > | ( | ) |
|
constexpr |
Definition at line 17 of file scalar.hpp.