HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
SparseGridsSetSolverParameters.cpp
Go to the documentation of this file.
1 
7 
12  const GridDimensions& a_dim_global,
13  const ProcDistribution& a_iproc,
14  const SimulationObject& a_src_sim,
15  const int a_idx,
16  const int a_nsims
17  )
18 {
19  a_dst_sim.solver.my_idx = a_idx;
20  a_dst_sim.solver.nsims = a_nsims;
21 
22  a_dst_sim.mpi.rank = m_rank;
23  a_dst_sim.mpi.nproc = m_nproc;
24 
25  a_dst_sim.solver.ndims = a_src_sim.solver.ndims;
26  a_dst_sim.solver.nvars = a_src_sim.solver.nvars;
27  a_dst_sim.solver.ghosts = a_src_sim.solver.ghosts;
28 
29  a_dst_sim.solver.dim_global = (int*) calloc (a_dst_sim.solver.ndims,sizeof(int));
30  a_dst_sim.mpi.iproc = (int*) calloc (a_dst_sim.solver.ndims,sizeof(int));
31  for (int d = 0; d < a_dst_sim.solver.ndims; d++) {
32  a_dst_sim.solver.dim_global[d] = a_dim_global[d];
33  a_dst_sim.mpi.iproc[d] = a_iproc[d];
34  }
35 
36  a_dst_sim.solver.n_iter = a_src_sim.solver.n_iter;
37  a_dst_sim.solver.restart_iter = a_src_sim.solver.restart_iter;
38 
39  strcpy(a_dst_sim.solver.time_scheme, a_src_sim.solver.time_scheme);
40  strcpy(a_dst_sim.solver.time_scheme_type, a_src_sim.solver.time_scheme_type);
41  strcpy(a_dst_sim.solver.spatial_scheme_hyp, a_src_sim.solver.spatial_scheme_hyp);
42  strcpy(a_dst_sim.solver.SplitHyperbolicFlux, a_src_sim.solver.SplitHyperbolicFlux);
43  strcpy(a_dst_sim.solver.interp_type, a_src_sim.solver.interp_type);
44  strcpy(a_dst_sim.solver.spatial_type_par, a_src_sim.solver.spatial_type_par);
45  strcpy(a_dst_sim.solver.spatial_scheme_par, a_src_sim.solver.spatial_scheme_par);
46 
47  a_dst_sim.solver.dt = a_src_sim.solver.dt;
48 
49  strcpy(a_dst_sim.solver.ConservationCheck, a_src_sim.solver.ConservationCheck);
50 
51  a_dst_sim.solver.screen_op_iter = a_src_sim.solver.screen_op_iter;
52  a_dst_sim.solver.file_op_iter = a_src_sim.solver.file_op_iter;
53 
54  strcpy(a_dst_sim.solver.op_file_format, a_src_sim.solver.op_file_format);
55  strcpy(a_dst_sim.solver.ip_file_type, a_src_sim.solver.ip_file_type);
56 
57  strcpy(a_dst_sim.solver.input_mode, a_src_sim.solver.input_mode);
58  strcpy(a_dst_sim.solver.output_mode, a_src_sim.solver.output_mode);
59  a_dst_sim.mpi.N_IORanks = a_src_sim.mpi.N_IORanks;
60 
61  strcpy(a_dst_sim.solver.op_overwrite, a_src_sim.solver.op_overwrite);
62  strcpy(a_dst_sim.solver.plot_solution, a_src_sim.solver.plot_solution);
63  strcpy(a_dst_sim.solver.model, a_src_sim.solver.model);
64  strcpy(a_dst_sim.solver.ib_filename, a_src_sim.solver.ib_filename);
65 
66  a_dst_sim.solver.flag_ib = a_src_sim.solver.flag_ib;
67 
68 #ifdef with_petsc
69  a_dst_sim.solver.use_petscTS = a_src_sim.solver.use_petscTS;
70 #endif
71 
72  return(0);
73 }
char plot_solution[_MAX_STRING_SIZE_]
Definition: hypar.h:194
char ib_filename[_MAX_STRING_SIZE_]
Definition: hypar.h:439
int nvars
Definition: hypar.h:29
Structure defining a simulation.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Definition: hypar.h:92
std::vector< int > GridDimensions
int nsims
Definition: hypar.h:64
char ip_file_type[_MAX_STRING_SIZE_]
Definition: hypar.h:180
int n_iter
Definition: hypar.h:55
int flag_ib
Definition: hypar.h:441
char output_mode[_MAX_STRING_SIZE_]
Definition: hypar.h:183
char spatial_scheme_par[_MAX_STRING_SIZE_]
Definition: hypar.h:99
int restart_iter
Definition: hypar.h:58
int use_petscTS
Definition: hypar.h:395
char input_mode[_MAX_STRING_SIZE_]
Definition: hypar.h:177
int ndims
Definition: hypar.h:26
char ConservationCheck[_MAX_STRING_SIZE_]
Definition: hypar.h:376
char spatial_scheme_hyp[_MAX_STRING_SIZE_]
Definition: hypar.h:84
char time_scheme[_MAX_STRING_SIZE_]
Definition: hypar.h:78
char op_overwrite[_MAX_STRING_SIZE_]
Definition: hypar.h:191
char interp_type[_MAX_STRING_SIZE_]
Definition: hypar.h:88
char spatial_type_par[_MAX_STRING_SIZE_]
Definition: hypar.h:96
int my_idx
Definition: hypar.h:61
std::vector< int > ProcDistribution
double dt
Definition: hypar.h:67
int SetSolverParameters(SimulationObject &, const GridDimensions &, const ProcDistribution &, const SimulationObject &, const int, const int)
char model[_MAX_STRING_SIZE_]
Definition: hypar.h:263
int ghosts
Definition: hypar.h:52
char time_scheme_type[_MAX_STRING_SIZE_]
Definition: hypar.h:81
char op_file_format[_MAX_STRING_SIZE_]
Definition: hypar.h:186
int * dim_global
Definition: hypar.h:33
int file_op_iter
Definition: hypar.h:171
int screen_op_iter
Definition: hypar.h:168