fd.h File Reference

Explicit finite difference modeling framework. More...

#include "std_cpp_includes.hh"
#include "rdomain.h"
#include "exchange.h"
#include "model.h"
#include "gridio.h"
#include "iwinfo.hh"

Go to the source code of this file.

Defines

#define INCLUDE_BOUNDARY_PNTS   0
 computational domain includes the boundary points or not
#define DUAL_GRID   1
#define PRIMAL_GRID   0

Functions

bool fd_update (int ia, int iv, IWaveInfo const &ic)
int fd_isdyn (int i, IWaveInfo const &ic)
 (implemented) returns true if arg is index in rdomain of a dynamic field (i.e.
int fd_isarr (int i, IMODEL &model, IWaveInfo const &ic)
int fd_numsubsteps (IWaveInfo const &ic)
 number of substeps defined in scheme
int fd_readgrid (PARARRAY *par, FILE *stream, IMODEL *mdl, IWaveInfo const &ic)
 reads spatial grid info and records it in data members of IMODEL struct.
int fd_modelcrea (IPNT cdims, IPNT crank, PARARRAY *par, FILE *stream, IMODEL *model, IWaveInfo const &ic)
 General FD model creator (IMODEL struct), suitable for 1st order wave equations FD modeling.


Detailed Description

Explicit finite difference modeling framework.

Contains the FD_MODEL and FD_TS_PARS structs

Definition in file fd.h.


Define Documentation

#define INCLUDE_BOUNDARY_PNTS   0

computational domain includes the boundary points or not

Definition at line 30 of file fd.h.

#define DUAL_GRID   1

Definition at line 32 of file fd.h.

#define PRIMAL_GRID   0

Definition at line 33 of file fd.h.


Function Documentation

bool fd_update ( int  ia,
int  iv,
IWaveInfo const &  ic 
)

Parameters:
[in] ia - index of RARR in RDOM
[in] iv - substep number
[in] ic - iwave info object
Returns:
- true if RARR ia is updated in substep iv

int fd_isdyn ( int  i,
IWaveInfo const &  ic 
)

(implemented) returns true if arg is index in rdomain of a dynamic field (i.e.

a field updated in the simulation), else false. For example, in the constant density acoustic example, the current and previous time levels of pressure are dynamic, whereas the sound velocity is not. So isdyn(i)=1 if i=0 or 1, 0 else. May depend on spatial dimension, so same preconditions as isarr.

Preconditions: fd_model_init has been called

Postconditions: none

Parameters:
[in] fd - FD_MODEL defining scheme
[in] i - array index
Returns:
1 if i is index of dynamic field, else 0
Called in fd_modelcrea (only dynamic arrays need ghost cell augmentation) and fprint_weqn (iwave/src/model/fd.c)

int fd_isarr ( int  i,
IMODEL model,
IWaveInfo const &  ic 
)

int fd_numsubsteps ( IWaveInfo const &  ic  ) 

number of substeps defined in scheme

int fd_readgrid ( PARARRAY par,
FILE *  stream,
IMODEL mdl,
IWaveInfo const &  ic 
)

reads spatial grid info and records it in data members of IMODEL struct.

IWAVE presumes that all grids involved in the simulation are derived from a common primal grid, in one of two ways:

(1) Physical grid belonging to the data structure named first in the FIELDS array (see iwinfo.h) - this would be the non-extended axes of this grid

(2) indicates whether each non-dynamic grid is (internally) extended or not.

Precondition: all extended non-dynamic fields share the same grid, but non-dynamic grids may also be non-extended. All dynamic fields and non-dynamic non-extended fields share the same non-extended grid, derived from the primal grid.

Initializes the dynamic grid IMODEL.g (possibly extended), IMODEL.gp (non-extended, physical primal grid), also array of extend flags.

Postconditions: IMODEL.g, IMODEL.gp, and IMODEL.extd are initialized.

Parameters:
[in] par - associative array struct containing simulation parameters as key=value pairs
[in] stream - verbose output stream
[in] mdl - IMODEL struct, declared at driver level and passed as part of IWAVE struct through iwave_construct.
[in] ic - IWaveInfo struct carrying field info
Returns:
0 on successful completion, else nonzero error code
Called in iwave_construct (iwave/core/lib/iwave.c).

Implemented in iwave/core/lib/fd.cc

int fd_modelcrea ( IPNT  cdims,
IPNT  crank,
PARARRAY par,
FILE *  stream,
IMODEL model,
IWaveInfo const &  ic 
)

General FD model creator (IMODEL struct), suitable for 1st order wave equations FD modeling.

Mimics sgn_modelcrea but more general, does the following operations:

Parameters:
[in] cdims - (IPNT) cartesian grid dimensions in MPI communicator.
[in] crank - (IPNT) cartesian rank of this processor in MPI communicator.
[in] par - (PARARRAY *) parameter arrary pointer.
[in] stream - (FILE *) stream to output comments (created by driver). [out] model - (IMODEL *) IMODEL pointer.
Returns:
0 on successful completion, else error code as in base/include/utils.h.


Generated on 5 Jan 2017 for IWAVECORE by  doxygen 1.4.7