|
Nektar++
|
Integrate the squared velocity and vorticity magnitudes and the domain volume. More...
#include <EnergyOp.hpp>
Public Member Functions | |
| void | Configure (const std::vector< unsigned int > &velocityComponents) |
velocityComponents are the indices of the velocity components in the velocity field, which may hold further components. | |
| void | Apply (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient) |
| Collective: every rank must call it. | |
| void | operator() (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient) |
| Collective: as Apply(). | |
| void | SetRootOnly (const bool rootOnly) |
Reduce the results of the next Apply() to rank zero alone if rootOnly, else to every rank. | |
| TData | GetKineticEnergy () |
| Integral of the squared velocity magnitude from the last Apply(). | |
| TData | GetEnstrophy () |
| Integral of the squared vorticity magnitude from the last Apply(). | |
| TData | GetVolume () |
| Domain volume from the last Apply(). | |
Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| 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 | |
| static std::shared_ptr< EnergyOp< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="") |
Static Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| 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. | |
Static Public Attributes | |
| static const std::string | name = "Energy" |
Protected Member Functions | |
| EnergyOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components) | |
| ~EnergyOp () override=default | |
| virtual void | v_Configure (const std::vector< unsigned int > &velocityComponents)=0 |
| virtual void | v_Apply (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient)=0 |
| TData | GetResult (const unsigned int index) |
Entry index of the reduced result, read on the host. | |
Protected Attributes | |
| bool | m_rootOnly = false |
| Whether Apply() reduces the results to rank zero alone. | |
| LibUtilities::MemoryRegion< TData > | m_result |
| Reduced result of Apply(), of size resultSize, allocated by the implementation's constructor. | |
Protected Attributes inherited from Nektar::MultiRegions::Operator< TData > | |
| 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. | |
Static Protected Attributes | |
| static constexpr unsigned int | kineticEnergy = 0 |
| Indices of the integrals in m_result. | |
| static constexpr unsigned int | enstrophy = 1 |
| static constexpr unsigned int | volume = 2 |
| static constexpr unsigned int | resultSize = 3 |
| Number of entries in m_result. | |
Integrate the squared velocity and vorticity magnitudes and the domain volume.
The quadrature and the local reduction execute in the selected operator execution space, and the three integrals are reduced across the ranks in one packed buffer. The velocity gradient is an input, so that it can be shared with other consumers.
After Apply(), the getters return:
A 3DH1 expansion is integrated as a 3D one, its planes summed with their z quadrature weights; the velocity gradient then carries the homogeneous derivative, which needs more than one plane on each rank.
The two integrals carry neither the factor one half nor the division by the volume; FilterEnergy applies both.
Apply() is collective: every rank must call it. The getters read the reduced values on the host, on every rank, or on rank zero only after SetRootOnly(true), which reduces them to rank zero alone. Internally the three values are packed in m_result, at the indices kineticEnergy, enstrophy and volume.
Definition at line 75 of file EnergyOp.hpp.
|
inlineprotected |
Definition at line 150 of file EnergyOp.hpp.
|
overrideprotecteddefault |
|
inline |
Collective: every rank must call it.
Definition at line 97 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::v_Apply().
|
inline |
velocityComponents are the indices of the velocity components in the velocity field, which may hold further components.
Definition at line 91 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::v_Configure().
|
inlinestatic |
Definition at line 78 of file EnergyOp.hpp.
Referenced by Nektar::FilterEnergy::v_Initialise().
|
inline |
Integral of the squared vorticity magnitude from the last Apply().
Definition at line 125 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::enstrophy, and Nektar::EnergyOp< TData >::GetResult().
|
inline |
Integral of the squared velocity magnitude from the last Apply().
Definition at line 119 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::GetResult(), and Nektar::EnergyOp< TData >::kineticEnergy.
|
inlineprotected |
Entry index of the reduced result, read on the host.
Definition at line 166 of file EnergyOp.hpp.
References ASSERTL0, Nektar::MultiRegions::Operator< TData >::m_expansionList, and Nektar::EnergyOp< TData >::m_rootOnly.
Referenced by Nektar::EnergyOp< TData >::GetEnstrophy(), Nektar::EnergyOp< TData >::GetKineticEnergy(), and Nektar::EnergyOp< TData >::GetVolume().
|
inline |
Domain volume from the last Apply().
Definition at line 131 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::GetResult(), and Nektar::EnergyOp< TData >::volume.
|
inline |
Collective: as Apply().
Definition at line 104 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::v_Apply().
|
inline |
Reduce the results of the next Apply() to rank zero alone if rootOnly, else to every rank.
Definition at line 113 of file EnergyOp.hpp.
References Nektar::EnergyOp< TData >::m_rootOnly.
|
protectedpure virtual |
Implemented in Nektar::detail::EnergyOpImpl< ExecSpace, TData >.
Referenced by Nektar::EnergyOp< TData >::Apply(), and Nektar::EnergyOp< TData >::operator()().
|
protectedpure virtual |
Implemented in Nektar::detail::EnergyOpImpl< ExecSpace, TData >.
Referenced by Nektar::EnergyOp< TData >::Configure().
|
staticconstexprprotected |
Definition at line 139 of file EnergyOp.hpp.
Referenced by Nektar::EnergyOp< TData >::GetEnstrophy().
|
staticconstexprprotected |
Indices of the integrals in m_result.
Definition at line 138 of file EnergyOp.hpp.
Referenced by Nektar::EnergyOp< TData >::GetKineticEnergy().
|
protected |
Reduced result of Apply(), of size resultSize, allocated by the implementation's constructor.
Definition at line 148 of file EnergyOp.hpp.
Referenced by Nektar::detail::EnergyOpImpl< ExecSpace, TData >::EnergyOpImpl(), and Nektar::detail::EnergyOpImpl< ExecSpace, TData >::v_Apply().
|
protected |
Whether Apply() reduces the results to rank zero alone.
Definition at line 145 of file EnergyOp.hpp.
Referenced by Nektar::EnergyOp< TData >::GetResult(), Nektar::EnergyOp< TData >::SetRootOnly(), and Nektar::detail::EnergyOpImpl< ExecSpace, TData >::v_Apply().
|
inlinestatic |
Definition at line 87 of file EnergyOp.hpp.
|
staticconstexprprotected |
Number of entries in m_result.
Definition at line 142 of file EnergyOp.hpp.
|
staticconstexprprotected |
Definition at line 140 of file EnergyOp.hpp.
Referenced by Nektar::EnergyOp< TData >::GetVolume().