From: Baerbel Jannsen Date: Mon, 22 Mar 2010 18:46:03 +0000 (+0000) Subject: constraints used in Residual X-Git-Tag: v8.0.0~6279 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c012754c9ff6114d1ba852015329978d18e0dcc;p=dealii.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); }