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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (hide annotations)
Mon Jan 20 03:37:18 2020 UTC (5 months, 2 weeks ago) by uqaeller
File size: 3224 byte(s)
Updated the copyright header.


1 gross 3522
2 jfenwick 3981 /*****************************************************************************
3 gross 3522 *
4 uqaeller 6939 * Copyright (c) 2003-2020 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 gross 3522 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 gross 3522 *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13 uqaeller 6939 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14     * Development from 2019 by School of Earth and Environmental Sciences
15     **
16 jfenwick 3981 *****************************************************************************/
17 gross 3522
18 caltinay 4408 /****************************************************************************
19 gross 3522
20 caltinay 6197 Assembles the system of numEqu PDEs into the stiffness matrix S and right
21 caltinay 4408 hand side F
22 gross 3522
23 caltinay 4408 d_dirac_{k,m} u_m and y_dirac_k
24 gross 3522
25 caltinay 4408 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 gross 3522
29 caltinay 4408 Shape of the coefficients:
30 gross 3522
31 caltinay 4408 d_dirac = p.numEqu x p.numComp
32     y_dirac = p.numEqu
33 gross 3522
34 caltinay 4408 *****************************************************************************/
35 gross 3522
36     #include "Assemble.h"
37     #include "Util.h"
38    
39 caltinay 6197 #include <escript/index.h>
40    
41 caltinay 4441 namespace finley {
42    
43 caltinay 6359 template<typename Scalar>
44 caltinay 4626 void Assemble_PDE_Points(const AssembleParameters& p,
45     const escript::Data& d_dirac,
46     const escript::Data& y_dirac)
47 caltinay 4408 {
48 caltinay 6359 Scalar* F_p = NULL;
49     const Scalar zero = static_cast<Scalar>(0);
50 caltinay 6197 if (!p.F.isEmpty()) {
51 jduplessis 4704 p.F.requireWrite();
52 caltinay 6359 F_p = p.F.getSampleDataRW(0, zero);
53 jduplessis 4704 }
54 caltinay 6197
55 caltinay 4408 #pragma omp parallel
56 gross 3522 {
57 caltinay 6197 for (index_t color = p.elements->minColor; color <= p.elements->maxColor; color++) {
58 caltinay 4408 // loop over all elements
59 caltinay 4422 #pragma omp for
60 caltinay 6197 for (index_t e = 0; e < p.elements->numElements; e++) {
61     if (p.elements->Color[e] == color) {
62 caltinay 6359 index_t rowIndex = p.row_DOF[p.elements->Nodes[INDEX2(0,e,p.NN)]];
63 caltinay 4441 if (!y_dirac.isEmpty()) {
64 caltinay 6359 const Scalar* y_dirac_p = y_dirac.getSampleDataRO(e, zero);
65     util::addScatter(1, &rowIndex, p.numEqu,
66 caltinay 4408 y_dirac_p, F_p, p.row_DOF_UpperBound);
67     }
68 caltinay 6359
69 caltinay 4441 if (!d_dirac.isEmpty()) {
70 caltinay 6359 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 caltinay 4408 }
74 caltinay 4422 } // end color check
75     } // end element loop
76     } // end color loop
77 caltinay 6359 } // end parallel region
78 gross 3522 }
79 caltinay 4408
80 caltinay 6359 // 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 caltinay 4441 } // 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