MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
PostProcessingController< nDim > Class Template Reference

#include <postprocessingcontroller.h>

Collaboration diagram for PostProcessingController< nDim >:
[legend]

Public Member Functions

 PostProcessingController (std::vector< PostProcessingInterface * > pp)
 
void init ()
 
void preSolve ()
 
void inSolve (MBool finalTimeStep)
 
void ppSolution ()
 
void postSolve ()
 
void setStep (const MInt step)
 

Private Member Functions

MInt noPP ()
 

Private Attributes

std::vector< PostProcessingInterface * > m_PP
 
MInt m_step = -1
 
MInt m_maxNoSteps
 
std::vector< std::vector< MBool > > m_ppOrder {}
 

Detailed Description

template<MInt nDim>
class PostProcessingController< nDim >

Definition at line 13 of file postprocessingcontroller.h.

Constructor & Destructor Documentation

◆ PostProcessingController()

template<MInt nDim>
PostProcessingController< nDim >::PostProcessingController ( std::vector< PostProcessingInterface * >  pp)

Definition at line 38 of file postprocessingcontroller.h.

38 : m_PP(pp) {
39 m_maxNoSteps = 1;
40 if(Context::propertyExists("recipeMaxNoSteps")) {
41 m_maxNoSteps = Context::getBasicProperty<MInt>("recipeMaxNoSteps", AT_, &m_maxNoSteps);
42 }
43}
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
Definition: context.cpp:494
MInt m_maxNoSteps
std::vector< PostProcessingInterface * > m_PP

Member Function Documentation

◆ init()

template<MInt nDim>
void PostProcessingController< nDim >::init

Definition at line 46 of file postprocessingcontroller.h.

46 {
47 TRACE();
48
49 m_log << "##################################################################" << std::endl;
50 m_log << "## Postprocessing ##" << std::endl;
51 m_log << "##################################################################" << std::endl << std::endl;
52
53 // read callOrder
54 m_ppOrder.resize(m_maxNoSteps, std::vector<MBool>(noPP(), true));
55 if(m_maxNoSteps > 1) {
56 for(MInt p = 0; p < noPP(); p++) {
57 const MString propName = "postprocessingOrder_" + std::to_string(p);
58 for(MInt step = 0; step < m_maxNoSteps; step++) {
59 m_ppOrder[step][p] = (MBool)Context::getBasicProperty<MInt>(propName, AT_, step);
60 }
61 }
62 }
63
64 // init Postprocessing instances
65 for(auto&& pp : m_PP) {
66 pp->mSolver()->startLoadTimer(AT_);
67 pp->initPostProcessing();
68 pp->mSolver()->stopLoadTimer(AT_);
69 }
70}
std::vector< std::vector< MBool > > m_ppOrder
MInt noPP()
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
bool MBool
Definition: maiatypes.h:58
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.

◆ inSolve()

template<MInt nDim>
void PostProcessingController< nDim >::inSolve ( MBool  finalTimeStep)

Definition at line 85 of file postprocessingcontroller.h.

85 {
86 TRACE();
87
88 for(auto&& pp : m_PP) {
89 if(m_ppOrder[m_step][pp->a_postprocessingId()]) {
90 pp->mSolver()->startLoadTimer(AT_);
91 pp->postprocessInSolve(finalTimeStep);
92 pp->mSolver()->stopLoadTimer(AT_);
93 }
94 }
95}
MInt m_step

◆ noPP()

template<MInt nDim>
MInt PostProcessingController< nDim >::noPP ( )
inlineprivate

Definition at line 34 of file postprocessingcontroller.h.

34{ return (signed)m_PP.size(); };

◆ postSolve()

template<MInt nDim>
void PostProcessingController< nDim >::postSolve

Definition at line 109 of file postprocessingcontroller.h.

109 {
110 TRACE();
111
112 for(auto&& pp : m_PP) {
113 pp->mSolver()->startLoadTimer(AT_);
114 pp->postprocessPostSolve();
115 pp->mSolver()->stopLoadTimer(AT_);
116 }
117}

◆ ppSolution()

template<MInt nDim>
void PostProcessingController< nDim >::ppSolution

Definition at line 98 of file postprocessingcontroller.h.

98 {
99 TRACE();
100
101 for(auto&& pp : m_PP) {
102 pp->mSolver()->disableDlbTimers();
103 pp->postprocessSolution();
104 pp->mSolver()->enableDlbTimers();
105 }
106}

◆ preSolve()

template<MInt nDim>
void PostProcessingController< nDim >::preSolve

Definition at line 73 of file postprocessingcontroller.h.

73 {
74 TRACE();
75
76 for(auto&& pp : m_PP) {
77 pp->mSolver()->startLoadTimer(AT_);
78 pp->postprocessPreSolve();
79 pp->mSolver()->stopLoadTimer(AT_);
80 }
81}

◆ setStep()

template<MInt nDim>
void PostProcessingController< nDim >::setStep ( const MInt  step)
inline

Definition at line 23 of file postprocessingcontroller.h.

23 {
24 m_step = (step < 0) ? 0 : step;
25 }

Member Data Documentation

◆ m_maxNoSteps

template<MInt nDim>
MInt PostProcessingController< nDim >::m_maxNoSteps
private

Definition at line 31 of file postprocessingcontroller.h.

◆ m_PP

template<MInt nDim>
std::vector<PostProcessingInterface*> PostProcessingController< nDim >::m_PP
private

Definition at line 28 of file postprocessingcontroller.h.

◆ m_ppOrder

template<MInt nDim>
std::vector<std::vector<MBool> > PostProcessingController< nDim >::m_ppOrder {}
private

Definition at line 32 of file postprocessingcontroller.h.

◆ m_step

template<MInt nDim>
MInt PostProcessingController< nDim >::m_step = -1
private

Definition at line 30 of file postprocessingcontroller.h.


The documentation for this class was generated from the following file: