1 | #ifndef included_ALE_Problem_Base_hh
|
---|
2 | #define included_ALE_Problem_Base_hh
|
---|
3 |
|
---|
4 | #include <sieve/DMBuilder.hh>
|
---|
5 |
|
---|
6 | #include <petscmesh_viewers.hh>
|
---|
7 | #include <petscdmmg.h>
|
---|
8 |
|
---|
9 | namespace ALE {
|
---|
10 | namespace Problem {
|
---|
11 | typedef enum {RUN_FULL, RUN_TEST, RUN_MESH} RunType;
|
---|
12 | typedef enum {NEUMANN, DIRICHLET} BCType;
|
---|
13 | typedef enum {ASSEMBLY_FULL, ASSEMBLY_STORED, ASSEMBLY_CALCULATED} AssemblyType;
|
---|
14 | typedef union {SectionReal section; Vec vec;} ExactSolType;
|
---|
15 |
|
---|
16 | #if 1
|
---|
17 | namespace Functions {
|
---|
18 | PetscScalar zero(const double x[]);
|
---|
19 | PetscScalar constant(const double x[]);
|
---|
20 | PetscScalar nonlinear_2d(const double x[]);
|
---|
21 | PetscScalar singularity_2d(const double x[]);
|
---|
22 | PetscScalar singularity_exact_2d(const double x[]);
|
---|
23 | PetscScalar singularity_exact_3d(const double x[]);
|
---|
24 | PetscScalar singularity_3d(const double x[]);
|
---|
25 | PetscScalar linear_2d(const double x[]);
|
---|
26 | PetscScalar quadratic_2d(const double x[]);
|
---|
27 | PetscScalar cubic_2d(const double x[]);
|
---|
28 | PetscScalar nonlinear_3d(const double x[]);
|
---|
29 | PetscScalar linear_3d(const double x[]);
|
---|
30 | PetscScalar quadratic_3d(const double x[]);
|
---|
31 | PetscScalar cubic_3d(const double x[]);
|
---|
32 | PetscScalar cos_x(const double x[]);
|
---|
33 |
|
---|
34 | PetscScalar linear_2d_bem(const double x[]);
|
---|
35 | PetscScalar linear_nder_2d(const double x[]);
|
---|
36 | PetscScalar quadratic_nder_2d(const double x[]);
|
---|
37 |
|
---|
38 | PetscErrorCode Function_Structured_2d(DMDALocalInfo *info, PetscScalar *x[], PetscScalar *f[], void *ctx);
|
---|
39 | PetscErrorCode Rhs_Structured_2d_FD(DMDALocalInfo *info, PetscScalar *x[], PetscScalar *f[], void *ctx);
|
---|
40 | PetscErrorCode Jac_Structured_2d_FD(DMDALocalInfo *info, PetscScalar *x[], Mat J, void *ctx);
|
---|
41 | PetscErrorCode Function_Structured_3d(DMDALocalInfo *info, PetscScalar **x[], PetscScalar **f[], void *ctx);
|
---|
42 | PetscErrorCode Rhs_Structured_3d_FD(DMDALocalInfo *info, PetscScalar **x[], PetscScalar **f[], void *ctx);
|
---|
43 | PetscErrorCode Jac_Structured_3d_FD(DMDALocalInfo *info, PetscScalar **x[], Mat J, void *ctx);
|
---|
44 | PetscErrorCode Rhs_Unstructured(::Mesh mesh, SectionReal X, SectionReal section, void *ctx);
|
---|
45 | PetscErrorCode Jac_Unstructured(::Mesh mesh, SectionReal section, Mat A, void *ctx);
|
---|
46 |
|
---|
47 | PetscErrorCode PointEvaluation(::Mesh mesh, SectionReal X, double coordsx[], double detJx, PetscScalar elemVec[]);
|
---|
48 | PetscErrorCode RhsBd_Unstructured(::Mesh mesh, SectionReal X, SectionReal section, void *ctx);
|
---|
49 | PetscErrorCode JacBd_Unstructured(::Mesh mesh, SectionReal section, Mat M, void *ctx);
|
---|
50 | }
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | typedef struct {
|
---|
54 | PetscInt debug; // The debugging level
|
---|
55 | RunType run; // The run type
|
---|
56 | PetscInt dim; // The topological mesh dimension
|
---|
57 | PetscBool reentrantMesh; // Generate a reentrant mesh?
|
---|
58 | PetscBool circularMesh; // Generate a circular mesh?
|
---|
59 | PetscBool refineSingularity; // Generate an a priori graded mesh for the poisson problem
|
---|
60 | PetscBool structured; // Use a structured mesh
|
---|
61 | PetscBool generateMesh; // Generate the unstructure mesh
|
---|
62 | PetscBool interpolate; // Generate intermediate mesh elements
|
---|
63 | PetscReal refinementLimit; // The largest allowable cell volume
|
---|
64 | char baseFilename[2048]; // The base filename for mesh files
|
---|
65 | char partitioner[2048]; // The graph partitioner
|
---|
66 | PetscScalar (*func)(const double []); // The function to project
|
---|
67 | BCType bcType; // The type of boundary conditions
|
---|
68 | PetscScalar (*exactFunc)(const double []); // The exact solution function
|
---|
69 | ExactSolType exactSol; // The discrete exact solution
|
---|
70 | ExactSolType error; // The discrete cell-wise error
|
---|
71 | AssemblyType operatorAssembly; // The type of operator assembly
|
---|
72 | double (*integrate)(const double *, const double *, const int, double (*)(const double *)); // Basis functional application
|
---|
73 | double lambda; // The parameter controlling nonlinearity
|
---|
74 | double reentrant_angle; // The angle for the reentrant corner.
|
---|
75 | } BratuOptions;
|
---|
76 |
|
---|
77 | typedef struct {
|
---|
78 | PetscInt debug; // The debugging level
|
---|
79 | RunType run; // The run type
|
---|
80 | PetscInt dim; // The topological mesh dimension
|
---|
81 | PetscBool reentrantMesh; // Generate a reentrant mesh?
|
---|
82 | PetscBool circularMesh; // Generate a circular mesh?
|
---|
83 | PetscBool refineSingularity; // Generate an a priori graded mesh for the poisson problem
|
---|
84 | PetscBool structured; // Use a structured mesh
|
---|
85 | PetscBool generateMesh; // Generate the unstructure mesh
|
---|
86 | PetscBool interpolate; // Generate intermediate mesh elements
|
---|
87 | PetscReal refinementLimit; // The largest allowable cell volume
|
---|
88 | char baseFilename[2048]; // The base filename for mesh files
|
---|
89 | char partitioner[2048]; // The graph partitioner
|
---|
90 | PetscScalar (*func)(const double []); // The function to project
|
---|
91 | BCType bcType; // The type of boundary conditions
|
---|
92 | PetscScalar (*exactDirichletFunc)(const double []); // The exact solution function for Dirichlet data
|
---|
93 | PetscScalar (*exactNeumannFunc)(const double []); // The exact solution function for Neumann data
|
---|
94 | ExactSolType exactSol; // The discrete exact solution
|
---|
95 | ExactSolType error; // The discrete cell-wise error
|
---|
96 | AssemblyType operatorAssembly; // The type of operator assembly
|
---|
97 | double (*integrate)(const double *, const double *, const int, double (*)(const double *)); // Basis functional application
|
---|
98 | double lambda; // The parameter controlling nonlinearity
|
---|
99 | double reentrant_angle; // The angle for the reentrant corner.
|
---|
100 | PetscScalar phiCoefficient; // Coefficient C for phi = {0 in interior, 0.5 on smooth boundary}
|
---|
101 | } LaplaceBEMOptions;
|
---|
102 | }
|
---|
103 | }
|
---|
104 |
|
---|
105 | #endif
|
---|