| 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_EDGES_HPP |
| 35 |
#define UNIT_TEST_READ_WRITE_EDGES_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/baseImpl/ConnectEdgesImpl.hpp> |
| 43 |
#include <stk_mesh/base/Types.hpp> |
| 44 |
#include <stk_mesh/base/Comm.hpp> |
| 45 |
#include <stk_mesh/base/Field.hpp> |
| 46 |
#include <stk_mesh/base/FEMHelpers.hpp> |
| 47 |
#include <stk_mesh/base/SkinBoundary.hpp> |
| 48 |
#include <stk_unit_test_utils/GetMeshSpec.hpp> |
| 49 |
#include <stk_unit_test_utils/TextMesh.hpp> |
| 50 |
#include <stk_unit_test_utils/MeshFixture.hpp> |
| 51 |
#include <stk_io/FillMesh.hpp> |
| 52 |
#include <stk_io/IossBridge.hpp> |
| 53 |
#include <stk_io/StkMeshIoBroker.hpp> |
| 54 |
#include <stk_util/parallel/Parallel.hpp> |
| 55 |
#include "UnitTestReadWriteUtils.hpp" |
| 56 |
|
| 57 |
class StkEdgeIoTest : public stk::unit_test_util::MeshFixture |
| 58 |
{ |
| 59 |
public: |
| 60 |
StkEdgeIoTest(unsigned spatialDim=3) |
| 61 |
: stk::unit_test_util::MeshFixture(spatialDim) |
| 62 |
{ |
| 63 |
} |
| 64 |
|
| 65 |
virtual void setup_edge_mesh(unsigned numBlocks); |
| 66 |
|
| 67 |
void setup_mesh_with_edges(unsigned numBlocks); |
| 68 |
|
| 69 |
void setup_mesh_with_edges_and_faces(unsigned numBlocks); |
| 70 |
|
| 71 |
void test_connectivity_to_element(const stk::mesh::BulkData& bulk, stk::mesh::EntityRank entityRank); |
| 72 |
|
| 73 |
void test_entity_count(const stk::mesh::BulkData& bulk, stk::mesh::EntityRank entityRank, |
| 74 |
unsigned expectedNumLocalEntities, unsigned expectedNumEntities); |
| 75 |
|
| 76 |
void test_edges(const stk::mesh::BulkData& bulk); |
| 77 |
|
| 78 |
void test_faces(const stk::mesh::BulkData& bulk); |
| 79 |
|
| 80 |
virtual void output_mesh(); |
| 81 |
|
| 82 |
void test_output_mesh(); |
| 83 |
|
| 84 |
void test_output_mesh(stk::mesh::BulkData& bulk); |
| 85 |
|
| 86 |
virtual void load_output_mesh(stk::mesh::BulkData& bulk); |
| 87 |
|
| 88 |
void set_expected_values(io_test_utils::ExpectedValues& expectedValues_); |
| 89 |
|
| 90 |
virtual ~StkEdgeIoTest() |
| 91 |
{ |
| 92 |
unlink(fileName.c_str()); |
| 93 |
} |
| 94 |
|
| 95 |
protected: |
| 96 |
std::string fileName = "output.exo"; |
| 97 |
std::string edgePartName = "edgeBlock"; |
| 98 |
std::string facePartName = "faceBlock"; |
| 99 |
io_test_utils::ExpectedValues expectedValues; |
| 100 |
}; |
| 101 |
|
| 102 |
#endif |