/[escript]/trunk/dudley/src/Assemble_PDE_Points.c
ViewVC logotype

Contents of /trunk/dudley/src/Assemble_PDE_Points.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4286 - (show annotations)
Thu Mar 7 04:28:11 2013 UTC (6 years, 5 months ago) by caltinay
File MIME type: text/plain
File size: 3621 byte(s)
Assorted spelling fixes.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /************************************************************************************/
18
19 /* assembles the system of numEq PDEs into the stiffness matrix S right hand side F */
20 /* the shape functions for test and solution must be identical */
21
22
23 /* d_dirac_{k,m} u_m yand _dirac_k */
24
25 /* u has p.numComp components in a 3D domain. The shape functions for test and solution must be identical */
26 /* and row_NS == row_NN */
27
28 /* Shape of the coefficients: */
29
30 /* d_dirac = p.numEqu x p.numComp */
31 /* y_dirac = p.numEqu */
32
33
34 /************************************************************************************/
35
36
37 #include "Assemble.h"
38 #include "Util.h"
39 #ifdef _OPENMP
40 #include <omp.h>
41 #endif
42
43
44 /************************************************************************************/
45
46 void Dudley_Assemble_PDE_Points(Dudley_Assemble_Parameters p,
47 Dudley_ElementFile* elements,
48 Paso_SystemMatrix* Mat, escriptDataC* F,
49 escriptDataC* d_dirac, escriptDataC* y_dirac) {
50
51 index_t color, e, row_index;
52 __const double *d_dirac_p, *y_dirac_p;
53
54 double *F_p=(requireWrite(F), getSampleDataRW(F,0)); /* use comma, to get around the mixed code and declarations thing */
55
56 #pragma omp parallel private(color, d_dirac_p, y_dirac_p)
57 {
58 for (color=elements->minColor;color<=elements->maxColor;color++) {
59 /* open loop over all elements: */
60 #pragma omp for private(e) schedule(static)
61 for(e=0;e<elements->numElements;e++){
62 if (elements->Color[e]==color) {
63
64 d_dirac_p=getSampleDataRO(d_dirac, e);
65 y_dirac_p=getSampleDataRO(y_dirac, e);
66
67 row_index=p.row_DOF[elements->Nodes[INDEX2(0,e,p.NN)]];
68
69 if (NULL!=y_dirac_p) Dudley_Util_AddScatter(1,
70 &row_index,
71 p.numEqu,
72 y_dirac_p,
73 F_p,
74 p.row_DOF_UpperBound);
75
76 if (NULL!=d_dirac_p) Dudley_Assemble_addToSystemMatrix(Mat,
77 1,
78 &row_index,
79 p.numEqu,
80 1,
81 &row_index,
82 p.numComp,
83 d_dirac_p);
84 } /* end color check */
85 } /* end element loop */
86 } /* end color loop */
87 } /* end parallel region */
88 }

  ViewVC Help
Powered by ViewVC 1.1.26