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

Contents of /branches/trilinos_from_5897/dudley/src/Assemble_PDE_Points.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6090 - (show annotations)
Wed Mar 23 06:35:54 2016 UTC (3 years ago) by caltinay
File size: 2736 byte(s)
Simplified dudley PDE routines.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************
19
20 Assembles the system of numEqu PDEs into the stiffness matrix S right hand
21 side F
22
23 d_dirac_{k,m} u_m and y_dirac_k
24
25 u has p.numEqu components in a 3D domain.
26 The shape functions for test and solution must be identical and
27 row_NS == row_NN.
28
29 Shape of the coefficients:
30
31 d_dirac = p.numEqu x p.numEqu
32 y_dirac = p.numEqu
33
34
35 *****************************************************************************/
36
37 #include "Assemble.h"
38 #include "Util.h"
39
40 namespace dudley {
41
42 void Assemble_PDE_Points(const AssembleParameters& p,
43 const escript::Data& d_dirac,
44 const escript::Data& y_dirac)
45 {
46 double* F_p = NULL;
47 if (!p.F.isEmpty()) {
48 p.F.requireWrite();
49 F_p = p.F.getSampleDataRW(0);
50 }
51
52 #pragma omp parallel
53 {
54 std::vector<index_t> rowIndex(1);
55 std::vector<double> values(p.numEqu*p.numEqu);
56
57 for (index_t color = p.elements->minColor; color <= p.elements->maxColor; color++) {
58 // loop over all elements
59 #pragma omp for
60 for (index_t e = 0; e < p.elements->numElements; e++) {
61 if (p.elements->Color[e] == color) {
62 rowIndex[0] = p.DOF[p.elements->Nodes[INDEX2(0,e,p.NN)]];
63 if (!y_dirac.isEmpty()) {
64 const double* y_dirac_p = y_dirac.getSampleDataRO(e);
65 util::addScatter(1, &rowIndex[0], p.numEqu,
66 y_dirac_p, F_p, p.DOF_UpperBound);
67 }
68
69 if (!d_dirac.isEmpty()) {
70 const double* EM_S = d_dirac.getSampleDataRO(e);
71 values.assign(EM_S, EM_S+p.numEqu*p.numEqu);
72 Assemble_addToSystemMatrix(p.S, rowIndex, p.numEqu,
73 values);
74 }
75 } // end color check
76 } // end element loop
77 } // end color loop
78 } // end parallel region
79 }
80
81 } // namespace dudley
82

Properties

Name Value
svn:mergeinfo /branches/4.0fordebian/dudley/src/Assemble_PDE_Points.cpp:5567-5588 /branches/lapack2681/finley/src/Assemble_PDE_Points.cpp:2682-2741 /branches/pasowrap/dudley/src/Assemble_PDE_Points.cpp:3661-3674 /branches/py3_attempt2/dudley/src/Assemble_PDE_Points.cpp:3871-3891 /branches/restext/finley/src/Assemble_PDE_Points.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/Assemble_PDE_Points.cpp:3669-3791 /branches/stage3.0/finley/src/Assemble_PDE_Points.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/Assemble_PDE_Points.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/Assemble_PDE_Points.cpp:3517-3974 /release/3.0/finley/src/Assemble_PDE_Points.cpp:2591-2601 /release/4.0/dudley/src/Assemble_PDE_Points.cpp:5380-5406 /trunk/dudley/src/Assemble_PDE_Points.cpp:4257-4344,5898-6007 /trunk/ripley/test/python/dudley/src/Assemble_PDE_Points.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26