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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (show annotations)
Mon Jan 20 03:37:18 2020 UTC (4 months, 1 week ago) by uqaeller
File size: 3224 byte(s)
Updated the copyright header.


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
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-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17
18 /****************************************************************************
19
20 Assembles the system of numEqu PDEs into the stiffness matrix S and right
21 hand side F
22
23 d_dirac_{k,m} u_m and y_dirac_k
24
25 u has p.numComp 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.numComp
32 y_dirac = p.numEqu
33
34 *****************************************************************************/
35
36 #include "Assemble.h"
37 #include "Util.h"
38
39 #include <escript/index.h>
40
41 namespace finley {
42
43 template<typename Scalar>
44 void Assemble_PDE_Points(const AssembleParameters& p,
45 const escript::Data& d_dirac,
46 const escript::Data& y_dirac)
47 {
48 Scalar* F_p = NULL;
49 const Scalar zero = static_cast<Scalar>(0);
50 if (!p.F.isEmpty()) {
51 p.F.requireWrite();
52 F_p = p.F.getSampleDataRW(0, zero);
53 }
54
55 #pragma omp parallel
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 index_t rowIndex = p.row_DOF[p.elements->Nodes[INDEX2(0,e,p.NN)]];
63 if (!y_dirac.isEmpty()) {
64 const Scalar* y_dirac_p = y_dirac.getSampleDataRO(e, zero);
65 util::addScatter(1, &rowIndex, p.numEqu,
66 y_dirac_p, F_p, p.row_DOF_UpperBound);
67 }
68
69 if (!d_dirac.isEmpty()) {
70 const Scalar* d_dirac_p = d_dirac.getSampleDataRO(e, zero);
71 Assemble_addToSystemMatrix(p.S, 1, &rowIndex,
72 p.numEqu, 1, &rowIndex, p.numComp, d_dirac_p);
73 }
74 } // end color check
75 } // end element loop
76 } // end color loop
77 } // end parallel region
78 }
79
80 // instantiate our two supported versions
81 template void Assemble_PDE_Points<escript::DataTypes::real_t>(
82 const AssembleParameters& p,
83 const escript::Data& d, const escript::Data& y);
84 template void Assemble_PDE_Points<escript::DataTypes::cplx_t>(
85 const AssembleParameters& p,
86 const escript::Data& d, const escript::Data& y);
87
88 } // namespace finley
89

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26