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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6079 - (show annotations)
Mon Mar 21 12:22:38 2016 UTC (2 years, 10 months ago) by caltinay
File size: 2686 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 * Copyright (c) 2003-2016 by The University of Queensland
4 * http://www.uq.edu.au
5 *
6 * Primary Business: Queensland, Australia
7 * Licensed under the Open Software License version 3.0
8 * http://www.opensource.org/licenses/osl-3.0.php
9 *
10 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 * Development 2012-2013 by School of Earth Sciences
12 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 *
14 *****************************************************************************/
15
16 #include "Mesh.h"
17
18 namespace dudley {
19
20 /// constructor
21 Mesh::Mesh(const std::string name, int numDim, escript::JMPI mpi_info) :
22 m_name(name),
23 // order of shapeFunctions is always 1 in Dudley
24 approximationOrder(1),
25 integrationOrder(2),
26 reducedIntegrationOrder(0),
27 Elements(NULL),
28 FaceElements(NULL),
29 Points(NULL),
30 MPIInfo(mpi_info)
31 {
32 // allocate node table
33 Nodes = new NodeFile(numDim, mpi_info);
34 }
35
36 /// destructor
37 Mesh::~Mesh()
38 {
39 delete Nodes;
40 delete FaceElements;
41 delete Elements;
42 delete Points;
43 }
44
45 void Mesh::setElements(ElementFile* elements)
46 {
47 delete Elements;
48 Elements = elements;
49 }
50
51 void Mesh::setFaceElements(ElementFile* elements)
52 {
53 delete FaceElements;
54 FaceElements = elements;
55 }
56
57 void Mesh::setPoints(ElementFile* elements)
58 {
59 delete Points;
60 Points = elements;
61 }
62
63 void Mesh::createMappings(const std::vector<index_t>& dofDist,
64 const std::vector<index_t>& nodeDist)
65 {
66 Nodes->createNodeMappings(dofDist, nodeDist);
67 }
68
69 void Mesh::markNodes(std::vector<short>& mask, index_t offset) const
70 {
71 Elements->markNodes(mask, offset);
72 FaceElements->markNodes(mask, offset);
73 Points->markNodes(mask, offset);
74 }
75
76 void Mesh::relabelElementNodes(const index_t* newNode, index_t offset)
77 {
78 Elements->relabelNodes(newNode, offset);
79 FaceElements->relabelNodes(newNode, offset);
80 Points->relabelNodes(newNode, offset);
81 }
82
83 void Mesh::setCoordinates(const escript::Data& newX)
84 {
85 Nodes->setCoordinates(newX);
86 }
87
88 void Mesh::addTagMap(const std::string& name, int tag_key)
89 {
90 tagMap[name] = tag_key;
91 }
92
93 int Mesh::getTag(const std::string& name) const
94 {
95 TagMap::const_iterator it = tagMap.find(name);
96 if (it == tagMap.end()) {
97 std::stringstream ss;
98 ss << "getTag: unknown tag name " << name << ".";
99 const std::string errorMsg(ss.str());
100 throw escript::ValueError(errorMsg);
101 }
102 return it->second;
103 }
104
105 bool Mesh::isValidTagName(const std::string& name) const
106 {
107 return (tagMap.count(name) > 0);
108 }
109
110 } // namespace dudley
111

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26