/usr/lib/petscdir/3.1/include/characteristic.h is in libpetsc3.1-dev 3.1.dfsg-11ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | /*
Defines the interface functions for the method of characteristics solvers
*/
#ifndef __PETSCCHARACTERISTICS_H
#define __PETSCCHARACTERISTICS_H
#include <petscvec.h>
#include <petscda.h>
EXTERN PetscErrorCode CharacteristicInitializePackage(const char[]);
/*S
Characteristic - Abstract PETSc object that manages method of characteristics solves
Level: beginner
Concepts: Method of characteristics
.seealso: CharacteristicCreate(), CharacteristicSetType(), CharacteristicType, SNES, TS, PC, KSP
S*/
typedef struct _p_Characteristic *Characteristic;
/*E
CharacteristicType - String with the name of a characteristics method or the creation function
with an optional dynamic library name, for example
http://www.mcs.anl.gov/petsc/lib.a:mymoccreate()
Level: beginner
.seealso: CharacteristicSetType(), Characteristic
E*/
#define CHARACTERISTICDA "da"
#define CharacteristicType char*
/* Logging support */
extern PetscCookie CHARACTERISTIC_COOKIE;
extern PetscLogEvent CHARACTERISTIC_SetUp, CHARACTERISTIC_Solve, CHARACTERISTIC_QueueSetup, CHARACTERISTIC_DAUpdate;
extern PetscLogEvent CHARACTERISTIC_HalfTimeLocal, CHARACTERISTIC_HalfTimeRemote, CHARACTERISTIC_HalfTimeExchange;
extern PetscLogEvent CHARACTERISTIC_FullTimeLocal, CHARACTERISTIC_FullTimeRemote, CHARACTERISTIC_FullTimeExchange;
/* function to wrap coordinates around boundary */
EXTERN PetscErrorCode DAMapCoordsToPeriodicDomain(DA, PetscScalar*, PetscScalar*);
EXTERN PetscErrorCode CharacteristicCreate(MPI_Comm, Characteristic *);
EXTERN PetscErrorCode CharacteristicSetType(Characteristic, const CharacteristicType);
EXTERN PetscErrorCode CharacteristicSetUp(Characteristic);
EXTERN PetscErrorCode CharacteristicSetVelocityInterpolation(Characteristic, DA, Vec, Vec, PetscInt, PetscInt[], PetscErrorCode (*)(Vec, PetscReal[], PetscInt, PetscInt[], PetscScalar[], void *), void *);
EXTERN PetscErrorCode CharacteristicSetVelocityInterpolationLocal(Characteristic, DA, Vec, Vec, PetscInt, PetscInt[], PetscErrorCode (*)(void *, PetscReal[], PetscInt, PetscInt[], PetscScalar[], void *), void *);
EXTERN PetscErrorCode CharacteristicSetFieldInterpolation(Characteristic, DA, Vec, PetscInt, PetscInt[], PetscErrorCode (*)(Vec, PetscReal[], PetscInt, PetscInt[], PetscScalar[], void *), void *);
EXTERN PetscErrorCode CharacteristicSetFieldInterpolationLocal(Characteristic, DA, Vec, PetscInt, PetscInt[], PetscErrorCode (*)(void *, PetscReal[], PetscInt, PetscInt[], PetscScalar[], void *), void *);
EXTERN PetscErrorCode CharacteristicSolve(Characteristic, PetscReal, Vec);
EXTERN PetscErrorCode CharacteristicDestroy(Characteristic);
extern PetscFList CharacteristicList;
EXTERN PetscErrorCode CharacteristicRegisterAll(const char[]);
EXTERN PetscErrorCode CharacteristicRegisterDestroy(void);
EXTERN PetscErrorCode CharacteristicRegister(const char[],const char[],const char[],PetscErrorCode (*)(Characteristic));
/*MC
CharacteristicRegisterDynamic - Adds a solver to the method of characteristics package.
Synopsis:
PetscErrorCode CharacteristicRegisterDynamic(const char *name_solver,const char *path,const char *name_create,PetscErrorCode (*routine_create)(Characteristic))
Not Collective
Input Parameters:
+ name_solver - name of a new user-defined solver
. path - path (either absolute or relative) the library containing this solver
. name_create - name of routine to create method context
- routine_create - routine to create method context
Notes:
CharacteristicRegisterDynamic() may be called multiple times to add several user-defined solvers.
If dynamic libraries are used, then the fourth input argument (routine_create)
is ignored.
Sample usage:
.vb
CharacteristicRegisterDynamic("my_solver",/home/username/my_lib/lib/libO/solaris/mylib.a,
"MySolverCreate",MySolverCreate);
.ve
Then, your solver can be chosen with the procedural interface via
$ CharacteristicSetType(ksp,"my_solver")
or at runtime via the option
$ -characteristic_type my_solver
Level: advanced
Notes: Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR},
and others of the form ${any_environmental_variable} occuring in pathname will be
replaced with appropriate values.
If your function is not being put into a shared library then use CharacteristicRegister() instead
.keywords: Characteristic, register
.seealso: CharacteristicRegisterAll(), CharacteristicRegisterDestroy()
M*/
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
#define CharacteristicRegisterDynamic(a,b,c,d) CharacteristicRegister(a,b,c,0)
#else
#define CharacteristicRegisterDynamic(a,b,c,d) CharacteristicRegister(a,b,c,d)
#endif
#endif /*__PETSCCHARACTERISTICS_H*/
|