1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/IS/PetscSectionGetPointSyms.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscSectionGetPointSyms</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.10.3 2018-12-18</b></div>
<div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.10.3 v3.10.3 docs/manualpages/IS/PetscSectionGetPointSyms.html "><small>Report Typos and Errors</small></a></div>
<A NAME="PetscSectionGetPointSyms"><H1>PetscSectionGetPointSyms</H1></A>
Get the symmetries for a set of points in a <A HREF="../IS/PetscSection.html#PetscSection">PetscSection</A> under specific orientations.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h"
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../IS/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(<A HREF="../IS/PetscSection.html#PetscSection">PetscSection</A> section, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> numPoints, const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> *points, const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> ***perms, const <A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> ***rots)
</PRE>
Not collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>section </B></TD><TD>- the section
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>numPoints </B></TD><TD>- the number of points
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>points </B></TD><TD>- an array of size 2 * numPoints, containing a list of (point, orientation) pairs. (An orientation is an
arbitrary integer: its interpretation is up to sym. Orientations are used by <A HREF="../DM/DM.html#DM">DM</A>: for their interpretation in that
context, see <A HREF="../DMPLEX/DMPlexGetConeOrientation.html#DMPlexGetConeOrientation">DMPlexGetConeOrientation</A>()).
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>perms </B></TD><TD>- The permutations for the given orientations (or NULL if there is no symmetry or the permutation is the identity).
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>rots </B></TD><TD>- The field rotations symmetries for the given orientations (or NULL if there is no symmetry or the rotations are all
identity).
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Example of usage, gathering dofs into a local array (lArray) from a section array (sArray)</FONT></H3>
<PRE>
const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> **perms;
const <A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> **rots;
<A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> lOffset;
<A HREF="../IS/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(section,numPoints,points,&perms,&rots);
for (i = 0, lOffset = 0; i < numPoints; i++) {
<A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> point = points[2*i], dof, sOffset;
const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> *perm = perms ? perms[i] : NULL;
const <A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> *rot = rots ? rots[i] : NULL;
<A HREF="../IS/PetscSectionGetDof.html#PetscSectionGetDof">PetscSectionGetDof</A>(section,point,&dof);
<A HREF="../IS/PetscSectionGetOffset.html#PetscSectionGetOffset">PetscSectionGetOffset</A>(section,point,&sOffset);
if (perm) {for (j = 0; j < dof; j++) {lArray[lOffset + perm[j]] = sArray[sOffset + j];}}
else {for (j = 0; j < dof; j++) {lArray[lOffset + j ] = sArray[sOffset + j];}}
if (rot) {for (j = 0; j < dof; j++) {lArray[lOffset + j ] *= rot[j]; }}
lOffset += dof;
}
<A HREF="../IS/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(section,numPoints,points,&perms,&rots);
</PRE>
<P>
<H3><FONT COLOR="#CC3333">Example of usage, adding dofs into a section array (sArray) from a local array (lArray)</FONT></H3>
<PRE>
const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> **perms;
const <A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> **rots;
<A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> lOffset;
<A HREF="../IS/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(section,numPoints,points,&perms,&rots);
for (i = 0, lOffset = 0; i < numPoints; i++) {
<A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> point = points[2*i], dof, sOffset;
const <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> *perm = perms ? perms[i] : NULL;
const <A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> *rot = rots ? rots[i] : NULL;
<A HREF="../IS/PetscSectionGetDof.html#PetscSectionGetDof">PetscSectionGetDof</A>(section,point,&dof);
<A HREF="../IS/PetscSectionGetOffset.html#PetscSectionGetOffset">PetscSectionGetOffset</A>(section,point,&sOff);
if (perm) {for (j = 0; j < dof; j++) {sArray[sOffset + j] += lArray[lOffset + perm[j]] * (rot ? PetscConj(rot[perm[j]]) : 1.);}}
else {for (j = 0; j < dof; j++) {sArray[sOffset + j] += lArray[lOffset + j ] * (rot ? PetscConj(rot[ j ]) : 1.);}}
offset += dof;
}
<A HREF="../IS/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(section,numPoints,points,&perms,&rots);
</PRE>
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../IS/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(), <A HREF="../IS/PetscSectionSymCreate.html#PetscSectionSymCreate">PetscSectionSymCreate</A>(), <A HREF="../IS/PetscSectionSetSym.html#PetscSectionSetSym">PetscSectionSetSym</A>(), <A HREF="../IS/PetscSectionGetSym.html#PetscSectionGetSym">PetscSectionGetSym</A>()
<BR><P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>developer<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/vec/is/utils/vsectionis.c.html#PetscSectionGetPointSyms">src/vec/is/utils/vsectionis.c</A>
<BR><A HREF="./index.html">Index of all IS routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|