-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa2f46a
commit 7cb388d
Showing
29 changed files
with
750 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
#ifndef cloptions_h | ||
#define cloptions_h | ||
|
||
#include "../include/structs.h" | ||
|
||
// Register problems to be available on the command line | ||
PetscErrorCode RegisterProblems_Hdiv(AppCtx app_ctx); | ||
#include "structs.h" | ||
|
||
// Process general command line options | ||
PetscErrorCode ProcessCommandLineOptions(MPI_Comm comm, AppCtx app_ctx); | ||
PetscErrorCode ProcessCommandLineOptions(AppCtx app_ctx); | ||
|
||
#endif // cloptions_h |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef post_processing_h | ||
#define post_processing_h | ||
|
||
#include <ceed.h> | ||
#include <petsc.h> | ||
|
||
#include "setup-fe.h" | ||
#include "structs.h" | ||
|
||
PetscErrorCode PrintOutput(DM dm, Ceed ceed, AppCtx app_ctx, KSP ksp, Vec X, CeedScalar l2_error_u); | ||
|
||
#endif // post_processing_h |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef register_problem_h | ||
#define register_problem_h | ||
|
||
#include "structs.h" | ||
|
||
// Register problems to be available on the command line | ||
PetscErrorCode RegisterProblems_Hdiv(AppCtx app_ctx); | ||
|
||
// ----------------------------------------------------------------------------- | ||
// Set up problems function prototype | ||
// ----------------------------------------------------------------------------- | ||
// 1) poisson-quad2d | ||
PetscErrorCode Hdiv_POISSON_MASS2D(ProblemData problem_data, void *ctx); | ||
|
||
// 2) poisson-hex3d | ||
PetscErrorCode Hdiv_POISSON_MASS3D(ProblemData problem_data, void *ctx); | ||
|
||
#endif // register_problem_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef setupfe_h | ||
#define setupfe_h | ||
|
||
#include <ceed.h> | ||
#include <petsc.h> | ||
#include <petscdmplex.h> | ||
#include <petscsys.h> | ||
|
||
#include "structs.h" | ||
|
||
// --------------------------------------------------------------------------- | ||
// Setup H(div) FE space | ||
// --------------------------------------------------------------------------- | ||
CeedMemType MemTypeP2C(PetscMemType mtype); | ||
PetscErrorCode SetupFEHdiv(AppCtx app_ctx, ProblemData problem_data, DM dm); | ||
CeedElemTopology ElemTopologyP2C(DMPolytopeType cell_type); | ||
PetscInt Involute(PetscInt i); | ||
PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr); | ||
PetscErrorCode CreateRestrictionFromPlexOriented(Ceed ceed, DM dm, CeedInt P, CeedElemRestriction *elem_restr_oriented); | ||
#endif // setupfe_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
#ifndef setuplibceed_h | ||
#define setuplibceed_h | ||
|
||
#include "../include/structs.h" | ||
#include "setup-fe.h" | ||
#include "structs.h" | ||
|
||
// Convert PETSc MemType to libCEED MemType | ||
CeedMemType MemTypeP2C(PetscMemType mtype); | ||
// Destroy libCEED objects | ||
PetscErrorCode CeedDataDestroy(CeedData ceed_data); | ||
// Utility function - essential BC dofs are encoded in closure indices as -(i+1) | ||
PetscInt Involute(PetscInt i); | ||
// Utility function to create local CEED restriction from DMPlex | ||
PetscErrorCode CreateRestrictionFromPlex(Ceed ceed, DM dm, CeedInt height, DMLabel domain_label, CeedInt value, CeedElemRestriction *elem_restr); | ||
// Utility function to create local CEED Oriented restriction from DMPlex | ||
PetscErrorCode CreateRestrictionFromPlexOriented(Ceed ceed, DM dm, CeedInt P, CeedElemRestriction *elem_restr_oriented); | ||
// Set up libCEED for a given degree | ||
PetscErrorCode SetupLibceed(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData *problem_data, PetscInt U_g_size, PetscInt U_loc_size, CeedData ceed_data, | ||
CeedVector rhs_ceed, CeedVector *target); | ||
PetscErrorCode SetupLibceed(DM dm, Ceed ceed, AppCtx app_ctx, ProblemData problem_data, CeedData ceed_data, CeedVector rhs_ceed, CeedVector *target); | ||
#endif // setuplibceed_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef setup_matops_h | ||
#define setup_matops_h | ||
|
||
#include <ceed.h> | ||
#include <petsc.h> | ||
|
||
#include "setup-fe.h" | ||
#include "structs.h" | ||
|
||
PetscErrorCode ApplyLocalCeedOp(Vec X, Vec Y, OperatorApplyContext op_apply_ctx); | ||
PetscErrorCode ApplyAddLocalCeedOp(Vec X, Vec Y, OperatorApplyContext op_apply_ctx); | ||
|
||
#endif // setup_matops_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef setup_solvers_h | ||
#define setup_solvers_h | ||
|
||
#include <ceed.h> | ||
#include <petsc.h> | ||
|
||
#include "petscvec.h" | ||
#include "structs.h" | ||
|
||
PetscErrorCode SetupResidualOperatorCtx(DM dm, Ceed ceed, CeedData ceed_data, OperatorApplyContext ctx_residual); | ||
PetscErrorCode SetupErrorOperatorCtx(DM dm, Ceed ceed, CeedData ceed_data, OperatorApplyContext ctx_error_u); | ||
PetscErrorCode ApplyMatOp(Mat A, Vec X, Vec Y); | ||
PetscErrorCode PDESolver(CeedData ceed_data, AppCtx app_ctx, KSP ksp, Vec rhs, Vec *X); | ||
PetscErrorCode ComputeL2Error(Vec X, PetscScalar *l2_error, OperatorApplyContext op_error_ctx); | ||
PetscErrorCode ComputeError(Vec X, CeedVector target, CeedScalar *l2_error, OperatorApplyContext op_error_ctx); | ||
PetscErrorCode CtxVecDestroy(ProblemData problem_data, AppCtx app_ctx); | ||
#endif // setup_solvers_h |
Oops, something went wrong.