From: Daniel Arndt Date: Wed, 6 Apr 2016 17:56:03 +0000 (+0200) Subject: Fix for ResidualSimple X-Git-Tag: v8.5.0-rc1~1127^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a0ad009fc697d7083174a43f1446d60bdfc100;p=dealii.git Fix for ResidualSimple --- diff --git a/include/deal.II/meshworker/simple.h b/include/deal.II/meshworker/simple.h index 862d62a749..431106b0b1 100644 --- a/include/deal.II/meshworker/simple.h +++ b/include/deal.II/meshworker/simple.h @@ -276,7 +276,6 @@ namespace MeshWorker * Initialize the matrices #interface_in and #interface_out used for * local refinement with continuous Galerkin methods. */ - void initialize_interfaces(MGLevelObject &interface_in, MGLevelObject &interface_out); /** @@ -519,18 +518,16 @@ namespace MeshWorker for (unsigned int k=0; k(k); - if (constraints == 0) - { - for (unsigned int i=0; idistribute_local_to_global(info.vector(k).block(0), info.indices, *v); + const std::vector &ldi = info.vector(k).n_blocks()==1? + info.indices: + info.indices_by_block[i]; + + if (constraints !=0) + constraints->distribute_local_to_global(info.vector(k).block(i), ldi, *v); else - for (unsigned int i=0; i != info.vector(k).n_blocks(); ++i) - constraints->distribute_local_to_global(info.vector(k).block(i), info.indices_by_block[i], *v); + v->add(ldi, info.vector(k).block(i)); } } } @@ -541,41 +538,8 @@ namespace MeshWorker ResidualSimple::assemble(const DOFINFO &info1, const DOFINFO &info2) { - for (unsigned int k=0; k(k); - if (constraints == 0) - { - for (unsigned int i=0; idistribute_local_to_global - (info1.vector(k).block(0), info1.indices, *v); - constraints->distribute_local_to_global - (info2.vector(k).block(0), info2.indices, *v); - } - else if (info1.indices_by_block.size() != 0 && info2.indices_by_block.size() != 0) - { - for (unsigned int i=0; idistribute_local_to_global - (info1.vector(k).block(i), info1.indices_by_block[i], *v); - constraints->distribute_local_to_global - (info2.vector(k).block(i), info2.indices_by_block[i], *v); - } - } - else - { - Assert(false, ExcNotImplemented()); - } - } - } + assemble(info1); + assemble(info2); }