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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMSWARM/DMSwarmProjectFields.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>DMSwarmProjectFields</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/DMSWARM/DMSwarmProjectFields.html "><small>Report Typos and Errors</small></a></div>
<A NAME="DMSwarmProjectFields"><H1>DMSwarmProjectFields</H1></A>
Project a set of swarm fields onto the cell <A HREF="../DM/DM.html#DM">DM</A>
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscdmswarm.h"
PETSC_EXTERN <A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../DMSWARM/DMSwarmProjectFields.html#DMSwarmProjectFields">DMSwarmProjectFields</A>(<A HREF="../DM/DM.html#DM">DM</A> dm,<A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> nfields,const char *fieldnames[],<A HREF="../Vec/Vec.html#Vec">Vec</A> **fields,<A HREF="../Sys/PetscBool.html#PetscBool">PetscBool</A> reuse)
</PRE>
Collective on <A HREF="../Vec/Vec.html#Vec">Vec</A>
<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>dm </B></TD><TD>- the DMSwarm
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nfields </B></TD><TD>- the number of swarm fields to project
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>fieldnames </B></TD><TD>- the textual names of the swarm fields to project
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>fields </B></TD><TD>- an array of <A HREF="../Vec/Vec.html#Vec">Vec</A>'s of length nfields
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>reuse </B></TD><TD>- flag indicating whether the array and contents of fields should be re-used or internally allocated
</TD></TR></TABLE>
Currently, the only available projection method consists of
phi_i = \sum_{p=0}^{np} N_i(x_p) phi_p dJ / \sum_{p=0}^{np} N_i(x_p) dJ
where phi_p is the swarm field at point p,
N_i() is the cell <A HREF="../DM/DM.html#DM">DM</A> basis function at vertex i,
dJ is the determinant of the cell Jacobian and
phi_i is the projected vertex value of the field phi.
<P>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
<P>
If reuse = <A HREF="../Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>, this function will allocate the array of <A HREF="../Vec/Vec.html#Vec">Vec</A>'s, and each individual <A HREF="../Vec/Vec.html#Vec">Vec</A>.
The user is responsible for destroying both the array and the individual <A HREF="../Vec/Vec.html#Vec">Vec</A> objects.
<P>
Only swarm fields registered with data type = PETSC_REAL can be projected onto the cell <A HREF="../DM/DM.html#DM">DM</A>.
<P>
Only swarm fields of block size = 1 can currently be projected.
<P>
The only projection methods currently only support the DA (2D) and PLEX (triangles 2D).
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../DMSWARM/DMSwarmSetType.html#DMSwarmSetType">DMSwarmSetType</A>(), <A HREF="../DMSWARM/DMSwarmSetCellDM.html#DMSwarmSetCellDM">DMSwarmSetCellDM</A>(), DMSwarmType
<BR><P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>beginner<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/dm/impls/swarm/swarmpic.c.html#DMSwarmProjectFields">src/dm/impls/swarm/swarmpic.c</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex70.c.html">src/ksp/ksp/examples/tutorials/ex70.c.html</A><BR>
<BR><A HREF="./index.html">Index of all DMSWARM 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>
|