165 {
166 DBUG(
"AssemblyMixin assembleWithJacobian(t={}, dt={}, process_id={}).",
167 t, dt, process_id);
168
169 std::vector<NumLib::LocalToGlobalIndexMap const*> const dof_tables =
171
172 auto const& loc_asms =
derived().local_assemblers_;
173
174 std::exception_ptr exception = nullptr;
176 {
179
181 {
183
184 try
185 {
187 dof_tables, t, dt, x, x_prev,
188 process_id, b_submesh, Jac);
189 }
191 {
192 exception = std::current_exception();
193 }
194
196
198 process_id, b_submesh, *(dof_tables[process_id]), sad);
199 }
200
202 }
203 else
204 {
205 try
206 {
208 loc_asms,
derived().getActiveElementIDs(), dof_tables, t,
209 dt, x, x_prev, process_id, b, Jac);
210 }
212 {
213 exception = std::current_exception();
214 }
215 }
216
219
221 {
222 if (exception)
223 {
224 std::rethrow_exception(exception);
225 }
226
227 return;
228 }
229
232 }
virtual GlobalVector & getVector(std::size_t &id)=0
Get an uninitialized vector with the given id.
virtual void releaseVector(GlobalVector const &x)=0
Assembly::ParallelVectorMatrixAssembler pvma_
static void copyResiduumVectorsToBulkMesh(GlobalVector const &rhs, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > residuum_vectors)
std::size_t b_submesh_id_
ID of the b vector on submeshes, cf. NumLib::VectorProvider.
static void copyResiduumVectorsToSubmesh(int const process_id, GlobalVector const &rhs, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, SubmeshAssemblyData const &sad)
std::vector< SubmeshAssemblyData > submesh_assembly_data_
std::vector< std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > > residuum_vectors_bulk_
void assembleWithJacobian(BaseLib::PolymorphicRandomAccessContainerView< LocalAssemblerInterface > const &local_assemblers, std::vector< std::size_t > const &active_elements, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &xs, std::vector< GlobalVector * > const &x_prevs, int const process_id, GlobalVector &b, GlobalMatrix &Jac)
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes) const
static bool anyOf(bool const val, Mpi const &mpi=Mpi{MPI_COMM_WORLD})
void finalizeAssembly(PETScMatrix &A)
void axpy(PETScVector &y, PetscScalar const a, PETScVector const &x)
static NUMLIB_EXPORT VectorProvider & provider