From 805b870d9a88ff7d6b3f8c3dad4ce6136136b3ad Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 24 Oct 2019 11:27:44 +0200 Subject: [PATCH] move constraints --- examples/step-12/step-12.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index badf5073eb..1a4ff62df8 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -210,13 +210,10 @@ namespace Step12 // @sect3{The AdvectionProblem class} // // After this preparations, we proceed with the main class of this program, - // called AdvectionProblem. While we would not need an AffineConstraints - // object, because there are no hanging node constraints in DG - // discretizations, we use an empty object here as this allows us to use its - // `copy_local_to_global` functionality. + // called AdvectionProblem. // - // Major differences will only come up in the implementation of the assemble - // function. + // This should all be pretty familiar to you. Interesting details will only + // come up in the implementation of the assemble function. template class AdvectionProblem { @@ -415,8 +412,15 @@ namespace Step12 } }; - // This lambda function will handle copying the data from the cell and - // face assembly into the global matrix and right-hand side: + // The following lambda function will handle copying the data from the + // cell and face assembly into the global matrix and right-hand side. + // + // While we would not need an AffineConstraints object, because there are + // no hanging node constraints in DG discretizations, we use an empty + // object here as this allows us to use its `copy_local_to_global` + // functionality. + AffineConstraints constraints; + auto copier = [&](const CopyData &c) { constraints.distribute_local_to_global(c.cell_matrix, c.cell_rhs, -- 2.39.5