-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This object should handle constraining degrees of freedom and function spaces on a subdomain of the mesh. Eventually it will be a full-fledged PETSc DM object. For problems with mixed discretization, there will be a dMFS (multi function space) object. All fields in a dMFS will need to be discretized over a dFS and that dFS must share the same dQuotient. If this property is not satisfied, just use Barry's DMComposite. Signed-off-by: Jed Brown <jed@59A2.org>
- Loading branch information
Showing
24 changed files
with
596 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef _DOHPFS_H | ||
#define _DOHPFS_H | ||
/** | ||
* @file dohpfs.h | ||
* @author Jed Brown <jed@59A2.org> | ||
* @date Sun Sep 7 17:46:54 2008 | ||
* | ||
* @brief The function space object | ||
* | ||
* | ||
*/ | ||
|
||
#include "dohpmesh.h" | ||
#include "dohpjacobi.h" | ||
#include "dohpquotient.h" | ||
#include "petscpf.h" | ||
|
||
PETSC_EXTERN_CXX_BEGIN | ||
|
||
typedef struct _p_dFS *dFS; | ||
|
||
#define dFSType char * | ||
|
||
#define dFSCONT "cont" | ||
|
||
extern PetscCookie dFS_COOKIE; | ||
|
||
EXTERN dErr dFSCreate(MPI_Comm,dFS*); | ||
EXTERN dErr dFSSetMesh(dFS,dMesh,dMeshESH,dMeshTag); /* mesh, active set, partition tag */ | ||
EXTERN dErr dFSSetQuotient(dFS,dQuotient); /* must be defined at least on the active set and boundary facets */ | ||
EXTERN dErr dFSSetDegree(dFS,dMeshTag,dJacobi); | ||
EXTERN dErr dFSAddBdy(dFS,const char*,dMeshESH,dMeshTag,dBool,PF); /* name, facets, orientation tag, flip orientation?, normal -> constraints */ | ||
EXTERN dErr dFSSetUp(dFS); | ||
EXTERN dErr dFSSetType(dFS,const dFSType); | ||
EXTERN dErr dFSSetFromOptions(dFS); | ||
|
||
EXTERN dErr dFSDestroy(dFS); | ||
EXTERN dErr dFSView(dFS,PetscViewer); | ||
#define dFSRegisterDynamic(a,b,c,d) dFSRegister(a,b,c,d) | ||
EXTERN dErr dFSRegister(const char[],const char[],const char[],dErr(*)(dFS)); | ||
EXTERN dErr dFSRegisterAll(const char[]); | ||
EXTERN dErr dFSInitializePackage(const char[]); | ||
|
||
PETSC_EXTERN_CXX_END | ||
#endif /* _DOHPFS_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
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 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,91 +1,39 @@ | ||
#ifndef _FSIMPL_H | ||
#define _FSIMPL_H | ||
|
||
#include "dohpjacobi.h" | ||
#include "dohpfs.h" | ||
#include "src/dm/dmimpl.h" | ||
|
||
PETSC_EXTERN_CXX_BEGIN | ||
|
||
/** | ||
* There is exactly one #dRule on each element. The ops table is normally shared across the domain. | ||
* | ||
*/ | ||
struct v_dRuleOps { | ||
dErr (*view)(dRule,PetscViewer); | ||
dErr (*getSize)(dRule,dInt*,dInt*); /**< topological dimension of the space, total number of nodes */ | ||
dErr (*getNodeWeight)(dRule,dReal[],dReal[]); /**< nodes and weights in interlaced ordering, arrays must be large enough */ | ||
dErr (*getTensorNodeWeight)(dRule,dInt*,dInt[],const dReal**,const dReal**); /**< topological dimension, number of | ||
* nodes in each direction, weights in | ||
* each direction. Does not copy, may not | ||
* be implemented. */ | ||
}; | ||
|
||
#define dRuleHEADER \ | ||
struct v_dRuleOps *ops | ||
|
||
struct p_dRule { | ||
dRuleHEADER; | ||
}; | ||
extern PetscLogEvent dLOG_FSConstrain; | ||
|
||
/** | ||
* Operations required for an EFS. Defined here so that these function calls can be inlined. | ||
* | ||
*/ | ||
struct v_dEFSOps { | ||
dErr (*view)(dEFS,PetscViewer); | ||
dErr (*getSizes)(dEFS,dInt*,dInt*,dInt*); /**< topological dimension, number of interior nodes, total number of nodes */ | ||
dErr (*getTensorNodes)(dEFS,dInt*,dInt*,dReal**); | ||
dErr (*apply)(dEFS,dInt,dInt*,dScalar**restrict,const dScalar[],dScalar[],dApplyMode,InsertMode); | ||
/**< dofs/node, work length, work, modal values, nodal values */ | ||
dErr (*scatterInt)(dEFS,dInt,dInt,const dScalar[],dScalar[],InsertMode,ScatterMode); /**< dofs/node, offset of interior dofs, array, local array */ | ||
/** | ||
* @bug It's not yet clear to me how to implement this. | ||
* | ||
*/ | ||
dErr (*scatterFacet)(dEFS,dEFS,dInt*,dScalar**restrict,const dScalar[],dScalar[],InsertMode,ScatterMode); | ||
struct dFSBoundary { | ||
PF constrain; | ||
char *name; | ||
dMeshESH facets; | ||
dMeshTag orient; | ||
dBool fliporient; | ||
struct dFSBoundary *next; | ||
}; | ||
|
||
/** | ||
* This is held once for every function space on every element. This part of the implementation is not really private. | ||
* | ||
*/ | ||
#define dEFSHEADER \ | ||
struct v_dEFSOps *ops; \ | ||
dRule rule | ||
|
||
struct p_dEFS { | ||
dEFSHEADER; | ||
}; | ||
|
||
/** | ||
* Generic operations provided by a #dJacobi implementation. | ||
* | ||
*/ | ||
struct _dJacobiOps { | ||
dErr (*setup)(dJacobi); | ||
dErr (*setfromoptions)(dJacobi); | ||
dErr (*destroy)(dJacobi); | ||
dErr (*view)(dJacobi,PetscViewer); | ||
//dErr (*getrule)(dJacobi,dInt,const dInt[],dRule*,dInt*); /**< put a dRule into the output buffer */ | ||
//dErr (*getefs)(dJacobi,dInt,const dInt[],const dInt[],dEFS*,dInt*); /**< put a dEFS into the output buffer */ | ||
dErr (*getrulesize)(dJacobi,dTopology,dInt*); | ||
dErr (*getrule)(dJacobi jac,dTopology top,const dInt rsize[],dRule *rule,void **base,dInt *index); | ||
dErr (*getefs)(dJacobi jac,dTopology top,const dInt bsize[],dRule rule,dEFS *efs,void **base,dInt *index); | ||
struct _dFSOps { | ||
DMOPS(dFS) | ||
dErr (*setfromoptions)(dFS); | ||
}; | ||
|
||
/** | ||
* Private Jacobi table context. | ||
* | ||
*/ | ||
struct p_dJacobi { | ||
PETSCHEADER(struct _dJacobiOps); | ||
dInt basisdegree; /**< the maximum degree basis functions to be supported */ | ||
dInt ruleexcess; /**< the amount of over-integration to be supported */ | ||
dBool setupcalled; | ||
void *impl; /**< private implementation context */ | ||
struct _p_dFS { | ||
PETSCHEADER(struct _dFSOps); | ||
dMesh mesh; | ||
dMeshTag partition,degree; | ||
dMeshESH active; | ||
struct dFSBoundary *bdy_start; | ||
dQuotient quotient; | ||
dJacobi jacobi; | ||
dBool setupcalled; | ||
void *data; | ||
}; | ||
|
||
EXTERN dErr dJacobiCreate_Tensor(dJacobi); /* should really only be visible to dJacobiInitializePackage */ | ||
|
||
PETSC_EXTERN_CXX_END | ||
|
||
#endif |
Oops, something went wrong.