Home
last modified time | relevance | path

Searched hist:fffc2ff84c6db5f18eba2c5d4a8d1460a3f2e795 (Results 1 – 2 of 2) sorted by relevance

/petsc/include/petsc/private/
H A Dpetscfeimpl.hfffc2ff84c6db5f18eba2c5d4a8d1460a3f2e795 Thu Jun 16 03:07:28 UTC 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 * 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.
/petsc/include/
H A Dpetscfe.hfffc2ff84c6db5f18eba2c5d4a8d1460a3f2e795 Thu Jun 16 03:07:28 UTC 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 * 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.