|
Nektar++
|
Common base class of the operator family interfaces: holds the expansion list, component names and data warehouse an operator was built with, and provides the family-agnostic Create() and GetOpExecSpace(). More...
#include <Operator.hpp>
Public Member Functions | |
| virtual | ~Operator ()=default |
| Operator (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components) | |
| Construct the interface part of a concrete operator; called by the factory-registered creator functions. | |
Static Public Member Functions | |
| template<template< typename > typename TOperator> | |
| static std::shared_ptr< TOperator< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components, const std::string &execStr) |
| Create a concrete operator instance through the operator factory. | |
| static std::string | GetOpExecSpace (std::shared_ptr< LibUtilities::SessionReader > session, const bool warn=true) |
| Return the execution space name ("opExecSpace") for an operator. | |
| static const DefaultOpImplRule * | GetDefaultOpImplRule (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the row of the default implementation table (DefaultOpImplTable.hpp) that a block of elements takes, or null if none does. | |
| static std::string | GetDefaultOpImpl (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the implementation a block of elements takes when neither the command line nor the session names one for its operator. | |
| static std::vector< unsigned int > | GetDefaultInterleaveWidths (const MultiRegions::ExpListSharedPtr &expansionList) |
Return the default interleave widths, one per block of expansionList, that persistent Fields (e.g. solution storage, time-integration and linear-solver workspace) built on it should be constructed with. | |
| static bool | IsDiscontinuousProjection (std::shared_ptr< LibUtilities::SessionReader > session) |
| Return true if the session uses a Discontinuous (DG) projection. | |
Protected Attributes | |
| MultiRegions::ExpListSharedPtr | m_expansionList |
| Expansion list the operator acts on. | |
| std::vector< std::string > | m_components |
| Names of the field components the operator was built for. | |
| LibUtilities::NekDataWarehouseSharedPtr | m_dataWarehouse |
| Data warehouse shared with the other operators on the expansion list, used to build and cache shared tables (basis matrices, mode indices, geometric factors) once. | |
Common base class of the operator family interfaces: holds the expansion list, component names and data warehouse an operator was built with, and provides the family-agnostic Create() and GetOpExecSpace().
| TData | Floating-point type of the field data. |
Definition at line 99 of file Operator.hpp.
|
virtualdefault |
|
inline |
Construct the interface part of a concrete operator; called by the factory-registered creator functions.
| expansionList | Expansion list the operator acts on. |
| components | Names of the field components the operator is set up for. |
Definition at line 112 of file Operator.hpp.
|
inlinestatic |
Create a concrete operator instance through the operator factory.
The factory key is TOperator::name + execStr, where an empty execStr is resolved by GetOpExecSpace(). The product is handed back through a static_pointer_cast to TOperator, so the creator registered under the key must construct that class or one derived from it.
| TOperator | Family interface class supplying the static name string. |
| expansionList | Expansion list the operator acts on. |
| components | Names of the field components the operator is set up for. |
| execStr | Execution space ("Serial", "AVX" or "Device"); if empty, GetOpExecSpace() supplies it from the session's "opExecSpace" command-line argument or, failing that, the build's default, with a warning. |
Definition at line 147 of file Operator.hpp.
References Nektar::LibUtilities::NekFactoryBase< tKey, tBase, tBasePtr, tParam >::CreateInstance(), Nektar::ErrorUtil::efatal, Nektar::LibUtilities::NekFactoryBase< tKey, tBase, tBasePtr, tParam >::ModuleExists(), NEKERROR, Nektar::LibUtilities::NekFactoryBase< tKey, tBase, tBasePtr, tParam >::PrintAvailableClasses(), and session.
|
inlinestatic |
Return the default interleave widths, one per block of expansionList, that persistent Fields (e.g. solution storage, time-integration and linear-solver workspace) built on it should be constructed with.
A block takes the vector width of the session's execution space when its implementation is SumFac or the execution space is AVX, so that Fields are created at that width rather than reshaped on every Apply; 1 otherwise. The implementation is the command line's "opImpl" or, without it, the block's default of GetDefaultOpImpl(), so that each block matches the operators' default for it; a session that names implementations per operator (a backend section) leaves that default out, since one width cannot follow a mix. A DG projection takes the same interleave widths as a continuous one: the trace operators read a field at whatever width each of its blocks carries.
| expansionList | Expansion list the fields are built on; its session supplies the command-line arguments and the backend sections. |
Definition at line 288 of file Operator.hpp.
References Nektar::MultiRegions::GetCollections(), Nektar::MultiRegions::Operator< TData >::GetDefaultOpImpl(), Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), and session.
Referenced by Nektar::MultiRegions::GetBlockAttributes().
|
inlinestatic |
Return the implementation a block of elements takes when neither the command line nor the session names one for its operator.
This is the implementation of the block's row of the default implementation table (DefaultOpImplTable.hpp), by execution space, device architecture, element shape and expansion order, and SumFac where no row applies or without an expansion. On Device the table currently gives SumFacTOP from order three in 3D and order six in 1D and 2D. The default is taken per block, so the blocks of a mesh of mixed order or shape can take different implementations.
| exp | The block's representative element, or null. |
| execSpace | Execution space ("Serial", "AVX" or "Device"). |
Definition at line 255 of file Operator.hpp.
References Nektar::MultiRegions::Operator< TData >::GetDefaultOpImplRule(), and Nektar::MultiRegions::DefaultOpImplRule::opImpl.
Referenced by TestFusedElmt< Policy, VISCOUS >::DefaultImplementation(), and Nektar::MultiRegions::Operator< TData >::GetDefaultInterleaveWidths().
|
inlinestatic |
Return the row of the default implementation table (DefaultOpImplTable.hpp) that a block of elements takes, or null if none does.
| exp | The block's representative element, whose shape and highest order over its directions are used, or null. |
| execSpace | Execution space ("Serial", "AVX" or "Device"). |
Definition at line 224 of file Operator.hpp.
References Nektar::MultiRegions::FindDefaultOpImplRule(), and Nektar::GetDeviceArchitecture().
Referenced by Nektar::MultiRegions::Operator< TData >::GetDefaultOpImpl(), and Nektar::MultiRegions::ElmtOp< TFieldIn, TFieldOut, TData >::GetOpImpl().
|
inlinestatic |
Return the execution space name ("opExecSpace") for an operator.
The space comes from the command-line argument "opExecSpace". Without it the operator takes the space the build provides, "Device" when a device is present and otherwise "AVX" or "Serial", and, if warn, warns that it has done so.
| session | Session reader to recover the relevant command-line argument. |
| warn | Whether to warn when the space is defaulted. |
Definition at line 190 of file Operator.hpp.
References Nektar::ErrorUtil::ewarning, NEKERROR, Nektar::nekGetNumDevice(), and session.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), Nektar::FilterAeroForces::FilterAeroForces(), Nektar::FilterEnergy::FilterEnergy(), Nektar::MultiRegions::Operator< TData >::GetDefaultInterleaveWidths(), LaunchProfiler(), TestAvgAssmbScatr< TData >::ReshapeInput(), TestAssmbScatr< TData >::RunTestCase(), TestExpression< TData >::RunTestCase(), TestRobin< TData >::RunTestCase(), TestMaxStdVelocity< TData >::RunTestCase(), TestNormOps< TData >::RunTestCase(), TestDirichlet< TData >::RunTestCase(), TestNeumann< TData >::RunTestCase(), TestPreconOps< TData >::RunTestCase(), TestAssmbScatr< TData >::RunTestCaseAtWidth(), TestAssmbScatr< TData >::RunTestCaseZeroDir(), and TestTimeOps< TData >::SetTestCase().
|
inlinestatic |
Return true if the session uses a Discontinuous (DG) projection.
| session | Session reader to recover the relevant SolverInfo. |
Definition at line 334 of file Operator.hpp.
References session, and Nektar::StringUtils::ToUpperCopy().
|
protected |
Names of the field components the operator was built for.
Definition at line 351 of file Operator.hpp.
Referenced by Nektar::detail::HOPressureBndCondOpImpl< ExecSpace, TData >::BuildBoundaryData(), Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::BuildBoundaryElementData(), Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::BuildPressureBoundaryData(), Nektar::MultiRegions::detail::NeuBndCondOpImpl< ExecSpace, TData >::BuildRegions(), Nektar::MultiRegions::BndCondPhysOp< TData >::GetNumComponents(), Nektar::MultiRegions::detail::AssmbScatrOpImpl< ExecSpace, TData, ZERODIR, SIGNCHANGE >::SetUpLayoutMaps(), Nektar::MultiRegions::detail::AssmbScatrOpImpl< ExecSpace, TData, ZERODIR, SIGNCHANGE >::SetUpMaps(), Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Configure(), Nektar::MultiRegions::detail::NeuBndCondOpImpl< ExecSpace, TData >::v_ExcludeUserDefinedType(), Nektar::MultiRegions::detail::DirBndCondOpImpl< ExecSpace, TData >::v_UpdateBndCoeffs(), Nektar::MultiRegions::detail::NeuBndCondOpImpl< ExecSpace, TData >::v_UpdateBndCoeffs(), and Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::ValidateAndBuildVelocityBoundaryData().
|
protected |
Data warehouse shared with the other operators on the expansion list, used to build and cache shared tables (basis matrices, mode indices, geometric factors) once.
Definition at line 355 of file Operator.hpp.
Referenced by Nektar::MultiRegions::detail::AssmbScatrOpImpl< ExecSpace, TData, ZERODIR, SIGNCHANGE >::SetUpLayoutMaps(), Nektar::MultiRegions::detail::AssmbScatrOpImpl< ExecSpace, TData, ZERODIR, SIGNCHANGE >::SetUpMaps(), Nektar::detail::EnergyOpImpl< ExecSpace, TData >::v_Apply(), and Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::v_GetBlockNormals().
|
protected |
Expansion list the operator acts on.
Definition at line 349 of file Operator.hpp.
Referenced by Nektar::MultiRegions::PhysTraceExtractOp< TData >::ApplyNormalComponent(), Nektar::MultiRegions::IProductWRTPhysNormalDerivTraceOp< TData >::ApplyVector(), Nektar::MultiRegions::IProductWRTPhysNormalDerivTraceOp< TData >::ApplyVector(), Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::BndCondPhysOpImpl(), Nektar::detail::HOPressureBndCondOpImpl< ExecSpace, TData >::BuildBoundaryData(), Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::BuildBoundaryElementData(), Nektar::detail::HOPressureBndCondOpImpl< ExecSpace, TData >::BuildBoundaryVelocityData(), Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::BuildPressureBoundaryData(), Nektar::MultiRegions::detail::NeuBndCondOpImpl< ExecSpace, TData >::BuildRegions(), Nektar::MultiRegions::detail::DirBndCondOpImpl< ExecSpace, TData >::DirBndCondOpImpl(), Nektar::EnergyOp< TData >::GetResult(), Nektar::AeroForcesOp< TData >::GetResultVector(), Nektar::MultiRegions::detail::RobBndCondOpImpl< ExecSpace, TData >::RobBndCondOpImpl(), Nektar::MultiRegions::ExpressionOp< TData >::SetExpressions(), Nektar::MultiRegions::detail::AssmbScatrOpImpl< ExecSpace, TData, ZERODIR, SIGNCHANGE >::SetUpMaps(), Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Apply(), Nektar::detail::EnergyOpImpl< ExecSpace, TData >::v_Apply(), Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Configure(), Nektar::MultiRegions::detail::NeuBndCondOpImpl< ExecSpace, TData >::v_ExcludeUserDefinedType(), and Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::ValidateAndBuildVelocityBoundaryData().