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

Contents of /branches/trilinos_from_5897/dudley/src/NodeFile_scatter.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: 2421 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 /* scatters the NodeFile in into NodeFile out using index[0:in->numNodes-1]. */
22 /* index has to be between 0 and out->numNodes-1. */
23 /* coloring is chosen for the worst case */
24
25 /****************************************************************************/
26
27 #include "NodeFile.h"
28
29 namespace dudley {
30
31 void Dudley_NodeFile_scatterEntries(dim_t n, index_t * index, index_t min_index, index_t max_index,
32 index_t * Id_out, index_t * Id_in,
33 index_t * Tag_out, index_t * Tag_in,
34 index_t * globalDegreesOfFreedom_out, index_t * globalDegreesOfFreedom_in,
35 dim_t numDim, double *Coordinates_out, double *Coordinates_in)
36 {
37 dim_t i;
38 index_t k;
39 const index_t range = max_index - min_index;
40 const size_t numDim_size = (size_t) numDim * sizeof(double);
41
42 #pragma omp parallel for private(i,k) schedule(static)
43 for (i = 0; i < n; i++) {
44 k = index[i] - min_index;
45 if ((k >= 0) && (k < range)) {
46 Id_out[k] = Id_in[i];
47 Tag_out[k] = Tag_in[i];
48 globalDegreesOfFreedom_out[k] = globalDegreesOfFreedom_in[i];
49 memcpy(&(Coordinates_out[INDEX2(0, k, numDim)]), &(Coordinates_in[INDEX2(0, i, numDim)]), numDim_size);
50 }
51 }
52 }
53
54 void Dudley_NodeFile_scatter(index_t * index, Dudley_NodeFile * in, Dudley_NodeFile * out)
55 {
56 Dudley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
57 out->Id, in->Id, out->Tag, in->Tag, out->globalDegreesOfFreedom,
58 in->globalDegreesOfFreedom, out->numDim, out->Coordinates,
59 in->Coordinates);
60 }
61
62 } // namespace dudley

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26