Commit f8cb21ac authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1399 Soften an assert which was too aggressive.

parent 241d9230
......@@ -107,7 +107,7 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
numbering_subset_id_list,
mesh);
mesh.Write<MeshNS::Format::Ensight>(ensight_directory + "/mesh.geo");
//mesh.Write<MeshNS::Format::Ensight>(ensight_directory + "/mesh.geo");
const auto& time_iteration_list = post_processing.GetTimeIterationList();
......@@ -299,9 +299,6 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
FilesystemNS::File::Create(ensight_output_stream, ensight_output_file, __FILE__, __LINE__);
ensight_output_stream << "First line which content must be chosen (but later)" << std::endl;
const unsigned int dimension = mesh.GetDimension();
const auto unknown_nature = unknown.GetNature();
const std::size_t Nprocessor = post_processing.Nprocessor();
......@@ -385,8 +382,9 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
}
else
{
assert(dof_list_for_coords.size() == 1ul
|| dof_list_for_coords.size() == dimension);
const auto Ndof_list_for_coords = dof_list_for_coords.size();
assert(dof_list_for_coords.size() >= 1ul
|| dof_list_for_coords.size() <= 3ul);
for (const auto& dof_index : dof_list_for_coords)
{
......@@ -397,8 +395,12 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
<< dof_value;
}
if (unknown_nature == Data::UnknownNature::vectorial && dimension == 2u)
ensight_output_stream << std::setw(12) << std::scientific << std::setprecision(5) << 0.;
if (unknown_nature == Data::UnknownNature::vectorial)
{
// Ensight format expects 3D!
for (auto i = 0ul; i < 3ul - Ndof_list_for_coords; ++i)
ensight_output_stream << std::setw(12) << std::scientific << std::setprecision(5) << 0.;
}
dof_counter += (unknown_nature == Data::UnknownNature::vectorial ? 3u : 1u);
}
......
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