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

Contents of /branches/trilinos_from_5897/dudley/src/Mesh_prepare.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: 3195 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 "Mesh.h"
18
19 namespace dudley {
20
21 /// prepares the mesh for further use
22 void Mesh::prepare(bool optimize)
23 {
24 // first step is to distribute the elements according to a global
25 // distribution of DOF
26 std::vector<index_t> distribution(MPIInfo->size+1);
27
28 // first we create dense labeling for the DOFs
29 dim_t newGlobalNumDOFs = Nodes->createDenseDOFLabeling();
30
31 // create a distribution of the global DOFs and determine the MPI rank
32 // controlling the DOFs on this processor
33 MPIInfo->setDistribution(0, newGlobalNumDOFs - 1, &distribution[0]);
34
35 // now the mesh is re-distributed according to the distribution vector
36 // this will redistribute the Nodes and Elements including overlap and
37 // will create an element colouring but will not create any mappings
38 // (see later in this function)
39 distributeByRankOfDOF(distribution);
40
41 // at this stage we are able to start an optimization of the DOF
42 // distribution using ParaMetis. On return distribution is altered and
43 // new DOF IDs have been assigned
44 if (optimize && MPIInfo->size > 1) {
45 optimizeDOFDistribution(distribution);
46 distributeByRankOfDOF(distribution);
47 }
48 // the local labelling of the degrees of freedom is optimized
49 if (optimize) {
50 optimizeDOFLabeling(distribution);
51 }
52
53 // rearrange elements with the aim of bringing elements closer to memory
54 // locations of the nodes (distributed shared memory!):
55 optimizeElementOrdering();
56
57 // create the global indices
58 std::vector<index_t> node_distribution(MPIInfo->size + 1);
59
60 Nodes->createDenseNodeLabeling(node_distribution, distribution);
61 // create the missing mappings
62 Nodes->createNodeMappings(distribution, node_distribution);
63
64 updateTagList();
65 }
66
67 /// tries to reduce the number of colours for all element files
68 void Mesh::createColoring(const index_t* node_localDOF_map)
69 {
70 Elements->createColoring(Nodes->getNumNodes(), node_localDOF_map);
71 FaceElements->createColoring(Nodes->getNumNodes(), node_localDOF_map);
72 Points->createColoring(Nodes->getNumNodes(), node_localDOF_map);
73 }
74
75 /// redistributes elements to minimize communication during assemblage
76 void Mesh::optimizeElementOrdering()
77 {
78 Elements->optimizeOrdering();
79 FaceElements->optimizeOrdering();
80 Points->optimizeOrdering();
81 }
82
83 /// regenerates list of tags in use for node file and element files
84 void Mesh::updateTagList()
85 {
86 Nodes->updateTagList();
87 Elements->updateTagList();
88 FaceElements->updateTagList();
89 Points->updateTagList();
90 }
91
92 } // namespace dudley
93

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26