OGS
anonymous_namespace{ProcessOutputData.cpp} Namespace Reference

Functions

bool isSimulationDomain (MeshLib::Mesh const &mesh, ProcessLib::Process const &process)
 
std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > computeDofTablesForSubmesh (ProcessLib::Process const &process, MeshLib::Mesh const &submesh, std::size_t const n_processes)
 
std::vector< NumLib::LocalToGlobalIndexMap const * > toNonOwning (std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > const &dof_tables)
 
std::vector< NumLib::LocalToGlobalIndexMap const * > getDofTablesOfAllProcesses (ProcessLib::Process const &process, std::size_t const n_processes)
 
decltype(auto) computeOutputMeshDofTables (ProcessLib::Process const &process, MeshLib::Mesh const &output_mesh, std::vector< NumLib::LocalToGlobalIndexMap const * > const &bulk_mesh_dof_tables)
 
std::vector< std::reference_wrapper< const std::vector< std::reference_wrapper< ProcessLib::ProcessVariable > > > > getProcessVariablesOfAllProcesses (ProcessLib::Process const &process, std::size_t const n_processes)
 
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const * getIntegrationPointWriters (ProcessLib::Process const &process, MeshLib::Mesh const &output_mesh)
 

Function Documentation

◆ computeDofTablesForSubmesh()

std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > anonymous_namespace{ProcessOutputData.cpp}::computeDofTablesForSubmesh ( ProcessLib::Process const & process,
MeshLib::Mesh const & submesh,
std::size_t const n_processes )

Definition at line 26 of file ProcessOutputData.cpp.

29{
30 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>
31 submesh_dof_tables;
32 submesh_dof_tables.reserve(n_processes);
33
34 for (std::size_t i = 0; i < n_processes; ++i)
35 {
36 submesh_dof_tables.push_back(
37 process.getDOFTable(i).deriveBoundaryConstrainedMap(
38 MeshLib::MeshSubset{submesh, submesh.getNodes()}));
39 }
40
41 return submesh_dof_tables;
42}
A subset of nodes on a single mesh.
Definition MeshSubset.h:26

References NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap(), and ProcessLib::Process::getDOFTable().

Referenced by computeOutputMeshDofTables().

◆ computeOutputMeshDofTables()

decltype(auto) anonymous_namespace{ProcessOutputData.cpp}::computeOutputMeshDofTables ( ProcessLib::Process const & process,
MeshLib::Mesh const & output_mesh,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & bulk_mesh_dof_tables )

Computes the d.o.f. tables for the given output_mesh.

These are the passed bulk_mesh_dof_tables for output of the entire simulation domain of the given process. In the case of submesh output d.o.f. tables for the submesh will be computed.

Returns
A pair of (vector of d.o.f. table pointers, vector of d.o.f. table storage), where the latter is populated in the case of submesh output only.

Each element in the returned vectors corresponds to a specific process_id of the process.

Definition at line 84 of file ProcessOutputData.cpp.

89{
90 if (isSimulationDomain(output_mesh, process))
91 {
92 return std::pair(
93 bulk_mesh_dof_tables /* will be copied */,
94 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>{});
95 }
96
97 auto const n_processes = bulk_mesh_dof_tables.size();
98
99 // TODO Currently these d.o.f. tables will be recomputed every time we write
100 // output. That should be avoided in the future.
101 auto container_that_owns_output_mesh_dof_tables =
102 computeDofTablesForSubmesh(process, output_mesh, n_processes);
103
104 auto output_mesh_dof_tables =
105 toNonOwning(container_that_owns_output_mesh_dof_tables);
106
107 return std::pair(std::move(output_mesh_dof_tables),
108 std::move(container_that_owns_output_mesh_dof_tables));
109}
std::vector< NumLib::LocalToGlobalIndexMap const * > toNonOwning(std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > const &dof_tables)
bool isSimulationDomain(MeshLib::Mesh const &mesh, ProcessLib::Process const &process)
std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > computeDofTablesForSubmesh(ProcessLib::Process const &process, MeshLib::Mesh const &submesh, std::size_t const n_processes)

References computeDofTablesForSubmesh(), isSimulationDomain(), and toNonOwning().

◆ getDofTablesOfAllProcesses()

std::vector< NumLib::LocalToGlobalIndexMap const * > anonymous_namespace{ProcessOutputData.cpp}::getDofTablesOfAllProcesses ( ProcessLib::Process const & process,
std::size_t const n_processes )

Definition at line 59 of file ProcessOutputData.cpp.

61{
62 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables_of_all_procs(
63 n_processes);
64
65 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
66 {
67 dof_tables_of_all_procs[proc_id] = &process.getDOFTable(proc_id);
68 }
69
70 return dof_tables_of_all_procs;
71}

References ProcessLib::Process::getDOFTable().

◆ getIntegrationPointWriters()

std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const * anonymous_namespace{ProcessOutputData.cpp}::getIntegrationPointWriters ( ProcessLib::Process const & process,
MeshLib::Mesh const & output_mesh )

Definition at line 130 of file ProcessOutputData.cpp.

132{
133 return isSimulationDomain(output_mesh, process)
134 ? &process.getIntegrationPointWriters()
135 : nullptr;
136}

References ProcessLib::Process::getIntegrationPointWriters(), and isSimulationDomain().

◆ getProcessVariablesOfAllProcesses()

std::vector< std::reference_wrapper< const std::vector< std::reference_wrapper< ProcessLib::ProcessVariable > > > > anonymous_namespace{ProcessOutputData.cpp}::getProcessVariablesOfAllProcesses ( ProcessLib::Process const & process,
std::size_t const n_processes )

Definition at line 113 of file ProcessOutputData.cpp.

115{
116 std::vector<std::reference_wrapper<
117 const std::vector<std::reference_wrapper<ProcessLib::ProcessVariable>>>>
118 pvs_of_all_procs;
119 pvs_of_all_procs.reserve(n_processes);
120
121 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
122 {
123 pvs_of_all_procs.emplace_back(process.getProcessVariables(proc_id));
124 }
125
126 return pvs_of_all_procs;
127}

References ProcessLib::Process::getProcessVariables().

◆ isSimulationDomain()

bool anonymous_namespace{ProcessOutputData.cpp}::isSimulationDomain ( MeshLib::Mesh const & mesh,
ProcessLib::Process const & process )

Checks if the given mesh is the simulation domain of the given process.

Definition at line 19 of file ProcessOutputData.cpp.

21{
22 return mesh == process.getMesh();
23}

References ProcessLib::Process::getMesh().

Referenced by computeOutputMeshDofTables(), and getIntegrationPointWriters().

◆ toNonOwning()

std::vector< NumLib::LocalToGlobalIndexMap const * > anonymous_namespace{ProcessOutputData.cpp}::toNonOwning ( std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > const & dof_tables)

Definition at line 44 of file ProcessOutputData.cpp.

47{
48 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table_pointers;
49
50 dof_table_pointers.reserve(dof_tables.size());
51 transform(cbegin(dof_tables), cend(dof_tables),
52 back_inserter(dof_table_pointers),
53 [](std::unique_ptr<NumLib::LocalToGlobalIndexMap> const& p)
54 { return p.get(); });
55
56 return dof_table_pointers;
57}

Referenced by computeOutputMeshDofTables().