From: janssen Date: Mon, 22 Mar 2010 18:46:03 +0000 (+0000) Subject: constraints used in Residual X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af8954fc54a73c77187523ce1c0d862ea9abb548;p=dealii-svn.git constraints used in Residual git-svn-id: https://svn.dealii.org/trunk@20881 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker_assembler.h b/deal.II/deal.II/include/numerics/mesh_worker_assembler.h index cfbe78e1a6..abd9c729e1 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_assembler.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_assembler.h @@ -340,6 +340,10 @@ namespace MeshWorker */ void initialize(const BlockInfo* block_info, NamedData& residuals); + /** + * Initialize the constraints. + */ + void initialize(const ConstraintMatrix& constraints); /** * Initialize the local data * in the @@ -396,6 +400,10 @@ namespace MeshWorker * A pointer to the object containing the block structure. */ SmartPointer block_info; + /** + * A pointer to the object containing constraints. + */ + SmartPointer constraints; }; @@ -1154,6 +1162,14 @@ namespace MeshWorker residuals = m; } + template + inline void + ResidualLocalBlocksToGlobalBlocks::initialize( + const ConstraintMatrix& c) + { + constraints = &c; + } + template template @@ -1171,6 +1187,8 @@ namespace MeshWorker const BlockVector& local, const std::vector& dof) { + if(constraints == 0) + { for (unsigned int b=0;bblock_info->local().local_to_global(b, j); global(dof[jcell]) += local.block(b)(j); } + } + else + constraints->distribute_local_to_global(local, dof, global); }