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 19 of file ProcessOutputData.cpp.

22{
23 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>
24 submesh_dof_tables;
25 submesh_dof_tables.reserve(n_processes);
26
27 for (std::size_t i = 0; i < n_processes; ++i)
28 {
29 submesh_dof_tables.push_back(
30 process.getDOFTable(i).deriveBoundaryConstrainedMap(
31 MeshLib::MeshSubset{submesh, submesh.getNodes()}));
32 }
33
34 return submesh_dof_tables;
35}
A subset of nodes on a single mesh.
Definition MeshSubset.h:17

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 77 of file ProcessOutputData.cpp.

82{
83 if (isSimulationDomain(output_mesh, process))
84 {
85 return std::pair(
86 bulk_mesh_dof_tables /* will be copied */,
87 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>{});
88 }
89
90 auto const n_processes = bulk_mesh_dof_tables.size();
91
92 // TODO Currently these d.o.f. tables will be recomputed every time we write
93 // output. That should be avoided in the future.
94 auto container_that_owns_output_mesh_dof_tables =
95 computeDofTablesForSubmesh(process, output_mesh, n_processes);
96
97 auto output_mesh_dof_tables =
98 toNonOwning(container_that_owns_output_mesh_dof_tables);
99
100 return std::pair(std::move(output_mesh_dof_tables),
101 std::move(container_that_owns_output_mesh_dof_tables));
102}
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 52 of file ProcessOutputData.cpp.

54{
55 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables_of_all_procs(
56 n_processes);
57
58 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
59 {
60 dof_tables_of_all_procs[proc_id] = &process.getDOFTable(proc_id);
61 }
62
63 return dof_tables_of_all_procs;
64}

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 123 of file ProcessOutputData.cpp.

125{
126 return isSimulationDomain(output_mesh, process)
127 ? &process.getIntegrationPointWriters()
128 : nullptr;
129}

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 106 of file ProcessOutputData.cpp.

108{
109 std::vector<std::reference_wrapper<
110 const std::vector<std::reference_wrapper<ProcessLib::ProcessVariable>>>>
111 pvs_of_all_procs;
112 pvs_of_all_procs.reserve(n_processes);
113
114 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
115 {
116 pvs_of_all_procs.emplace_back(process.getProcessVariables(proc_id));
117 }
118
119 return pvs_of_all_procs;
120}

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 12 of file ProcessOutputData.cpp.

14{
15 return mesh == process.getMesh();
16}

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 37 of file ProcessOutputData.cpp.

40{
41 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table_pointers;
42
43 dof_table_pointers.reserve(dof_tables.size());
44 transform(cbegin(dof_tables), cend(dof_tables),
45 back_inserter(dof_table_pointers),
46 [](std::unique_ptr<NumLib::LocalToGlobalIndexMap> const& p)
47 { return p.get(); });
48
49 return dof_table_pointers;
50}

Referenced by computeOutputMeshDofTables().