Commit 643d6cd0 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1399 Introduce a new object which will in next commit also be responsible of...

#1399 Introduce a new object which will in next commit also be responsible of computing the match Coords / Dof.
parent 85c50964
......@@ -31,11 +31,30 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
{
class ExtendedDofInformation
{
public:
ExtendedDofInformation(const Data::UnknownInformation& unknown_info);
const Data::UnknownInformation& GetUnknownInfo() const;
private:
const Data::UnknownInformation& unknown_info_;
//! Index is the position of the Coords in the mesh, starting at 0.
//! The inner vector is the index of the dof as it is stored in the interface GetVertexCoordsIndexList()
//! method.
std::vector<std::vector<std::size_t> > coords_match_;
};
void CreateCaseFile(const std::string& output_directory,
const Data::UnknownInformation::vector_const_shared_ptr& unknown_list,
const Data::TimeIteration::vector_const_unique_ptr& time_iteration_list);
void CreateUnknownFile(const Data::UnknownInformation& unknown,
void CreateUnknownFile(const ExtendedDofInformation& dof_info,
const unsigned int numbering_subset_id,
const PostProcessingNS::Data::TimeIteration& time_iteration,
const std::string& data_directory,
......@@ -116,12 +135,17 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
selected_unknown_list,
time_iteration_list);
// Sort the unknowns by associated numbering subset.
std::multimap<unsigned int, Data::UnknownInformation::const_shared_ptr> unknown_list_per_numbering_subset;
// Sort the data properly.
std::multimap<unsigned int, ExtendedDofInformation> unknown_list_per_numbering_subset;
for (auto i = 0ul; i < Nunknown; ++i)
unknown_list_per_numbering_subset.insert({numbering_subset_id_list[i], selected_unknown_list[i]});
{
ExtendedDofInformation buf(*selected_unknown_list[i]);
unknown_list_per_numbering_subset.insert({numbering_subset_id_list[i], buf});
}
// For each Unknown, compute the relationship array which tells for each \a Coord of the Ensight mesh file
// the matching dofs (if any).
// Iterate over time:
for (const auto& time_iteration_ptr : time_iteration_list)
......@@ -136,10 +160,9 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
{
const auto& unknown_list_for_numbering_subset = *it;
decltype(auto) unknown_ptr = unknown_list_for_numbering_subset.second;
assert(!(!unknown_ptr));
decltype(auto) dof_info = unknown_list_for_numbering_subset.second;
CreateUnknownFile(*unknown_ptr,
CreateUnknownFile(dof_info,
unknown_list_for_numbering_subset.first,
time_iteration,
ensight_directory,
......@@ -246,13 +269,14 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
}
void CreateUnknownFile(const Data::UnknownInformation& unknown,
void CreateUnknownFile(const ExtendedDofInformation& dof_information,
const unsigned int numbering_subset_id,
const PostProcessingNS::Data::TimeIteration& time_iteration,
const std::string& output_directory,
const PostProcessing& post_processing,
RefinedMesh is_mesh_refined)
{
const auto& unknown = dof_information.GetUnknownInfo();
const auto& unknown_name = unknown.GetName();
const auto& mesh = post_processing.GetMesh();
......@@ -431,6 +455,17 @@ namespace MoReFEM::PostProcessingNS::OutputFormat
}
const Data::UnknownInformation& ExtendedDofInformation::GetUnknownInfo() const
{
return unknown_info_;
}
ExtendedDofInformation::ExtendedDofInformation(const Data::UnknownInformation& unknown_info)
: unknown_info_(unknown_info)
{ }
} // 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