/[escript]/branches/doubleplusgood/dudley/src/Assemble_PDE_Points.cpp
ViewVC logotype

Annotation of /branches/doubleplusgood/dudley/src/Assemble_PDE_Points.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4261 - (hide annotations)
Wed Feb 27 06:09:33 2013 UTC (6 years, 3 months ago) by jfenwick
File size: 3621 byte(s)
Initial all c++ build.
But ... there are now reinterpret_cast<>'s
1 gross 3522
2 jfenwick 3981 /*****************************************************************************
3 gross 3522 *
4 jfenwick 4154 * Copyright (c) 2003-2013 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 gross 3522 *
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 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 gross 3522
16    
17 jfenwick 3981 /************************************************************************************/
18 gross 3522
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_diarc_{k,m} u_m yand _diarc_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_diarc = p.numEqu x p.numComp */
31     /* y_diarc = p.numEqu */
32    
33    
34 jfenwick 3981 /************************************************************************************/
35 gross 3522
36    
37     #include "Assemble.h"
38     #include "Util.h"
39     #ifdef _OPENMP
40     #include <omp.h>
41     #endif
42    
43    
44 jfenwick 3981 /************************************************************************************/
45 gross 3522
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