27 TSGetApplicationContext(ts,&context);
29 fprintf(stderr,
"Error in PetscPreTimeStep: Null context!\n");
33 int nsims = context->nsims;
41 TSGetStepNumber(ts,&iter);
43 TSGetTimeStep(ts,&dt);
48 double total_norm = 0.0;
49 for (
int ns = 0; ns < nsims; ns++) {
61 double local_max_cfl = -1.0, global_max_cfl = -1.0;
64 if (global_max_cfl > max_cfl) max_cfl = global_max_cfl;
85 gettimeofday(&context->iter_end_time,NULL);
87 walltime = ( (context->iter_end_time.tv_sec * 1000000 + context->iter_end_time.tv_usec)
88 - (context->iter_start_time.tv_sec * 1000000 + context->iter_start_time.tv_usec));
89 context->iter_wctime = (double) walltime / 1000000.0;
90 context->ti_runtime += context->iter_wctime;
96 printf(
"iter=%7d, t=%1.3e\n", iter, waqt);
97 printf(
" dt=%1.3E ", dt);
98 printf(
" CFL=%1.3E, ", max_cfl);
99 printf(
" norm=%1.4E\n", total_norm);
100 printf(
" wctime=%1.1E (s)\n",context->iter_wctime);
102 printf(
"iter=%7d ", iter);
103 printf(
"dt=%1.3E ", dt);
104 printf(
"t=%1.3E ", waqt);
105 printf(
"CFL=%1.3E ", max_cfl );
106 printf(
"norm=%1.4E ", total_norm);
107 printf(
"wctime: %1.1E (s) ",context->iter_wctime);
114 for (
int ns = 0; ns < nsims; ns++) {
120 printf(
" cons_err=%1.4E\n", error);
124 if (nsims == 1) printf(
"\n");
129 for(
int ns = 0; ns < nsims; ns++) {
131 if (nsims > 1) printf(
"Physics-specific output for domain %d:\n", ns);
147 for (
int ns = 0; ns < nsims; ns++) {
154 context->op_times_arr.push_back(waqt);
159 PetscFunctionReturn(0);
int(* PrintStep)(void *, void *, double)
int(* PhysicsOutput)(void *, void *, double)
Structure defining a simulation.
int MPISum_double(double *, double *, int, void *)
long sum(const std::vector< int > &a_iv)
double * ConservationError
int(* CalculateConservationError)(void *, void *)
int(* VolumeIntegralFunction)(double *, double *, void *, void *)
double(* ComputeCFL)(void *, void *, double, double)
Structure containing all solver-specific variables and functions.
char ConservationCheck[_MAX_STRING_SIZE_]
int MPIMax_double(double *, double *, int, void *)
#define _ArrayAXPY_(x, a, y, size)
int(* BoundaryIntegralFunction)(void *, void *)
int OutputSolution(void *, int, double)
Structure containing the variables for time-integration with PETSc.
int(* PostStep)(double *, void *, void *, double, int)
Structure of MPI-related variables.
int npoints_local_wghosts
INLINE double ArraySumSquarenD(int, int, int *, int, int *, double *)
int TransferVecFromPETSc(double *const, const Vec, void *, const int, const int)