| fffc2ff8 | 16-Jun-2016 |
Toby Isaac <tisaac@uchicago.edu> |
PetscDualSpace: added PetscDualSpaceGetSymmetries()
Each dual space describes the symmetries of its functionals as partioned by the points in the closure of its reference cell. Each symmetry is F *
PetscDualSpace: added PetscDualSpaceGetSymmetries()
Each dual space describes the symmetries of its functionals as partioned by the points in the closure of its reference cell. Each symmetry is F * P, where F is a diagonal flipping matrix (+1/-1 on the diagonal) and P is a permutation.
So get looks like
perm = perms ? (perms[pos] ? perms[pos][ornt] : NULL) : NULL; flip = flips ? (flips[pos] ? flips[pos][ornt] : NULL) : NULL;
if (sym) {for (i = 0; i < dofPerPoint; i++) {pointArray[sym[i]] = vecArray[offset + i];}} else {for (i = 0; i < dofPerPoint; i++) {pointArray[ i ] = vecArray[offset + i];}} if (flip) {for (i = 0; i < dofPerPoint; i++) {pointArray[ i ] *= flip[i];}}
And set looks like (assuming pointArray is const):
perm = perms ? (perms[pos] ? perms[pos][ornt] : NULL) : NULL; flip = flips ? (flips[pos] ? flips[pos][ornt] : NULL) : NULL;
if (sym) {for (i = 0; i < dofPerPoint; i++) {fuse(vecArray[offset + i],pointArray[sym[i]] * (flip ? flip[sym[i]] : 1.));}} else {for (i = 0; i < dofPerPoint; i++) {fuse(vecArray[offset + i],pointArray[ i ] * (flip ? flip[ i ] : 1.));}}
Having this separation is also useful for inserting element matrices: we'd like to not have to permute the element matrix before we insert it, so we can just inverse permute the indices that we sum into the matrix. But, if there is a sign flip, we would rather do that in-place on the element matrix.
I originally intended to use this directly in DMPlexVecGetClosure() and friend, but this leaves out users who arent' using PetscDS/PetscFE/PetscDualSpace. I decided it was better to come up with a way to describe symmetries in PetscSection, and use these dual space symmetries as a particular implementation.
show more ...
|
| aa1270cd | 31-Jul-2016 |
Toby Isaac <tisaac@uchicago.edu> |
Merge branch 'tisaac/dualspace-lagrange-feature-lexicographic' into tisaac/dualspace-lagrange-feature-recursive-construction
* tisaac/dualspace-lagrange-feature-lexicographic: PetscDualSpace_Lagra
Merge branch 'tisaac/dualspace-lagrange-feature-lexicographic' into tisaac/dualspace-lagrange-feature-recursive-construction
* tisaac/dualspace-lagrange-feature-lexicographic: PetscDualSpace_Lagrange: order functions now go after tuple used PetscDualSpace_Lagrange: use lexicographic order for nodes
show more ...
|