Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
rk4nlsm.h
1 //
2 // Created by milinda on 12/1/17.
8 //
9 
10 #ifndef SFCSORTBENCH_RK4NLSM_H
11 #define SFCSORTBENCH_RK4NLSM_H
12 
13 
14 #include "rk.h"
15 #include "fdCoefficient.h"
16 #include "oct2vtk.h"
17 #include "checkPoint.h"
18 #include "mesh.h"
19 #include <string>
20 #include <iostream>
21 #include "nlsmUtils.h"
22 #include "parameters.h"
23 #include "nlsm.h"
24 #include "rhs.h"
25 #include "test/meshTestUtils.h"
26 
27 
28 static const double RK4_C[]={1.0/6.0,1.0/3.0,1.0/3.0,1.0/6.0};
29 
30 static const double RK4_T[]={0,1.0/2.0,1.0/2.0,1.0};
31 static const double RK4_U[]={0.0,1.0/2.0,1.0/2.0,1.0};
32 
33 namespace ode
34 {
35  namespace solver
36  {
37 
38  class RK4_NLSM : public RK
39  {
40 
41  private:
42 
43  // variables for NLSM formulation.
44 
46  double ** m_uiVar;
47 
49  double ** m_uiPrevVar;
50 
52  double ** m_uiVarIm;
53 
55  double **m_uiUnzipVar;
56 
58  double **m_uiUnzipVarRHS;
59 
61  double *** m_uiStage;
62 
64  double ** m_uiConstraintVars;
65 
67  double ** m_uiUnzipConstraintVars;
68 
70  double ** m_uiSendNodeBuf;
71 
73  double ** m_uiRecvNodeBuf;
74 
76  MPI_Request ** m_uiSendReqs;
77 
79  MPI_Request ** m_uiRecvReqs;
80 
82  MPI_Status ** m_uiSendSts;
83 
85  MPI_Status ** m_uiRecvSts;
86 
87 
88 
89 
90  public:
98  RK4_NLSM(ot::Mesh *pMesh, double pTBegin, double pTEnd,double pTh);
99 
101  ~RK4_NLSM();
102 
104  void readConfigFile(const char * fName);
105 
107  void rkSolve();
108 
114  void restoreCheckPoint(const char * fNamePrefix,MPI_Comm comm);
115 
116  private:
118  void applyInitialConditions(double ** zipIn);
119 
121  void initialGridConverge();
122 
124  void reallocateMPIResources();
125 
127  void performGhostExchangeVars(double** zipIn);
128 
130  void intergridTransferVars(double **& zipIn, const ot::Mesh* pnewMesh);
131 
133  void unzipVars(double ** zipIn , double **uzipOut);
134 
136  void unzipVars_async(double ** zipIn , double **uzipOut);
137 
139  void zipVars(double** uzipIn , double** zipOut);
140 
142  void writeToVTU(double **evolZipVarIn, double ** constrZipVarIn, unsigned int numEvolVars,unsigned int numConstVars,const unsigned int * evolVarIndices, const unsigned int * constVarIndices);
143 
145  void performSingleIteration();
146 
148  void applyBoundaryConditions();
149 
153  void storeCheckPoint(const char * fNamePrefix);
154 
155 
156  };
157 
158  } // end of namespace solver
159 }// end of namespace ode
160 
161 
162 
163 
164 
165 #endif //SFCSORTBENCH_RK4NLSM_H
Definition: rk.h:21
~RK4_NLSM()
default destructor
Definition: rk4nlsm.cpp:101
Definition: mesh.h:179
void restoreCheckPoint(const char *fNamePrefix, MPI_Comm comm)
: restore rk45 solver from a given checkpoint. This will overwrite the parameters given in the origin...
Definition: rk4nlsm.cpp:1108
This file contains the base class for the Rungge-Kutta 45 Method.
Definition: rk4nlsm.h:33
void readConfigFile(const char *fName)
: read parameters related to NLSM simulation and store them in static variables defined in parameters...
void rkSolve()
: starts the rk-45 solver.
Definition: rk4nlsm.cpp:793
virtual void applyInitialConditions()
Definition: rk.h:133
Definition: rk4nlsm.h:38
RK4_NLSM(ot::Mesh *pMesh, double pTBegin, double pTEnd, double pTh)
default constructor
Definition: rk4nlsm.cpp:17