File: PetscSectionGetPointSyms.html

package info (click to toggle)
petsc 3.14.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 266,472 kB
  • sloc: ansic: 680,898; python: 33,303; cpp: 16,324; makefile: 14,022; f90: 13,731; javascript: 10,713; fortran: 9,581; sh: 1,373; xml: 619; objc: 445; csh: 192; pascal: 148; java: 13
file content (95 lines) | stat: -rw-r--r-- 7,147 bytes parent folder | download
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/PetscSection/PetscSectionGetPointSyms.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscSectionGetPointSyms</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.14.5 2021-03-03</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.14.5 v3.14.5 docs/manualpages/PetscSection/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="../PetscSection/PetscSection.html#PetscSection">PetscSection</A> under specific orientations. 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscsection.h"   
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../PetscSection/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(<A HREF="../PetscSection/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="../PetscSection/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(section,numPoints,points,&amp;perms,&amp;rots);
     for (i = 0, lOffset = 0; i &lt; 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="../PetscSection/PetscSectionGetDof.html#PetscSectionGetDof">PetscSectionGetDof</A>(section,point,&amp;dof);
       <A HREF="../PetscSection/PetscSectionGetOffset.html#PetscSectionGetOffset">PetscSectionGetOffset</A>(section,point,&amp;sOffset);

       if (perm) {for (j = 0; j &lt; dof; j++) {lArray[lOffset + perm[j]]  = sArray[sOffset + j];}}
       else      {for (j = 0; j &lt; dof; j++) {lArray[lOffset +      j ]  = sArray[sOffset + j];}}
       if (rot)  {for (j = 0; j &lt; dof; j++) {lArray[lOffset +      j ] *= rot[j];             }}
       lOffset += dof;
     }
     <A HREF="../PetscSection/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(section,numPoints,points,&amp;perms,&amp;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="../PetscSection/PetscSectionGetPointSyms.html#PetscSectionGetPointSyms">PetscSectionGetPointSyms</A>(section,numPoints,points,&amp;perms,&amp;rots);
     for (i = 0, lOffset = 0; i &lt; 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="../PetscSection/PetscSectionGetDof.html#PetscSectionGetDof">PetscSectionGetDof</A>(section,point,&amp;dof);
       <A HREF="../PetscSection/PetscSectionGetOffset.html#PetscSectionGetOffset">PetscSectionGetOffset</A>(section,point,&amp;sOff);

       if (perm) {for (j = 0; j &lt; dof; j++) {sArray[sOffset + j] += lArray[lOffset + perm[j]] * (rot ? PetscConj(rot[perm[j]]) : 1.);}}
       else      {for (j = 0; j &lt; dof; j++) {sArray[sOffset + j] += lArray[lOffset +      j ] * (rot ? PetscConj(rot[     j ]) : 1.);}}
       offset += dof;
     }
     <A HREF="../PetscSection/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(section,numPoints,points,&amp;perms,&amp;rots);
</PRE>

<P>

<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../PetscSection/PetscSectionRestorePointSyms.html#PetscSectionRestorePointSyms">PetscSectionRestorePointSyms</A>(), <A HREF="../PetscSection/PetscSectionSymCreate.html#PetscSectionSymCreate">PetscSectionSymCreate</A>(), <A HREF="../PetscSection/PetscSectionSetSym.html#PetscSectionSetSym">PetscSectionSetSym</A>(), <A HREF="../PetscSection/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/section/interface/section.c.html#PetscSectionGetPointSyms">src/vec/is/section/interface/section.c</A>
<BR><A HREF="./index.html">Index of all PetscSection 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>