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

Contents of /branches/trilinos_from_5897/dudley/src/Assemble_NodeCoordinates.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: 1937 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 #include <sstream>
21
22 namespace dudley {
23
24 void Assemble_NodeCoordinates(const NodeFile* nodes, escript::Data& x)
25 {
26 if (nodes == NULL)
27 return;
28
29 const escript::DataTypes::ShapeType expectedShape(1, nodes->numDim);
30
31 if (!x.numSamplesEqual(1, nodes->getNumNodes())) {
32 throw DudleyException("Assemble_NodeCoordinates: illegal number of samples of Data object");
33 } else if (x.getFunctionSpace().getTypeCode() != DUDLEY_NODES) {
34 throw DudleyException("Assemble_NodeCoordinates: Data object is not defined on nodes.");
35 } else if (!x.actsExpanded()) {
36 throw DudleyException("Assemble_NodeCoordinates: expanded Data object expected");
37 } else if (x.getDataPointShape() != expectedShape) {
38 std::stringstream ss;
39 ss << "Assemble_NodeCoordinates: Data object of shape ("
40 << nodes->numDim << ",) expected.";
41 const std::string errorMsg(ss.str());
42 throw DudleyException(errorMsg);
43 } else {
44 const size_t dim_size = nodes->numDim * sizeof(double);
45 x.requireWrite();
46 #pragma omp parallel for
47 for (dim_t n = 0; n < nodes->getNumNodes(); n++)
48 memcpy(x.getSampleDataRW(n),
49 &nodes->Coordinates[INDEX2(0, n, nodes->numDim)], dim_size);
50 }
51 }
52
53 } // namespace dudley
54

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26