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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3981 - (show annotations)
Fri Sep 21 02:47:54 2012 UTC (7 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3555 byte(s)
First pass of updating copyright notices
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2012 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 and right hand side F */
20
21 /* d_diarc_{k,m} u_m and y_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 Finley_Assemble_PDE_Points(Finley_Assemble_Parameters p,
45 Finley_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) Finley_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) Finley_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