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

Pass vector of solutions to assemble.

parent 85fcc6e2
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,9 @@ public:
//! Assemble \c M, \c K and \c b at the provided state (\c t, \c x).
virtual void assemble(const double t, double const dt,
GlobalVector const& x, int const process_id,
GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b) = 0;
std::vector<GlobalVector*> const& x,
int const process_id, GlobalMatrix& M,
GlobalMatrix& K, GlobalVector& b) = 0;
using Index = MathLib::MatrixVectorTraits<GlobalMatrix>::Index;
......
......@@ -204,7 +204,7 @@ void TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
_b->setZero();
_ode.preAssemble(t, dt, x_curr);
_ode.assemble(t, dt, x_curr, process_id, *_M, *_K, *_b);
_ode.assemble(t, dt, x_new_timestep, process_id, *_M, *_K, *_b);
LinAlg::finalizeAssembly(*_M);
LinAlg::finalizeAssembly(*_K);
......
......@@ -195,19 +195,22 @@ void Process::preAssemble(const double t, double const dt,
preAssembleConcreteProcess(t, dt, x);
}
void Process::assemble(const double t, double const dt, GlobalVector const& x,
void Process::assemble(const double t, double const dt,
std::vector<GlobalVector*> const& x,
int const process_id, GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b)
{
MathLib::LinAlg::setLocalAccessibleVector(x);
MathLib::LinAlg::setLocalAccessibleVector(*x[process_id]);
assembleConcreteProcess(t, dt, x, process_id, M, K, b);
// the last argument is for the jacobian, nullptr is for a unused jacobian
_boundary_conditions[process_id].applyNaturalBC(t, x, K, b, nullptr);
_boundary_conditions[process_id].applyNaturalBC(t, *x[process_id], K, b,
nullptr);
// the last argument is for the jacobian, nullptr is for a unused jacobian
_source_term_collections[process_id].integrate(t, x, b, nullptr);
_source_term_collections[process_id].integrate(t, *x[process_id], b,
nullptr);
}
void Process::assembleWithJacobian(const double t, double const dt,
......
......@@ -102,9 +102,9 @@ public:
}
void preAssemble(const double t, double const dt,
GlobalVector const& x) final;
void assemble(const double t, double const dt, GlobalVector const& x,
int const process_id, GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b) final;
void assemble(const double t, double const dt,
std::vector<GlobalVector*> const& x, int const process_id,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) final;
void assembleWithJacobian(const double t, double const dt,
std::vector<GlobalVector*> const& x,
......@@ -196,7 +196,7 @@ private:
}
virtual void assembleConcreteProcess(const double t, double const dt,
GlobalVector const& x,
std::vector<GlobalVector*> const& x,
int const process_id, GlobalMatrix& M,
GlobalMatrix& K, GlobalVector& b) = 0;
......
......@@ -43,7 +43,7 @@ void VectorMatrixAssembler::assemble(
const std::size_t mesh_item_id, LocalAssemblerInterface& local_assembler,
std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> const&
dof_tables,
const double t, double const dt, const GlobalVector& x,
const double t, double const dt, std::vector<GlobalVector*> const& x,
int const process_id, GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b,
CoupledSolutionsForStaggeredScheme const* const cpl_xs)
{
......@@ -62,7 +62,7 @@ void VectorMatrixAssembler::assemble(
if (cpl_xs == nullptr)
{
auto const local_x = x.get(indices);
auto const local_x = x[process_id]->get(indices);
local_assembler.assemble(t, dt, local_x, _local_M_data, _local_K_data,
_local_b_data);
}
......@@ -71,7 +71,7 @@ void VectorMatrixAssembler::assemble(
auto local_coupled_xs0 = getCoupledLocalSolutions(cpl_xs->coupled_xs_t0,
indices_of_processes);
auto local_coupled_xs =
getCoupledLocalSolutions(cpl_xs->coupled_xs, indices_of_processes);
getCoupledLocalSolutions(x, indices_of_processes);
ProcessLib::LocalCoupledSolutions local_coupled_solutions(
std::move(local_coupled_xs0), std::move(local_coupled_xs));
......
......@@ -47,9 +47,9 @@ public:
LocalAssemblerInterface& local_assembler,
std::vector<std::reference_wrapper<
NumLib::LocalToGlobalIndexMap>> const& dof_tables,
double const t, double const dt, GlobalVector const& x,
int const process_id, GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b,
double const t, double const dt,
std::vector<GlobalVector*> const& x, int const process_id,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b,
CoupledSolutionsForStaggeredScheme const* const cpl_xs);
//! Assembles \c M, \c K, \c b, and the Jacobian \c Jac of the residual.
......
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