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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6009 - (show annotations)
Wed Mar 2 04:13:26 2016 UTC (2 years, 11 months ago) by caltinay
File size: 1992 byte(s)
Much needed sync with trunk...

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 /* Dudley: Mesh: NodeFile */
20
21 /* copies the array newX into self->coordinates */
22
23 /****************************************************************************/
24
25 #include "NodeFile.h"
26 #include "Util.h"
27
28 namespace dudley {
29
30 void Dudley_NodeFile_setCoordinates(Dudley_NodeFile* self, const escript::Data* newX)
31 {
32 if (newX->getDataPointSize() != self->numDim) {
33 std::stringstream ss;
34 ss << "Dudley_NodeFile_setCoordinates: number of dimensions of new "
35 "coordinates has to be " << self->numDim;
36 const std::string errorMsg(ss.str());
37 throw DudleyException(errorMsg);
38 } else if (newX->getNumDataPointsPerSample() != 1 ||
39 newX->getNumSamples() != self->numNodes) {
40 std::stringstream ss;
41 ss << "Dudley_NodeFile_setCoordinates: number of given nodes must be "
42 << self->numNodes;
43 const std::string errorMsg(ss.str());
44 throw DudleyException(errorMsg);
45 } else {
46 const size_t numDim_size = self->numDim * sizeof(double);
47 Dudley_increaseStatus(self);
48 #pragma omp parallel for
49 for (index_t n = 0; n < self->numNodes; n++) {
50 memcpy(&self->Coordinates[INDEX2(0, n, self->numDim)],
51 newX->getSampleDataRO(n), numDim_size);
52 }
53 }
54 }
55
56 } // namespace dudley
57

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26