libCEED icon indicating copy to clipboard operation
libCEED copied to clipboard

PETSc BPs with tetrahedral elements

Open jedbrown opened this issue 5 years ago • 6 comments

DMPlex can read/create non-tensor meshes (see the simplex argument to DMPlexCreateBoxMesh()). PetscFEGetCellTabulation() will return the (non-tensor) tabulated basis matrices.

We should add to examples/petsc/bps.c:

  1. Add a run-time flag to pass the non-tensor representation to libCEED. This is just to measure how much we'd give up if we weren't exploiting the tensor product. I think this will sometimes be useful for comparisons, but we'll likely never want it in practice (beyond first order).
  2. Add -simplex to use a simplicial mesh.

jedbrown avatar Feb 04 '20 23:02 jedbrown

Yes, I agree that this is a good idea. I have used it in my valeria/bps-on-a-sphere branch and I think I also had it in my area example at some point (not anymore though).

valeriabarra avatar Feb 12 '20 21:02 valeriabarra

With

CEED_EXTERN int CeedBasisGetQRef(CeedBasis basis, const CeedScalar **qref);
CEED_EXTERN int CeedBasisGetQWeights(CeedBasis basis,
                                     const CeedScalar **qweight);
CEED_EXTERN int CeedBasisGetInterp(CeedBasis basis, const CeedScalar **interp);
CEED_EXTERN int CeedBasisGetInterp1D(CeedBasis basis,
                                     const CeedScalar **interp1d);
CEED_EXTERN int CeedBasisGetGrad(CeedBasis basis, const CeedScalar **grad);
CEED_EXTERN int CeedBasisGetGrad1D(CeedBasis basis, const CeedScalar **grad1d);

Now in the public API, this should be pretty easy to add a non-tensor version of the basis when one of us gets some time (haha).

jeremylt avatar Apr 17 '20 21:04 jeremylt

We added this in Ratel. Do we want someone to pull this work back over here for bps.c when they get the chance?

jeremylt avatar Feb 10 '22 17:02 jeremylt

I'd like to do that.

rezgarshakeri avatar Feb 10 '22 17:02 rezgarshakeri

Cool! Basically, RatelCreateBasisFromPlex() from this commit: https://gitlab.com/micromorph/ratel/-/merge_requests/30/diffs?commit_id=81929f94fab8b238e5142abe5a65375bfc22c72e needs to make its way back into examples/petsc/src/libceedsetup.c But doing so will probably also mean updating CeedLevelTransferSetup() to use CeedOperatorMultigridLevelCreate() as well.

Since our use of DMPlexCreateBoxMesh() is embedded deeply in bps.c, we'll probably want to add a command line flag to swap back and forth between tensor and simplex hexes. However we do it would also need to go into multigrid.c.

jeremylt avatar Feb 10 '22 17:02 jeremylt

Thanks for the instruction, I'll start probably next week.

rezgarshakeri avatar Feb 10 '22 18:02 rezgarshakeri