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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6079 - (show annotations)
Mon Mar 21 12:22:38 2016 UTC (2 years, 11 months ago) by caltinay
File size: 2860 byte(s)
Big commit - making dudley much more like finley to make it more
managable. Fixed quite a few issues that had been fixed in finley.
Disposed of all ReducedNode/ReducedDOF entities that dudley never supported.
Compiles and passes tests.

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 #include "Assemble.h"
18 #include "Util.h"
19
20 namespace dudley {
21
22 void Assemble_integrate(const NodeFile* nodes, const ElementFile* elements,
23 const escript::Data& data, std::vector<double>& out)
24 {
25 if (!nodes || !elements)
26 return;
27
28 const int my_mpi_rank = nodes->MPIInfo->rank;
29 const ElementFile_Jacobians* jac = elements->borrowJacobians(nodes,
30 hasReducedIntegrationOrder(data));
31
32 const dim_t numQuadTotal = jac->numQuad;
33 // check the shape of the data
34 if (!data.numSamplesEqual(numQuadTotal, elements->numElements)) {
35 throw DudleyException("Assemble_integrate: illegal number of samples of integrant kernel Data object");
36 }
37
38 const int numComps = data.getDataPointSize();
39
40 for (int q = 0; q < numComps; q++)
41 out[q] = 0;
42
43 #pragma omp parallel
44 {
45 std::vector<double> out_local(numComps);
46
47 if (data.actsExpanded()) {
48 #pragma omp for
49 for (index_t e = 0; e < elements->numElements; e++) {
50 if (elements->Owner[e] == my_mpi_rank) {
51 const double vol = jac->absD[e] * jac->quadweight;
52 const double* data_array = data.getSampleDataRO(e);
53 for (int q = 0; q < numQuadTotal; q++) {
54 for (int i = 0; i < numComps; i++)
55 out_local[i] += data_array[INDEX2(i, q, numComps)] * vol;
56 }
57 }
58 }
59 } else {
60 #pragma omp for
61 for (index_t e = 0; e < elements->numElements; e++) {
62 if (elements->Owner[e] == my_mpi_rank) {
63 const double vol = jac->absD[e] * jac->quadweight;
64 const double* data_array = data.getSampleDataRO(e);
65 double rtmp = 0.;
66 for (int q = 0; q < numQuadTotal; q++)
67 rtmp += vol;
68 for (int i = 0; i < numComps; i++)
69 out_local[i] += data_array[i] * rtmp;
70 }
71 }
72 }
73 // add local results to global result
74 #pragma omp critical
75 for (int i = 0; i < numComps; i++)
76 out[i] += out_local[i];
77 }
78 }
79
80 } // namespace dudley
81

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26