HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
petscinterface_struct.h File Reference

Contains structure that defines the interface for time integration with PETSc (https://petsc.org/release/) More...

#include <sys/time.h>
#include <vector>
#include <string>
#include <petscsys.h>
#include <petscvec.h>
#include <petscmat.h>
#include <petscts.h>
#include <petscdmshell.h>

Go to the source code of this file.

Data Structures

struct  PETScContext
 Structure containing the variables for time-integration with PETSc. More...
 

Macros

#define _MAX_STRING_SIZE_   500
 
#define _EXPLICIT_   0
 
#define _IMPLICIT_   1
 

Detailed Description

Contains structure that defines the interface for time integration with PETSc (https://petsc.org/release/)

Author
Debojyoti Ghosh

Definition in file petscinterface_struct.h.


Data Structure Documentation

struct PETScContext

Structure containing the variables for time-integration with PETSc.

This structure contains all the variables needed to integration in time using PETSc's TS module (https://petsc.org/release/docs/manualpages/TS/index.html).

Definition at line 42 of file petscinterface_struct.h.

Data Fields
int rank

MPI rank

int nproc

number of MPI ranks

void * simobj

array of simulation objects of type SimulationObject

int nsims

number of simulation objects

PetscReal shift

The shift variable in implicit time-integration

double waqt

Current time

double t_start

Simulation time at start of step

double dt

Current dt

vector< double > stage_times

Stage times

int stage_index

Current stage

int tic

A counter variable

int npoints

Number of computational points (local), i.e., total number of grid points not counting the ghost points

int ndofs

Number of computational DOFs (local), i.e., total number of grid points times the number of vector components at each grid point.

vector< int * > points

Vector of index lists of local points in each simulation domain whose size is (HyPar::ndims+1)*PETScContext::npoints. For each point, it stores its ndims-dimensional index and its 1D index of its location in the array HyPar::u.

int * offsets

Vector offsets for each simulation domain

int flag_hyperbolic

Flag to indicate if hyperbolic term is treated implicitly or explicitly

int flag_hyperbolic_f

Flag to indicate if the split hyperbolic term (f - df) is treated implicitly or explicitly

int flag_hyperbolic_df

Flag to indicate if the split hyperbolic term df is treated implicitly or explicitly

int flag_parabolic

Flag to indicate if the parabolic term is treated implicitly or explicitly

int flag_source

Flag to indicate if the source term is treated implicitly or explicitly

int flag_use_precon

Flag to turn on preconditioning (off by default)

string precon_matrix_type

Construct or use provided PC matrix

int flag_is_linear

Flag to indicate if the system being solved for implicit time-integration is linear/nonlinear.

double jfnk_eps

\(\epsilon\) parameter for the Jacobian-free Newton-Krylov directional derivative computation

vector< double * > globalDOF

A vector of essentialy integer arrays of the same size and layout at the solutions (with ghost points) containing the global DOF index for each grid point in each simulation domain. It is declared as a double type so that its calculation can use functions defined for double-type variables.

See Also
PetscGlobalDOF()
struct timeval iter_start_time

iteration start time

struct timeval iter_end_time

iteration end time

double iter_wctime

iteration wallclock time (in seconds)

double ti_runtime

total time integration wall time (in seconds)

void * rom_interface

libROM interface

string rom_mode

ROM mode

See Also
libROMInterface::m_mode
vector< double > op_times_arr

Array of simulation times to write solution output at

Macro Definition Documentation

#define _MAX_STRING_SIZE_   500

Maximum size of character strings

Definition at line 25 of file petscinterface_struct.h.

#define _EXPLICIT_   0

Explicit time integration

Definition at line 27 of file petscinterface_struct.h.

#define _IMPLICIT_   1

Implicit time integration

Definition at line 29 of file petscinterface_struct.h.