|
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Structure containing all solver-specific variables and functions. More...
#include <hypar.h>
Data Fields | |
| int | ndims |
| int | nvars |
| int * | dim_global |
| int * | dim_local |
| int | npoints_global |
| int | npoints_local |
| int | npoints_local_wghosts |
| int | ndof_nodes |
| int | ndof_cells_wghosts |
| int | size_x |
| int | ghosts |
| int | n_iter |
| int | restart_iter |
| int | my_idx |
| int | nsims |
| double | dt |
| int * | dim_global_ex |
| char | time_scheme [_MAX_STRING_SIZE_] |
| char | time_scheme_type [_MAX_STRING_SIZE_] |
| char | spatial_scheme_hyp [_MAX_STRING_SIZE_] |
| char | interp_type [_MAX_STRING_SIZE_] |
| char | SplitHyperbolicFlux [_MAX_STRING_SIZE_] |
| char | spatial_type_par [_MAX_STRING_SIZE_] |
| char | spatial_scheme_par [_MAX_STRING_SIZE_] |
| int * | index |
| double * | x |
| double * | dxinv |
| double * | u |
| double * | hyp |
| double * | par |
| double * | source |
| double * | fluxC |
| double * | uC |
| double * | fluxI |
| double * | uL |
| double * | uR |
| double * | fL |
| double * | fR |
| double * | Deriv1 |
| double * | Deriv2 |
| int | nBoundaryZones |
| void * | boundary |
| int * | isPeriodic |
| void * | time_integrator |
| int | screen_op_iter |
| int | file_op_iter |
| int | write_residual |
| char | input_mode [_MAX_STRING_SIZE_] |
| char | ip_file_type [_MAX_STRING_SIZE_] |
| char | output_mode [_MAX_STRING_SIZE_] |
| char | op_file_format [_MAX_STRING_SIZE_] |
| char | op_overwrite [_MAX_STRING_SIZE_] |
| char | plot_solution [_MAX_STRING_SIZE_] |
| char * | filename_index |
| int | index_length |
| char | solnfilename_extn [_MAX_STRING_SIZE_] |
| char | plotfilename_extn [_MAX_STRING_SIZE_] |
| char | op_fname_root [_MAX_STRING_SIZE_] |
| char | aux_op_fname_root [_MAX_STRING_SIZE_] |
| int(* | WriteOutput )(int, int, int *, double *, double *, char *, int *) |
| int(* | ApplyBoundaryConditions )(void *, void *, double *, double *, double) |
| int(* | ApplyIBConditions )(void *, void *, double *, double) |
| int(* | TimeIntegrate )(void *) |
| int(* | InterpolateInterfacesHyp )(double *, double *, double *, double *, int, int, void *, void *, int) |
| int(* | NonlinearInterp )(double *, void *, void *, double, int(*)(double *, double *, int, void *, double)) |
| int(* | SetInterpLimiterVar )(double *, double *, double *, int, void *, void *) |
| int(* | InterpolateInterfacesPar )(double *, double *, int, void *, void *) |
| int(* | FirstDerivativePar )(double *, double *, int, int, void *, void *) |
| int(* | SecondDerivativePar )(double *, double *, int, void *, void *) |
| int(* | HyperbolicFunction )(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *, double *, int, void *, double)) |
| int(* | ParabolicFunction )(double *, double *, void *, void *, double) |
| int(* | SourceFunction )(double *, double *, void *, void *, double) |
| char | model [_MAX_STRING_SIZE_] |
| void * | physics |
| double(* | ComputeCFL )(void *, void *, double, double) |
| double(* | ComputeDiffNumber )(void *, void *, double, double) |
| int(* | FFunction )(double *, double *, int, void *, double) |
| int(* | dFFunction )(double *, double *, int, void *, double) |
| int(* | FdFFunction )(double *, double *, int, void *, double) |
| int | flag_fdf_specified |
| int(* | Upwind )(double *, double *, double *, double *, double *, double *, int, void *, double) |
| int(* | UpwinddF )(double *, double *, double *, double *, double *, double *, int, void *, double) |
| int(* | UpwindFdF )(double *, double *, double *, double *, double *, double *, int, void *, double) |
| int(* | GFunction )(double *, double *, int, void *, double) |
| int(* | HFunction )(double *, double *, int, int, void *, double) |
| int(* | SFunction )(double *, double *, void *, void *, double) |
| int(* | UFunction )(double *, double *, int, void *, void *, double) |
| int(* | JFunction )(double *, double *, void *, int, int, int) |
| int(* | KFunction )(double *, double *, void *, int, int) |
| int(* | PreStage )(int, double **, void *, void *, double) |
| int(* | PostStage )(double *, void *, void *, double) |
| int(* | PreStep )(double *, void *, void *, double) |
| int(* | PostStep )(double *, void *, void *, double, int) |
| int(* | PrintStep )(void *, void *, double) |
| int(* | PhysicsOutput )(void *, void *, double) |
| int(* | PhysicsInput )(void *, void *, int, int, int *) |
| int(* | AveragingFunction )(double *, double *, double *, void *) |
| int(* | GetLeftEigenvectors )(double *, double *, void *, int) |
| int(* | GetRightEigenvectors )(double *, double *, void *, int) |
| void * | interp |
| void * | compact |
| void * | msti |
| void * | lusolver |
| double | error [3] |
| double * | ConservationError |
| char | ConservationCheck [_MAX_STRING_SIZE_] |
| double * | VolumeIntegral |
| double * | VolumeIntegralInitial |
| double * | StageBoundaryIntegral |
| double * | StepBoundaryIntegral |
| double * | TotalBoundaryIntegral |
| int(* | VolumeIntegralFunction )(double *, double *, void *, void *) |
| int(* | BoundaryIntegralFunction )(void *, void *) |
| int(* | CalculateConservationError )(void *, void *) |
| int | use_petscTS |
| double * | u0 |
| double * | uref |
| double * | rhsref |
| double * | rhs |
| double * | u_rom_predicted |
| double | rom_diff_norms [3] |
| char | op_rom_fname_root [_MAX_STRING_SIZE_] |
| int | flag_nonlinearinterp |
| int * | stride_with_ghosts |
| int * | stride_without_ghosts |
| int | count_hyp |
| int | count_par |
| int | count_sou |
| int | count_RHSFunction |
| int | count_IFunction |
| int | count_IJacobian |
| int | count_RHSJacobian |
| int | count_IJacFunction |
| int | count_RHSJacFunction |
| double * | iblank |
| char | ib_filename [_MAX_STRING_SIZE_] |
| int | flag_ib |
| void * | ib |
| int(* | IBFunction )(void *, void *, double *, double) |
| int | use_gpu |
| int | gpu_device_no |
| int | gpu_npoints_boundary_offset [3] |
| int | gpu_npoints_boundary [3] |
| int * | gpu_dim_local |
| double * | gpu_iblank |
| double * | gpu_x |
| double * | gpu_dxinv |
| double * | gpu_u |
| int | StageBoundaryBuffer_size |
| double * | StageBoundaryBuffer |
| void * | py_plt_func |
| void * | py_plt_func_args |
Structure containing all solver-specific variables and functions.
This structure contains all the variables and function pointers for the main PDE solver.
| int ndims |
| int nvars |
| int* dim_global |
Global dimensions: array of size HyPar::ndims containing the global grid size in each spatial/coordinate dimension (input - solver.inp )
| int* dim_local |
Local dimensions: array of size HyPar::ndims containing the local grid size in each spatial/coordinate dimension (computed, based on the number of processors)
| int npoints_global |
| int npoints_local |
| int npoints_local_wghosts |
Local number of grid points with ghost points (product of the [elements of dim_local + 2*HyPar::ghosts])
| int ndof_nodes |
| int ndof_cells_wghosts |
| int ghosts |
| int restart_iter |
| int my_idx |
| int nsims |
| int* dim_global_ex |
Global dimensions of exact solution, if available: if an exact/reference solution is available to compute errors, this array of size HyPar::ndims contains its global grid size in each spatial/coordinate dimension. By default, it is the same as HyPar::dim_global, unless specified otherwise in solver.inp
| char time_scheme[_MAX_STRING_SIZE_] |
| char time_scheme_type[_MAX_STRING_SIZE_] |
| char spatial_scheme_hyp[_MAX_STRING_SIZE_] |
| char interp_type[_MAX_STRING_SIZE_] |
| char SplitHyperbolicFlux[_MAX_STRING_SIZE_] |
| char spatial_type_par[_MAX_STRING_SIZE_] |
| char spatial_scheme_par[_MAX_STRING_SIZE_] |
| int* index |
a HyPar::ndims-dimensional integer array used to reference grid points
| double* x |
the coordinate vector: one 1D array containing the spatial coordinates along each dimension of the grid points, one dimension after the other. Use _GetCoordinate_ to access the spatial coordinate at a specific grid point
| double* dxinv |
| double* u |
Solution vector: the HyPar::ndims-dimensional solution vector with nvars components at each grid point is stored as a 1D array. Includes ghost points Use _ArrayIndex1D_ to calculate the index in the 1D array corresponding to a HyPar::ndims-dimensional index (i_0, i_1, i_2, ..., i_{ndims-1})
| double* hyp |
| double* par |
| double* source |
| double* fluxC |
| double* uC |
| double* fluxI |
| double* uL |
| double * uR |
| double * fL |
| double * fR |
| double* Deriv1 |
arrays to hold approximations to the first and second derivatives to a given function at grid points. Layout is same as u, hyp, par, source. Includes ghost points Array to hold approximations to the first derivative to a given function at grid points. Layout is same as u, hyp, par, source. Includes ghost points
| double * Deriv2 |
| int nBoundaryZones |
| void* boundary |
Pointer to the boundary zones: boundary zone type is defined in boundaryconditions.h
| int* isPeriodic |
Pointer to array of size HyPar::ndims: each element is 1 if the domain is periodic along that spatial dimension; zero otherwise.
| void* time_integrator |
| int screen_op_iter |
| int file_op_iter |
| int write_residual |
| char input_mode[_MAX_STRING_SIZE_] |
| char ip_file_type[_MAX_STRING_SIZE_] |
| char output_mode[_MAX_STRING_SIZE_] |
| char op_file_format[_MAX_STRING_SIZE_] |
| char op_overwrite[_MAX_STRING_SIZE_] |
| char plot_solution[_MAX_STRING_SIZE_] |
| char* filename_index |
| int index_length |
| char solnfilename_extn[_MAX_STRING_SIZE_] |
| char plotfilename_extn[_MAX_STRING_SIZE_] |
| char op_fname_root[_MAX_STRING_SIZE_] |
| char aux_op_fname_root[_MAX_STRING_SIZE_] |
| int(* WriteOutput)(int, int, int *, double *, double *, char *, int *) |
Pointer to the function to write the solution to file, assigned in InitializeSolvers()
| int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double) |
Pointer to the function to apply the physical boundary conditions to the solution, assigned in InitializeSolvers()
| int(* ApplyIBConditions)(void *, void *, double *, double) |
Pointer to the function to apply the immersed boundary conditions to the solution, assigned in InitializeSolvers()
| int(* TimeIntegrate)(void *) |
Pointer to the function to integrate the solution in time, assigned in InitializeSolvers()
| int(* InterpolateInterfacesHyp)(double *, double *, double *, double *, int, int, void *, void *, int) |
Pointer to the function to interpolate a function at the grid interfaces from the cell-centered values for the hyperbolic flux, assigned in InitializeSolvers()
| int(* NonlinearInterp)(double *, void *, void *, double, int(*)(double *, double *, int, void *, double)) |
Pointer to the function to pre-calculate the nonlinear interpolation coefficients for the hyperbolic flux interpolation, assigned in InitializeSolvers()
| int(* SetInterpLimiterVar)(double *, double *, double *, int, void *, void *) |
Pointer to the function to calculate the non-linear interpolation coefficients of the given scheme, assigned by the initialization function of the non-linear interpolation method (eg. WENOInitialize() )
| int(* InterpolateInterfacesPar)(double *, double *, int, void *, void *) |
Pointer to the function to interpolate a function at the grid interfaces from the cell-centered values for the parabolic flux (needed for a conservative 1-stage discretization), assigned in InitializeSolvers()
| int(* FirstDerivativePar)(double *, double *, int, int, void *, void *) |
Pointer to the function to calculate the cell-centered first derivative of a given function, for the evaluation of the parabolic term; assigned in InitializeSolvers()
| int(* SecondDerivativePar)(double *, double *, int, void *, void *) |
Pointer to the function to calculate the cell-centered second derivative of a given function, for the evaluation of the parabolic term; assigned in InitializeSolvers()
| int(* HyperbolicFunction)(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *,double *, int, void *, double)) |
Pointer to the function to calculate the hyperbolic term (assigned in InitializeSolvers())
| int(* ParabolicFunction)(double *, double *, void *, void *, double) |
Pointer to the function to calculate the parabolic term (assigned in InitializeSolvers())
| int(* SourceFunction)(double *, double *, void *, void *, double) |
Pointer to the function to calculate the source term (assigned in InitializeSolvers())
| char model[_MAX_STRING_SIZE_] |
| void* physics |
| double(* ComputeCFL)(void *, void *, double, double) |
Pointer to the function to calculate the CFL number (assigned in the physical model initialization called from InitializePhysics())
| double(* ComputeDiffNumber)(void *, void *, double, double) |
Pointer to the function to calculate the diffusion number (assigned in the physical model initialization called from InitializePhysics())
| int(* FFunction)(double *, double *, int, void *, double) |
Pointer to the function to calculate the hyperbolic flux function (assigned in the physical model initialization called from InitializePhysics())
| int(* dFFunction)(double *, double *, int, void *, double) |
If hyperbolic flux is split as \(f\left(u\right) = \left[f\left(u\right)-df\left(u\right)\right] + df\left(u\right)\) (see HyPar::SplitHyperbolicFlux), function to calculate \(df\left(u\right)\) (assigned in the physical model initialization called from InitializePhysics())
| int(* FdFFunction)(double *, double *, int, void *, double) |
If hyperbolic flux is split as \(f\left(u\right) = \left[f\left(u\right)-df\left(u\right)\right] + df\left(u\right)\), (see HyPar::SplitHyperbolicFlux), function to calculate \(\left[f-df\right]\left(u\right)\)(assigned in the physical model initialization called from InitializePhysics()) .
Specifying this is optional; if the physical model does not explicitly specify this, then it is computed by subtracting HyPar::dFFunction() from HyPar::FFunction().
| int flag_fdf_specified |
Flag indicating whether the physical model has explicitly specified the function to compute \(\left[f-df\right]\left(u\right)\) (HyPar::FdFFunction()) or not. Relevant if the hyperbolic flux is being partitioned.
| int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double) |
Pointer to the function to calculate the upwind interface flux, given the left- and right-biased fluxes (assigned in the physical model initialization called from InitializePhysics())
| int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double) |
Pointer to the function to calculate the upwind interface split flux \(df\left(u\right)\), given the left- and right-biased approximations (assigned in the physical model initialization called from InitializePhysics()). Relevant only if the hyperbolic flux is being partitioned as \(f\left(u\right) = \left[f\left(u\right)-df\left(u\right)\right] + df\left(u\right)\)
| int(* UpwindFdF)(double *, double *, double *, double *, double *, double *, int, void *, double) |
Pointer to the function to calculate the upwind interface split flux \(\left[f-df\right]\left(u\right)\), given its left- and right-biased approximations (assigned in the physical model initialization called from InitializePhysics()). Relevant only if the hyperbolic flux is being partitioned as \(f\left(u\right) = \left[f\left(u\right)-df\left(u\right)\right] + df\left(u\right)\) (see HyPar::SplitHyperbolicFlux, HyPar::dFFunction()), and if the split part \(\left[f-df\right]\left(u\right)\) is being specified explicitly (see HyPar::FdFFunction(), HyPar::flag_fdf_specified).
| int(* GFunction)(double *, double *, int, void *, double) |
Pointer to the function to calculate the parabolic function with no cross-derivatives (assigned in the physical model initialization called from InitializePhysics())
| int(* HFunction)(double *, double *, int, int, void *, double) |
Pointer to the function to calculate the parabolic function with cross-derivatives (assigned in the physical model initialization called from InitializePhysics())
| int(* SFunction)(double *, double *, void *, void *, double) |
Pointer to the function to calculate the source function (assigned in the physical model initialization called from InitializePhysics())
| int(* UFunction)(double *, double *, int, void *, void *, double) |
Pointer to the function to calculate the modified solution for upwinding (assigned in the physical model initialization called from InitializePhysics())
| int(* JFunction)(double *, double *, void *, int, int, int) |
Pointer to the function to calculate the flux Jacobian for a given solution state (assigned in the physical model initialization called from InitializePhysics()). The advective flux Jacobian is the Jacobian of the analytical (not spatially discretized) advective flux for a given solution state (for example, at a grid point). The size is (HyPar::nvars)^2 and the matrix is stored as a 1D array in row-major format.
| int(* KFunction)(double *, double *, void *, int, int) |
Pointer to the function to calculate the diffusion term Jacobian for a given solution state (assigned in the physical model initialization called from InitializePhysics()). The diffusion Jacobian is the Jacobian of the analytical (not spatially discretized) diffusion term for a given solution state (for example, at a grid point). The size is (HyPar::nvars)^2 and the matrix is stored as a 1D array in row-major format.
| int(* PreStage)(int, double **, void *, void *, double) |
Pointer to the function to do some pre-time-integration-stage computations, if required (assigned in the physical model initialization called from InitializePhysics())
| int(* PostStage)(double *, void *, void *, double) |
Pointer to the function to do some post-time-integration-stage computations, if required (assigned in the physical model initialization called from InitializePhysics())
| int(* PreStep)(double *, void *, void *, double) |
Pointer to the function to do some pre-time-integration-step computations, if required (assigned in the physical model initialization called from InitializePhysics())
| int(* PostStep)(double *, void *, void *, double, int) |
Pointer to the function to do some post-time-integration-step computations, if required (assigned in the physical model initialization called from InitializePhysics())
| int(* PrintStep)(void *, void *, double) |
Pointer to the function to print some physics-specific time-integration-step information, if required (assigned in the physical model initialization called from InitializePhysics())
| int(* PhysicsOutput)(void *, void *, double) |
Pointer to the function to write (to file) physics-related data that may not be a part of the solution (assigned in the physical model initialization called from InitializePhysics())
| int(* PhysicsInput)(void *, void *, int, int, int *) |
Pointer to the function to read (from file) physics-related data that may not be a part of the solution (assigned in the physical model initialization called from InitializePhysics())
| int(* AveragingFunction)(double *, double *, double *, void *) |
Pointer to the function to calculate the averaged solution state, given two solution states (assigned in the physical model initialization called from InitializePhysics())
| int(* GetLeftEigenvectors)(double *, double *, void *, int) |
Pointer to the function to calculate the left eigenvectors of the flux Jacobian for a given solution state (assigned in the physical model initialization called from InitializePhysics())
| int(* GetRightEigenvectors)(double *, double *, void *, int) |
Pointer to the function to calculate the right eigenvectors of the flux Jacobian for a given solution state (assigned in the physical model initialization called from InitializePhysics())
| void* interp |
| void* compact |
| void* msti |
| void* lusolver |
| double error[3] |
| double* ConservationError |
| char ConservationCheck[_MAX_STRING_SIZE_] |
| double* VolumeIntegral |
| double* VolumeIntegralInitial |
| double* StageBoundaryIntegral |
| double* StepBoundaryIntegral |
| double* TotalBoundaryIntegral |
| int(* VolumeIntegralFunction)(double *, double *, void *, void *) |
| int(* BoundaryIntegralFunction)(void *, void *) |
| int(* CalculateConservationError)(void *, void *) |
| double rom_diff_norms[3] |
| char op_rom_fname_root[_MAX_STRING_SIZE_] |
| int flag_nonlinearinterp |
| int* stride_with_ghosts |
| int* stride_without_ghosts |
| int count_hyp |
| int count_par |
| int count_RHSFunction |
| int count_RHSJacobian |
| int count_IJacFunction |
| int count_RHSJacFunction |
| double* iblank |
blanking array: of same size and layout as HyPar::u (but with 1 component per grid point, it has a value 1 for all valid grid points and 0 for grid points that are blanked out. It is essentially an integer array, but the declared as a double type to use functions defined for the double data type.
| char ib_filename[_MAX_STRING_SIZE_] |
| int flag_ib |
| int(* IBFunction)(void *, void *, double *, double) |
Physics-specific immersed boundary treatment function (assigned in the physical model initialization called from InitializePhysics())
| int gpu_npoints_boundary_offset[3] |
| int* gpu_dim_local |
A copy of HyPar::dim_local on GPU
| double* gpu_iblank |
A copy of HyPar::iblank on GPU
| double* gpu_dxinv |
A copy of HyPar::dxinv on GPU
| int StageBoundaryBuffer_size |
size of HyPar::StageBoundaryBuffer
| void* py_plt_func_args |