49 const std::shared_ptr<EquationSystem> &pEquation,
51 :
Filter(pSession, pEquation), m_index(-1), m_homogeneous(false), m_planes()
54 auto it = pParams.find(
"OutputFile");
55 if (it == pParams.end())
61 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
67 it = pParams.find(
"OutputFrequency");
68 ASSERTL0(it != pParams.end(),
"Missing parameter 'OutputFrequency'.");
87 "1D expansion not supported for mean filter");
90 "Homogeneous 2D expansion not supported for mean filter");
93 auto equ =
m_equ.lock();
94 ASSERTL0(equ,
"Weak pointer expired");
96 auto fluidEqu = std::dynamic_pointer_cast<FluidInterface>(equ);
97 ASSERTL0(fluidEqu,
"Mean filter is incompatible with this solver.");
109 areaField = pFields[0]->GetPlane(0);
113 areaField = pFields[0];
117 m_area = areaField->Integral(inarray);
125 std::string volname[3] = {
"length",
"area",
"volume"};
127 if (vComm->GetRank() == 0)
134 for (
int i = 0; i < pFields.size(); ++i)
162 for (i = 0; i < pFields.size(); ++i)
169 for (i = 0; i < pFields.size(); ++i)
171 avg[i] = pFields[0]->GetPlane(0)->Integral(pFields[i]->GetPhys()) *
177 for (i = 0; i < pFields.size(); ++i)
179 avg[i] = pFields[0]->Integral(pFields[i]->GetPhys());
183 for (i = 0; i < pFields.size(); ++i)
188 if (vComm->GetRank() == 0)
191 for (
int i = 0; i < pFields.size(); ++i)
204 if (pFields[0]->GetComm()->GetRank() == 0)
#define ASSERTL0(condition, msg)
NekDouble Evaluate() const
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
LibUtilities::SessionReaderSharedPtr m_session
const std::weak_ptr< EquationSystem > m_equ
std::map< std::string, std::string > ParamMap
SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pField, const NekDouble &time) override
SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pField, const NekDouble &time) override
SOLVER_UTILS_EXPORT bool v_IsTimeDependent() override
SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pField, const NekDouble &time) override
Array< OneD, unsigned int > m_planes
unsigned int m_outputFrequency
NekDouble m_homogeneousLength
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::shared_ptr< SolverUtils::EquationSystem > &pEquation, const ParamMap &pParams)
Creates an instance of this class.
std::ofstream m_outputStream
SOLVER_UTILS_EXPORT ~FilterMean() override
SOLVER_UTILS_EXPORT FilterMean(const LibUtilities::SessionReaderSharedPtr &pSession, const std::shared_ptr< EquationSystem > &pEquation, const ParamMap &pParams)
static std::string className
Name of the class.
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()