MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
application.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef APPLICATION_H
8#define APPLICATION_H
9
10#include <memory>
11#include <vector>
12#include "INCLUDE/maiatypes.h"
13#include "solver.h"
14
15template <MInt nDim>
16class LPT;
17class ExecutionRecipe;
18class Solver;
19template <MInt nDim>
20class CartesianGrid;
21class Coupling;
23
24template <MInt nDim>
25class Geometry;
26
27template <MInt nDim>
28class StructuredGrid;
29
38 public:
41
42 template <MInt nDim>
43 void run();
44
45 Application(const Application&) = delete;
49
50 private:
51 MInt gridType(const MString solverType);
52
53 MInt getInitialTimeStep(const MBool restartFile, const MPI_Comm comm);
54 void initTimings();
55 void collectTimingsAndSolverInformation(const MBool finalTimeStep);
56 void storeTimingsAndSolverInformation(const MBool finalTimeStep);
57 void cleanUp();
58
59 template <MInt nDim>
60 void createSolver(CartesianGrid<nDim>* grid, const MInt solverId, Geometry<nDim>* geometry, MBool* propertiesGroup,
61 MBool& isActive);
62 template <MInt nDim>
63 void createSolver(StructuredGrid<nDim>* grid, const MInt solverId, MBool* propertiesGroups, const MPI_Comm comm);
64 template <MInt nDim>
65 void createSolver(const MInt solverId, const MPI_Comm comm);
66
67 template <MInt nDim>
68 void createCoupler(MInt);
69 template <MInt nDim>
72
74
75 // variables used by the FV method
84 std::vector<std::unique_ptr<Solver>> m_solvers;
90 std::vector<std::unique_ptr<Coupling>> m_couplers;
93 // Post-processing
95 // Post-data solverId
101
102 // auto saving
103 // MInt m_noMinutesEndAutoSave = 0;
104
115 std::vector<std::vector<MFloat>> m_solverTimings{};
116 std::vector<MFloat> m_solverTimingsPrevTime{};
117 std::vector<MInt> m_solverTimingsTimeStep{};
118 std::vector<MString> m_solverTimingsNames{};
119 std::vector<std::pair<MString, MInt>> m_domainInfo{};
120};
121
122#endif
Manages the initialisation of the solvers, the methods depending to the solvers and the start of the ...
Definition: application.h:37
std::vector< MInt > m_solverTimingsTimeStep
Definition: application.h:117
MInt m_noGlobalSolverTimers
Definition: application.h:113
MInt gridType(const MString solverType)
Return the type of grid for a given solver type.
std::vector< MString > m_solverTimingsNames
Definition: application.h:118
MInt m_restartBackupInterval
The number of timesteps before executing a restart-backup.
Definition: application.h:80
MBool m_writeAllSolverTimings
Switch timings mode between ALL timings (default) and a reduced/essential timings mode.
Definition: application.h:108
std::vector< std::unique_ptr< Solver > > m_solvers
The list of solvers.
Definition: application.h:84
void cleanUp()
call cleanup functions in all solvers and couplers before returning from the application
ExecutionRecipe * createRecipe()
This function handels the creation of the execution recipe.
static MBool * readPropertiesGroups()
Reads in the properties groups.
void collectTimingsAndSolverInformation(const MBool finalTimeStep)
Collect the timings of all solvers and domain decomposition information.
MInt m_solverTimingsWriteInterval
Write interval for timings.
Definition: application.h:110
Application & operator=(const Application &)=delete
MBool m_ppAfterTS
post-processing in-solve position
Definition: application.h:100
std::vector< std::unique_ptr< Coupling > > m_couplers
The list of couplers.
Definition: application.h:90
MBool m_dualTimeStepping
Definition: application.h:76
std::vector< MFloat > m_solverTimingsPrevTime
Definition: application.h:116
MInt m_solverTimingsSampleInterval
Sampling interval for timings.
Definition: application.h:112
Application(Application &&)=delete
MInt m_noPostProcessing
The number of postprocessing solvers.
Definition: application.h:92
MInt m_maxIterations
Maximum number of iterations.
Definition: application.h:78
MBool m_initialAdaptation
Initial adaptation.
Definition: application.h:86
void createCoupler(MInt)
This function handels the creation of new couplers.
std::vector< std::vector< MFloat > > m_solverTimings
Definition: application.h:115
MBool m_displayMemoryStatistics
Memory statistics controller.
Definition: application.h:98
MInt m_noCouplers
The number of couplers.
Definition: application.h:88
MInt getInitialTimeStep(const MBool restartFile, const MPI_Comm comm)
Return the initial global time step.
Application & operator=(Application &&)=delete
MInt m_postDataSolverId
Definition: application.h:96
void storeTimingsAndSolverInformation(const MBool finalTimeStep)
Store timings for all solvers and domain decomposition information on all domains.
MInt m_noSolvers
The number of solvers.
Definition: application.h:82
std::vector< std::pair< MString, MInt > > m_domainInfo
Definition: application.h:119
MBool m_writeSolverTimings
Solver/coupler timings for performance evaluations.
Definition: application.h:106
void initTimings()
Initialize the collection of solver/coupler timings for performance evaluations.
const MInt m_maxNoSolverTimings
Definition: application.h:114
MBool m_postProcessing
Definition: application.h:94
void createSolver(CartesianGrid< nDim > *grid, const MInt solverId, Geometry< nDim > *geometry, MBool *propertiesGroup, MBool &isActive)
This function handels the creation of new solvers.
PostProcessingInterface * createPostProcessing(MInt)
This function handels the creation of the Postprocessing classes.
Application()
Gets initial data from the property file and creates the solvers and methods.
Application(const Application &)=delete
Base recipe provides public interface to Application.
Definition: lpt.h:82
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
Structured grid class.
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
bool MBool
Definition: maiatypes.h:58