HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
InitializePhysicsData.c File Reference

Read in any arrays/data that physics model wants. More...

#include <stdio.h>
#include <simulation_object.h>

Go to the source code of this file.

Functions

int InitializePhysicsData (void *s, int idx, int nsims, int *dim_data)
 

Detailed Description

Read in any arrays/data that physics model wants.

Author
Debojyoti Ghosh

Definition in file InitializePhysicsData.c.

Function Documentation

◆ InitializePhysicsData()

int InitializePhysicsData ( void *  s,
int  idx,
int  nsims,
int *  dim_data 
)

For each simulation object, call the physics-specific function to read in any physics data that is not a part of the solution vector.

Parameters
sSimulation object of type SimulationObject
idxIndex of this simulation object
nsimsTotal number of simuations
dim_dataDimenions of physics-specific data

Definition at line 12 of file InitializePhysicsData.c.

17 {
19  HyPar *solver = &(sim->solver);
20  MPIVariables *mpi = &(sim->mpi);
21 
22  if (solver->PhysicsInput) {
23  int ierr = solver->PhysicsInput(solver, mpi, idx, nsims, dim_data);
24  if (ierr) {
25  fprintf(stderr, "Error in InitializePhysicsData():\n");
26  fprintf(stderr, " solver->PhysicsInput() returned error %d on rank %d\n",
27  ierr, mpi->rank);
28  return ierr;
29  }
30  }
31 
32  return 0;
33 }
Structure defining a simulation.
int(* PhysicsInput)(void *, void *, int, int, int *)
Definition: hypar.h:351
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
Structure of MPI-related variables.