Commit 85c50964 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1399 Extend the EnsightUnusedVertices test with the case space unit is employed.

parent 790b7d98
......@@ -30,6 +30,10 @@ namespace // anonymous
{
unsigned int GenerateNewMeshId();
void TestCase(double space_unit);
} // namespace anonymous
......@@ -44,58 +48,73 @@ BOOST_FIXTURE_TEST_SUITE(ensight_unused_vertices, MoReFEM::TestNS::FixtureNS::En
BOOST_AUTO_TEST_CASE(space_unit_1)
{
decltype(auto) mesh_manager = Internal::MeshNS::MeshManager::CreateOrGetInstance(__FILE__, __LINE__);
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
TestCase(1.);
}
BOOST_AUTO_TEST_CASE(space_unit_2)
{
TestCase(2.);
}
std::string data_directory =
environment.SubstituteValues("${MOREFEM_ROOT}/Sources/Test/PostProcessing/EnsightUnusedVertices/Data");
BOOST_AUTO_TEST_SUITE_END()
constexpr auto mesh_unique_id = 1u;
std::string mesh_file = data_directory + "/cylinder_unused_vertices.mesh";
constexpr auto dimension = 3u;
constexpr auto space_unit = 1u;
PRAGMA_DIAGNOSTIC(pop)
mesh_manager.Create(mesh_unique_id,
mesh_file,
dimension,
MeshNS::Format::Medit,
space_unit);
decltype(auto) mesh = mesh_manager.GetMesh<mesh_unique_id>();
namespace // anonymous
{
std::vector<unsigned int> numbering_subset_id_list { 1 };
std::vector<std::string> unknown_list { "solid_displacement" };
std::string output_directory = environment.SubstituteValues("${MOREFEM_TEST_OUTPUT_DIR}/Ensight6");
PostProcessingNS::OutputFormat::Ensight6 ensight_output(data_directory,
unknown_list,
numbering_subset_id_list,
mesh,
PostProcessingNS::RefinedMesh::no,
output_directory);
unsigned int GenerateNewMeshId()
{
static auto ret = 0u;
return ++ret;
}
std::string ref_dir = data_directory + "/../ExpectedResult/Ensight6";
std::ostringstream oconv;
for (auto time_iteration = 0ul; time_iteration < 2ul; ++time_iteration)
void TestCase(double space_unit)
{
oconv.str("");
oconv << "solid_displacement." << std::setw(5) << std::setfill('0') << time_iteration << ".scl";
TestNS::CompareEnsightFiles(ref_dir, output_directory, oconv.str(),
__FILE__, __LINE__, 1.e-11);
}
decltype(auto) mesh_manager = Internal::MeshNS::MeshManager::CreateOrGetInstance(__FILE__, __LINE__);
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
}
std::string data_directory =
environment.SubstituteValues("${MOREFEM_ROOT}/Sources/Test/PostProcessing/EnsightUnusedVertices/Data");
BOOST_AUTO_TEST_SUITE_END()
auto mesh_unique_id = GenerateNewMeshId();
std::string mesh_file = data_directory + "/cylinder_unused_vertices.mesh";
constexpr auto dimension = 3u;
PRAGMA_DIAGNOSTIC(pop)
mesh_manager.Create(mesh_unique_id,
mesh_file,
dimension,
MeshNS::Format::Medit,
space_unit);
decltype(auto) mesh = mesh_manager.GetMesh(mesh_unique_id);
namespace // anonymous
{
std::vector<unsigned int> numbering_subset_id_list { 1 };
std::vector<std::string> unknown_list { "solid_displacement" };
std::string output_directory = environment.SubstituteValues("${MOREFEM_TEST_OUTPUT_DIR}/Ensight6");
PostProcessingNS::OutputFormat::Ensight6 ensight_output(data_directory,
unknown_list,
numbering_subset_id_list,
mesh,
PostProcessingNS::RefinedMesh::no,
output_directory);
std::string ref_dir = data_directory + "/../ExpectedResult/Ensight6";
std::ostringstream oconv;
for (auto time_iteration = 0ul; time_iteration < 2ul; ++time_iteration)
{
oconv.str("");
oconv << "solid_displacement." << std::setw(5) << std::setfill('0') << time_iteration << ".scl";
TestNS::CompareEnsightFiles(ref_dir, output_directory, oconv.str(),
__FILE__, __LINE__, 1.e-11);
}
}
} // namespace anonymous
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment