From d3d94c8b6ee2d3875fb7e572b2158eaf139e6dfa Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 17 Dec 2020 09:21:50 +0100 Subject: [PATCH] Added path variable to set the directory where the results should be saved --- ...WaveSystem_2DFV_SphericalExplosion_MPI.cxx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/CoreFlows/examples/C/WaveSystem_2DFV_SphericalExplosion_MPI.cxx b/CoreFlows/examples/C/WaveSystem_2DFV_SphericalExplosion_MPI.cxx index ec01c85..174a851 100755 --- a/CoreFlows/examples/C/WaveSystem_2DFV_SphericalExplosion_MPI.cxx +++ b/CoreFlows/examples/C/WaveSystem_2DFV_SphericalExplosion_MPI.cxx @@ -148,7 +148,7 @@ void computeDivergenceMatrix(Mesh my_mesh, Mat * implMat, double dt) } } -void WaveSystem2D(double tmax, int ntmax, double cfl, int output_freq, const Mesh& my_mesh, const string file, int rank, int size) +void WaveSystem2D(double tmax, int ntmax, double cfl, int output_freq, const Mesh& my_mesh, const string file, int rank, int size, string resultDirectory) { /* Time iteration variables */ int it=0; @@ -221,9 +221,9 @@ void WaveSystem2D(double tmax, int ntmax, double cfl, int output_freq, const Mes cout << "Saving the solution at T=" << time <<" on processor 0"<1) PetscPrintf(PETSC_COMM_WORLD,"---- More than one processor detected : running a parallel simulation ----\n"); PetscPrintf(PETSC_COMM_WORLD,"---- Limited parallelism : input and output remain sequential ----\n"); @@ -338,6 +339,7 @@ int main(int argc, char *argv[]) cout << "- Numerical scheme : Upwind explicit scheme" << endl; cout << "- Boundary conditions : WALL" << endl; + /* Read or create mesh */ if(argc<2) { cout << "- DOMAIN : SQUARE" << endl; @@ -364,8 +366,12 @@ int main(int argc, char *argv[]) string filename = argv[1]; myMesh=Mesh(filename); } + + /*Detect directory where to same results*/ + if(argc>2) + resultDirectory = argv[2]; } - WaveSystem2D(tmax,ntmax,cfl,freqSortie,myMesh,fileOutPut, rank, size); + WaveSystem2D(tmax,ntmax,cfl,freqSortie,myMesh,fileOutPut, rank, size, resultDirectory); if(rank == 0) cout << "Simulation complete." << endl; -- 2.39.2