Debian Codegraph @

packages/stk/stk_unit_tests/stk_io/UnitTestReadWriteFaces.hpp

raw
1 // Copyright 2002 - 2008, 2010, 2011 National Technology Engineering
2 // Solutions of Sandia, LLC (NTESS). Under the terms of Contract
3 // DE-NA0003525 with NTESS, the U.S. Government retains certain rights
4 // in this software.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are
8 // met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 //
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following
15 // disclaimer in the documentation and/or other materials provided
16 // with the distribution.
17 //
18 // * Neither the name of NTESS nor the names of its contributors
19 // may be used to endorse or promote products derived from this
20 // software without specific prior written permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34 #ifndef UNIT_TEST_READ_WRITE_FACES_HPP
35 #define UNIT_TEST_READ_WRITE_FACES_HPP
36
37 #include <stk_topology/topology.hpp>
38 #include <stk_mesh/base/BulkData.hpp>
39 #include <stk_mesh/base/MetaData.hpp>
40 #include <stk_mesh/base/GetEntities.hpp>
41 #include <stk_mesh/baseImpl/MeshImplUtils.hpp>
42 #include <stk_mesh/base/Types.hpp>
43 #include <stk_mesh/base/Comm.hpp>
44 #include <stk_mesh/base/Field.hpp>
45 #include <stk_mesh/base/FEMHelpers.hpp>
46 #include <stk_mesh/base/SkinBoundary.hpp>
47 #include <stk_unit_test_utils/GetMeshSpec.hpp>
48 #include <stk_unit_test_utils/TextMesh.hpp>
49 #include <stk_unit_test_utils/MeshFixture.hpp>
50 #include <stk_io/FillMesh.hpp>
51 #include <stk_io/IossBridge.hpp>
52 #include <stk_io/StkMeshIoBroker.hpp>
53 #include <stk_util/parallel/Parallel.hpp>
54 #include "UnitTestReadWriteUtils.hpp"
55
56 class StkFaceIoTest : public stk::unit_test_util::MeshFixture
57 {
58 public:
59 StkFaceIoTest()
60 : stk::unit_test_util::MeshFixture(),
61 stkIoInput(),
62 stkIoOutput()
63 {
64 }
65
66 void setup_face_mesh(unsigned numBlocks);
67
68 void setup_mesh_with_faces(unsigned numBlocks);
69
70 void setup_mesh_with_edges_and_faces(unsigned numBlocks);
71
72 void test_connectivity_to_element(const stk::mesh::BulkData& bulk, stk::mesh::EntityRank entityRank);
73
74 void test_entity_count(const stk::mesh::BulkData& bulk, stk::mesh::EntityRank entityRank,
75 unsigned expectedNumLocalEntities, unsigned expectedNumEntities);
76
77 void test_edges(const stk::mesh::BulkData& bulk);
78
79 void test_faces(const stk::mesh::BulkData& bulk);
80
81 virtual void output_mesh();
82
83 void test_output_mesh();
84
85 void test_output_mesh(stk::mesh::BulkData& bulk);
86
87 virtual void load_output_mesh(stk::mesh::BulkData& bulk);
88
89 void set_expected_values(io_test_utils::ExpectedValues& expectedValues_);
90
91 virtual ~StkFaceIoTest()
92 {
93 //unlink(fileName.c_str());
94 }
95
96 void set_file_name(const std::string& newName)
97 { fileName = newName; }
98
99 protected:
100 std::string fileName = "output.exo";
101 std::string edgePartName = "edgeBlock";
102 std::string facePartName = "faceBlock";
103 io_test_utils::ExpectedValues expectedValues;
104 stk::io::StkMeshIoBroker stkIoInput;
105 stk::io::StkMeshIoBroker stkIoOutput;
106 };
107
108 #endif