51 const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
53 :
Filter(pSession, pEquation)
56 auto it = pParams.find(
"OutputFile");
57 if (it == pParams.end())
63 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
73 it = pParams.find(
"OutputFrequency");
74 if (it == pParams.end())
85 it = pParams.find(
"StartTime");
86 if (it == pParams.end())
112 m_spaceDim = pFields[0]->GetGraph()->GetMeshDimension();
130 if (vComm->GetRank() == 0)
134 m_session->MatchSolverInfo(
"Driver",
"Adaptive", adaptive,
false);
176 if (vComm->GetRank() == 0)
199 if (pFields[0]->GetComm()->GetRank() == 0)
237 int nq = pIntVel[0].size();
246 Vmath::Vsub(nq, pIntVel[i], 1, pUpPrev[i], 1, tmp, 1);
247 Vmath::Vmul(nq, pPhi->GetPhys(), 1, tmp, 1, tmp, 1);
250 m_Forces[i] = pPhi->Integral(tmp) / dt;
#define ASSERTL0(condition, msg)
void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
NekDouble m_spaceDim
Dimension of the fluid domain.
void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
unsigned int m_outputFrequency
void CalculateForces(const Array< OneD, Array< OneD, NekDouble > > &pIntVel, const Array< OneD, Array< OneD, NekDouble > > &pUpPrev, const MultiRegions::ExpListSharedPtr &pPhi, NekDouble time, NekDouble dt)
Determine the total force on the body defined by (note that if the shape function represents more th...
~FilterAeroForcesSPM() override
static std::string className
Name of the class.
FilterAeroForcesSPM(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const std::map< std::string, std::string > &pParams)
std::vector< std::string > m_dirNames
STL vector containing the names of the different directions.
bool v_IsTimeDependent() override
Array< OneD, NekDouble > m_Forces
Array storing the last value of the aerodynamic forces.
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
std::ofstream m_outputStream
NekDouble Evaluate() const
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
LibUtilities::SessionReaderSharedPtr m_session
std::map< std::string, std::string > ParamMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
FilterFactory & GetFilterFactory()
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.