Skip to content
Snippets Groups Projects
Commit 3b1362c1 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] Only asmJacobian is implemented for asmMixins

The Picard implementation would be slightly different
then the current assembleGeneric suggests anyway.

Simplifying the code, small cleanups.
parent 950934f5
No related branches found
No related tags found
No related merge requests found
......@@ -137,23 +137,22 @@ public:
}
// cppcheck-suppress functionStatic
void assemble(const double /*t*/, double const /*dt*/,
void assemble(double const t, double const dt,
std::vector<GlobalVector*> const& /*x*/,
std::vector<GlobalVector*> const& /*x_prev*/,
int const /*process_id*/, GlobalMatrix& /*M*/,
int const process_id, GlobalMatrix& /*M*/,
GlobalMatrix& /*K*/, GlobalVector& /*b*/)
{
/*
DBUG("AssemblyMixin assemble(t={}, dt={}, process_id={}).", t, dt,
process_id);
assembleGeneric(&Assembly::ParallelVectorMatrixAssembler::assemble, t,
dt, x, x_prev, process_id, M, K, b);
*/
OGS_FATAL("Not yet implemented.");
/// Implementation similar to assembleWithJacobian calling
/// Assembly::ParallelVectorMatrixAssembler::assemble function.
/// Residuum must be correctly computed.
OGS_FATAL("AssemblyMixin for Picard scheme is not yet implemented.");
}
void assembleWithJacobian(const double t, double const dt,
void assembleWithJacobian(double const t, double const dt,
std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev,
int const process_id, GlobalMatrix& M,
......@@ -163,27 +162,6 @@ public:
DBUG("AssemblyMixin assembleWithJacobian(t={}, dt={}, process_id={}).",
t, dt, process_id);
assembleGeneric(
&Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian, t,
dt, x, x_prev, process_id, M, K, b, Jac);
}
private:
Process& derived() { return static_cast<Process&>(*this); }
Process const& derived() const
{
return static_cast<Process const&>(*this);
}
/// Generic assembly routine covering both the case with and without
/// Jacobian assembly.
template <typename Method, typename... Jac>
void assembleGeneric(Method global_assembler_method, const double t,
double const dt, std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev,
int const process_id, GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b, Jac&... jac_or_not_jac)
{
// TODO why not getDOFTables(x.size()); ?
std::vector<NumLib::LocalToGlobalIndexMap const*> const dof_tables{
derived()._local_to_global_index_map.get()};
......@@ -199,9 +177,9 @@ private:
{
b_submesh.setZero();
(pvma_.*global_assembler_method)(
loc_asms, sad.active_element_ids, dof_tables, t, dt, x,
x_prev, process_id, M, K, b_submesh, jac_or_not_jac...);
pvma_.assembleWithJacobian(loc_asms, sad.active_element_ids,
dof_tables, t, dt, x, x_prev,
process_id, M, K, b_submesh, Jac);
MathLib::LinAlg::axpy(b, 1.0, b_submesh);
......@@ -218,14 +196,21 @@ private:
ProcessLib::ProcessVariable const& pv =
derived().getProcessVariables(process_id)[0];
(pvma_.*global_assembler_method)(
loc_asms, pv.getActiveElementIDs(), dof_tables, t, dt, x,
x_prev, process_id, M, K, b, jac_or_not_jac...);
pvma_.assembleWithJacobian(loc_asms, pv.getActiveElementIDs(),
dof_tables, t, dt, x, x_prev, process_id,
M, K, b, Jac);
}
AssemblyMixinBase::copyResiduumVectorsToBulkMesh(
b, *(dof_tables.front()), residuum_vectors_bulk_);
}
private:
Process& derived() { return static_cast<Process&>(*this); }
Process const& derived() const
{
return static_cast<Process const&>(*this);
}
};
} // namespace ProcessLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment