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

  ViewVC Help
Powered by ViewVC 1.1.26