Actual source code: petscgll.h

petsc-3.11.4 2019-09-28
Report Typos and Errors
  1: #ifndef PETSCGLL_H
  2: #define PETSCGLL_H
  3:  #include <petscsys.h>

  5: /*S
  6:     PetscGLL  - the locations, from [-1,1] and weights of the Gauss-Lobatto-Legendre nodes of a given size

  8:   Level: beginner

 10:   These values are usful in implementing spectral methods based on the Gauss-Lobatto-Legendre nodes

 12:   The array nodes[] contains the vertices of each node
 13:   The array weights[] are the integration weights

 15:   The mass matrix for the element corresponds to the diagonal matrix whose entries are the weights[]

 17:   Developer Notes:
 18:     This may eventually get merged into a more abstract or general object for managing
 19:     integration schemes or discretization schemes.

 21:   References: XXXX

 23: .seealso: PetscGLLCreate(), PetscGLLDestroy(), PetscGLLView()
 24: S*/
 25: typedef struct {
 26:   PetscInt  n;
 27:   PetscReal *nodes;
 28:   PetscReal *weights;
 29: } PetscGLL;

 31: /*E
 32:   PetscGLLCreateType - algorithm used to compute the GLL nodes and weights

 34:   Level: beginner

 36: $  PETSCGLL_VIA_LINEARALGEBRA - compute the nodes via linear algebra
 37: $  PETSCGLL_VIA_NEWTON - compute the nodes by solving a nonlinear equation with Newton's method

 39: .seealso: PetscGLL, PetscGLLCreate()
 40: E*/
 41: typedef enum {PETSCGLL_VIA_LINEARALGEBRA,PETSCGLL_VIA_NEWTON} PetscGLLCreateType;

 43: #endif
 44: PETSC_EXTERN PetscErrorCode PetscGLLCreate(PetscInt,PetscGLLCreateType,PetscGLL*);
 45: PETSC_EXTERN PetscErrorCode PetscGLLDestroy(PetscGLL*);
 46: PETSC_EXTERN PetscErrorCode PetscGLLView(PetscGLL*,PetscViewer);
 47: PETSC_EXTERN PetscErrorCode PetscGLLIntegrate(PetscGLL*,const PetscReal*,PetscReal*);
 48: PETSC_EXTERN PetscErrorCode PetscGLLElementLaplacianCreate(PetscGLL*,PetscReal***);
 49: PETSC_EXTERN PetscErrorCode PetscGLLElementLaplacianDestroy(PetscGLL*,PetscReal***);
 50: PETSC_EXTERN PetscErrorCode PetscGLLElementGradientCreate(PetscGLL*,PetscReal***,PetscReal***);
 51: PETSC_EXTERN PetscErrorCode PetscGLLElementGradientDestroy(PetscGLL*,PetscReal***,PetscReal***);
 52: PETSC_EXTERN PetscErrorCode PetscGLLElementAdvectionCreate(PetscGLL*,PetscReal***);
 53: PETSC_EXTERN PetscErrorCode PetscGLLElementAdvectionDestroy(PetscGLL*,PetscReal***);

 55: PETSC_EXTERN PetscErrorCode PetscGLLElementMassCreate(PetscGLL*,PetscReal***);
 56: PETSC_EXTERN PetscErrorCode PetscGLLElementMassDestroy(PetscGLL*,PetscReal***);