22 return mesh == process.
getMesh();
25std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>
28 std::size_t
const n_processes)
30 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>
32 submesh_dof_tables.reserve(n_processes);
34 for (std::size_t i = 0; i < n_processes; ++i)
36 submesh_dof_tables.push_back(
41 return submesh_dof_tables;
45 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>
const&
48 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table_pointers;
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)
56 return dof_table_pointers;
62 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables_of_all_procs(
65 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
67 dof_tables_of_all_procs[proc_id] = &process.
getDOFTable(proc_id);
70 return dof_tables_of_all_procs;
87 std::vector<NumLib::LocalToGlobalIndexMap const*>
const&
93 bulk_mesh_dof_tables ,
94 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>{});
97 auto const n_processes = bulk_mesh_dof_tables.size();
101 auto container_that_owns_output_mesh_dof_tables =
104 auto output_mesh_dof_tables =
105 toNonOwning(container_that_owns_output_mesh_dof_tables);
107 return std::pair(std::move(output_mesh_dof_tables),
108 std::move(container_that_owns_output_mesh_dof_tables));
111std::vector<std::reference_wrapper<
112 const std::vector<std::reference_wrapper<ProcessLib::ProcessVariable>>>>
114 std::size_t
const n_processes)
116 std::vector<std::reference_wrapper<
117 const std::vector<std::reference_wrapper<ProcessLib::ProcessVariable>>>>
119 pvs_of_all_procs.reserve(n_processes);
121 for (std::size_t proc_id = 0; proc_id < n_processes; ++proc_id)
126 return pvs_of_all_procs;
129std::vector<std::unique_ptr<MeshLib::IntegrationPointWriter>>
const*
144 std::size_t
const n_processes,
147 auto bulk_mesh_dof_tables =
148 getDofTablesOfAllProcesses(process, n_processes);
150 auto [output_mesh_dof_tables, container_that_owns_output_mesh_dof_tables] =
151 computeOutputMeshDofTables(process, output_mesh, bulk_mesh_dof_tables);
153 return {getProcessVariablesOfAllProcesses(process, n_processes),
155 ::getIntegrationPointWriters(process, output_mesh),
156 std::move(bulk_mesh_dof_tables),
157 std::move(output_mesh_dof_tables),
158 std::move(container_that_owns_output_mesh_dof_tables),
163 std::vector<std::reference_wrapper<
164 const std::vector<std::reference_wrapper<ProcessVariable>>>>&&
165 process_variables_of_all_processes,
167 const std::vector<std::unique_ptr<MeshLib::IntegrationPointWriter>>*
168 integration_point_writers,
169 std::vector<const NumLib::LocalToGlobalIndexMap*>&&
170 bulk_mesh_dof_tables_of_all_processes,
171 std::vector<const NumLib::LocalToGlobalIndexMap*>&&
172 output_mesh_dof_tables_of_all_processes,
173 std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>>&&
174 container_that_owns_output_mesh_dof_tables,
176 : process_variables_of_all_processes_(
177 std::move(process_variables_of_all_processes)),
178 secondary_variables_(secondary_variables),
179 integration_point_writers_(integration_point_writers),
180 bulk_mesh_dof_tables_of_all_processes_(
181 std::move(bulk_mesh_dof_tables_of_all_processes)),
182 output_mesh_dof_tables_of_all_processes_(
183 std::move(output_mesh_dof_tables_of_all_processes)),
184 container_that_owns_output_mesh_dof_tables_(
185 std::move(container_that_owns_output_mesh_dof_tables)),
186 output_mesh_(output_mesh)
193 if (n_proc_pvs != n_proc_bulk)
196 "Mismatch in number of processes (PVs vs. bulk mesh d.o.f. "
198 n_proc_pvs, n_proc_bulk);
201 if (n_proc_pvs != n_proc_out)
204 "Mismatch in number of processes (PVs vs. output mesh d.o.f. "
206 n_proc_pvs, n_proc_out);
210 if (n_proc_own != 0 && n_proc_pvs != n_proc_own)
213 "Mismatch in number of processes (PVs vs. output mesh d.o.f. "
214 "tables, owning): {} != {}",
215 n_proc_pvs, n_proc_own);
A subset of nodes on a single mesh.
std::unique_ptr< LocalToGlobalIndexMap > deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
Holds all data of a process that are needed for output.
std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > container_that_owns_output_mesh_dof_tables_
std::vector< NumLib::LocalToGlobalIndexMap const * > output_mesh_dof_tables_of_all_processes_
std::vector< std::reference_wrapper< const std::vector< std::reference_wrapper< ProcessVariable > > > > process_variables_of_all_processes_
ProcessOutputData(std::vector< std::reference_wrapper< const std::vector< std::reference_wrapper< ProcessVariable > > > > &&process_variables_of_all_processes, const SecondaryVariableCollection &secondary_variables, const std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > *integration_point_writers, std::vector< const NumLib::LocalToGlobalIndexMap * > &&bulk_mesh_dof_tables_of_all_processes, std::vector< const NumLib::LocalToGlobalIndexMap * > &&output_mesh_dof_tables_of_all_processes, std::vector< std::unique_ptr< NumLib::LocalToGlobalIndexMap > > &&container_that_owns_output_mesh_dof_tables, MeshLib::Mesh &output_mesh)
std::vector< NumLib::LocalToGlobalIndexMap const * > bulk_mesh_dof_tables_of_all_processes_
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const & getIntegrationPointWriters() const
MeshLib::Mesh & getMesh() const
SecondaryVariableCollection const & getSecondaryVariables() const
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable(const int) const
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables() const
Handles configuration of several secondary variables from the project file.
ProcessOutputData createProcessOutputData(Process const &process, std::size_t const n_processes, MeshLib::Mesh &output_mesh)
Extracts data necessary for output from the given process.
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)
std::vector< std::reference_wrapper< const std::vector< std::reference_wrapper< ProcessLib::ProcessVariable > > > > getProcessVariablesOfAllProcesses(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::unique_ptr< MeshLib::IntegrationPointWriter > > const * getIntegrationPointWriters(ProcessLib::Process const &process, MeshLib::Mesh const &output_mesh)
std::vector< NumLib::LocalToGlobalIndexMap const * > getDofTablesOfAllProcesses(ProcessLib::Process const &process, std::size_t const n_processes)