diff --git a/dune/detailed/discretizations/assembler/local/codim0/matrix.hh b/dune/detailed/discretizations/assembler/local/codim0/matrix.hh index c5d277f18737e923d8509c9b12f9ff5998bf4758..68d0dd54cc7e22158ff24394748cd65803d99611 100644 --- a/dune/detailed/discretizations/assembler/local/codim0/matrix.hh +++ b/dune/detailed/discretizations/assembler/local/codim0/matrix.hh @@ -4,6 +4,9 @@ // std includes #include <vector> +// dune-stuff +#include <dune/stuff/common/matrix.hh> + // local includes #include "vector.hh" @@ -92,6 +95,9 @@ public: 1, LocalMatrixType(ansatzSpace.map().maxLocalSize(), testSpace.map().maxLocalSize(), RangeFieldType(0.0))); } + // clear target matrix + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); + // write local operator application to tmpLocalMatrix localOperator_.applyLocal( localAnsatzBaseFunctionSet, localTestBaseFunctionSet, tmpLocalMatrices[0], tmpLocalMatricesContainer[1]); diff --git a/dune/detailed/discretizations/assembler/local/codim0/vector.hh b/dune/detailed/discretizations/assembler/local/codim0/vector.hh index dfd7ccbb182ae2206c5bfda15c01df1b218b87be..0d064a896d222528f4e124e3d0006e3cc2f21459 100644 --- a/dune/detailed/discretizations/assembler/local/codim0/vector.hh +++ b/dune/detailed/discretizations/assembler/local/codim0/vector.hh @@ -1,9 +1,12 @@ #ifndef DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM0_VECTOR_HH #define DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM0_VECTOR_HH -// std includes +// system #include <vector> +// dune-stuff +#include <dune/stuff/common/vector.hh> + namespace Dune { namespace Detailed { @@ -63,6 +66,9 @@ public: tmpLocalVectors.resize(1, LocalVectorType(testSpace.map().maxLocalSize(), RangeFieldType(0.0))); } + // clear target vector + Dune::Stuff::Common::clear(tmpLocalVectors[0]); + // write local functional application to tmpLocalVector localFunctional_.applyLocal(localTestBaseFunctionSet, tmpLocalVectors[0], tmpLocalVectorsContainer[1]); diff --git a/dune/detailed/discretizations/assembler/local/codim1/matrix.hh b/dune/detailed/discretizations/assembler/local/codim1/matrix.hh index 18e4596645bf99a91d819817fcc5d71fba638dbd..29c83c5ffcc66553cbe63d27baf96eb851a829ac 100644 --- a/dune/detailed/discretizations/assembler/local/codim1/matrix.hh +++ b/dune/detailed/discretizations/assembler/local/codim1/matrix.hh @@ -1,9 +1,12 @@ #ifndef DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM1_MATRIX_HH #define DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM1_MATRIX_HH -// std includes +// system #include <vector> +// dune-stuff +#include <dune/stuff/common/matrix.hh> + // local includes //#include "vector.hh" @@ -91,6 +94,11 @@ public: std::max(innerTestSpace.map().maxLocalSize(), outerTestSpace.map().maxLocalSize()), RangeFieldType(0.0))); } // ensure enough tmp local matrices + // clear matrices + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); + Dune::Stuff::Common::clear(tmpLocalMatrices[1]); + Dune::Stuff::Common::clear(tmpLocalMatrices[2]); + Dune::Stuff::Common::clear(tmpLocalMatrices[3]); // apply local operator localOperator_.applyLocal(innerAnsatzBaseFunctionSet, innerTestBaseFunctionSet, @@ -189,8 +197,10 @@ public: if (tmpLocalMatrices.size() < numTmpObjectsRequired_) { tmpLocalMatrices.resize( numTmpObjectsRequired_, - LocalMatrixType(ansatzSpace.map().maxLocalSize(), testSpace.map().maxLocalSize(), RangeFieldType(0.0))); + LocalMatrixType(ansatzSpace.map().maxLocalSize(), testSpace.map().maxLocalSize(), RangeFieldType(0))); } // ensure enough tmp local matrices + // clear matric + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); // apply local operator localOperator_.applyLocal(localAnsatzBaseFunctionSet, localTestBaseFunctionSet, diff --git a/dune/detailed/discretizations/assembler/local/codim1/vector.hh b/dune/detailed/discretizations/assembler/local/codim1/vector.hh index 124530beb20ca6d5d117d43658d1c774a1cdb5b9..b9dbfa0cf02330f4975c3bdf8abb9e4b924e4568 100644 --- a/dune/detailed/discretizations/assembler/local/codim1/vector.hh +++ b/dune/detailed/discretizations/assembler/local/codim1/vector.hh @@ -1,9 +1,12 @@ #ifndef DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM1_VECTOR_HH #define DUNE_DETAILED_DISCRETIZATIONS_ASSEMLBER_LOCAL_CODIM1_VECTOR_HH -// std includes +// system #include <vector> +// dune-stuff +#include <dune/stuff/common/vector.hh> + namespace Dune { namespace Detailed { @@ -98,21 +101,15 @@ public: if (!intersection.neighbor() && intersection.boundary()) // if boundary intersection { - // const unsigned int boundaryId = intersection.boundaryId(); + // clear target vectors + Dune::Stuff::Common::clear(tmpLocalVectors[0]); - // // if dirichlet boundary intersection - // if( boundaryId == 2 ) - // { localFunctional_.applyLocal( localTestBaseFunctionSet, intersection, tmpLocalVectors[0], tmpLocalVectorsContainer[1]); // write local vector to global addToVector(testSpace, entity, tmpLocalVectors[0], systemVector); - // } // end if dirichlet boundary intersection - // else if( boundaryId == 3 ) // if neumann boundary intersection - // { - // } // end if neumann boundary intersection } // end if boundary intersection } // done loop over all intersections } // end method assembleLocal diff --git a/dune/detailed/discretizations/discretefunctional/local/codim0/integral.hh b/dune/detailed/discretizations/discretefunctional/local/codim0/integral.hh index 754b147868de2c98418a828f008c43ea2351058d..6df6b0dedaffc28df6daf2e68abe3580b5a314e5 100644 --- a/dune/detailed/discretizations/discretefunctional/local/codim0/integral.hh +++ b/dune/detailed/discretizations/discretefunctional/local/codim0/integral.hh @@ -87,9 +87,6 @@ public: RangeFieldType(0.0))); } - // clear target vector - Dune::Stuff::Common::clear(localVector); - const typename VolumeQuadratureType::const_iterator quadratureEnd = volumeQuadrature.end(); for (typename VolumeQuadratureType::const_iterator quadPoint = volumeQuadrature.begin(); quadPoint != quadratureEnd; ++quadPoint) { @@ -100,6 +97,9 @@ public: const double integrationFactor = localTestBaseFunctionSet.entity().geometry().integrationElement(x); const double quadratureWeight = quadPoint->weight(); + // clear target vector + Dune::Stuff::Common::clear(tmpLocalVectors[0]); + // evaluate the local evaluation localEvaluation_.evaluateLocal(localTestBaseFunctionSet, x, tmpLocalVectors[0]); diff --git a/dune/detailed/discretizations/discreteoperator/local/codim0/integral.hh b/dune/detailed/discretizations/discreteoperator/local/codim0/integral.hh index be3e33f9678fcbcb5caf1839dd2fdf10a8c91cb2..7fc9b57f4162c651cf9e2b6b476b0f3eb2a67dfc 100644 --- a/dune/detailed/discretizations/discreteoperator/local/codim0/integral.hh +++ b/dune/detailed/discretizations/discreteoperator/local/codim0/integral.hh @@ -161,15 +161,12 @@ public: assert(localMatrix.rows() >= rows); assert(localMatrix.cols() >= cols); - // clear target matrix - Dune::Stuff::Common::clear(localMatrix); - // check tmp local matrices if (tmpLocalMatrices.size() < 1) { tmpLocalMatrices.resize(1, LocalMatrixType(localAnsatzBaseFunctionSet.baseFunctionSet().space().map().maxLocalSize(), localTestBaseFunctionSet.baseFunctionSet().space().map().maxLocalSize(), - RangeFieldType(0.0))); + RangeFieldType(0))); } // do loop over all quadrature points @@ -183,6 +180,9 @@ public: const double integrationFactor = localAnsatzBaseFunctionSet.entity().geometry().integrationElement(x); const double quadratureWeight = quadPoint->weight(); + // clear target matrix + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); + // evaluate the local operation localEvaluation_.evaluateLocal(localAnsatzBaseFunctionSet, localTestBaseFunctionSet, x, tmpLocalMatrices[0]); diff --git a/dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh b/dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh index 4200fbbbbe82c9c276d147e1931f1569483f6062..ddecfc725eeb5eda62b8eba8fa691fbd91d6867a 100644 --- a/dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh +++ b/dune/detailed/discretizations/discreteoperator/local/codim1/boundaryintegral.hh @@ -95,15 +95,12 @@ public: assert(localMatrix.rows() >= rows); assert(localMatrix.cols() >= cols); - // clear target matrix - Dune::Stuff::Common::clear(localMatrix); - // check tmp local matrices if (tmpLocalMatrices.size() < numTmpObjectsRequired()) { tmpLocalMatrices.resize(numTmpObjectsRequired(), LocalMatrixType(localAnsatzBaseFunctionSet.baseFunctionSet().space().map().maxLocalSize(), localTestBaseFunctionSet.baseFunctionSet().space().map().maxLocalSize(), - RangeFieldType(0.0))); + RangeFieldType(0))); } // check tmp local matrices // quadrature @@ -124,6 +121,9 @@ public: const double integrationFactor = intersection.geometry().integrationElement(x); const double quadratureWeight = quadPoint->weight(); + // clear target matrix + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); + // evaluate the local operation localEvaluation_.evaluateLocal( localAnsatzBaseFunctionSet, localTestBaseFunctionSet, intersection, x, tmpLocalMatrices[0]); diff --git a/dune/detailed/discretizations/discreteoperator/local/codim1/innerintegral.hh b/dune/detailed/discretizations/discreteoperator/local/codim1/innerintegral.hh index 6e10e6057103058a97025cbfc7e2451ec2499801..35ccfa4f228096ec251786cb2b79b1f6cddab660 100644 --- a/dune/detailed/discretizations/discreteoperator/local/codim1/innerintegral.hh +++ b/dune/detailed/discretizations/discreteoperator/local/codim1/innerintegral.hh @@ -111,12 +111,6 @@ public: assert(localMatrixNeNe.rows() >= rowsNe); assert(localMatrixNeNe.cols() >= colsNe); - // clear target matrices - Dune::Stuff::Common::clear(localMatrixEnEn); - Dune::Stuff::Common::clear(localMatrixEnNe); - Dune::Stuff::Common::clear(localMatrixNeEn); - Dune::Stuff::Common::clear(localMatrixNeNe); - // check tmp local matrices if (tmpLocalMatrices.size() < numTmpObjectsRequired()) { tmpLocalMatrices.resize( @@ -143,12 +137,18 @@ public: ++quadPoint) { // local coordinates typedef typename IntersectionType::LocalCoordinate LocalCoordinateType; - const LocalCoordinateType x = quadPoint->position(); + const LocalCoordinateType& x = quadPoint->position(); // integration factors const double integrationFactor = intersection.geometry().integrationElement(x); const double quadratureWeight = quadPoint->weight(); + // clear target matrices + Dune::Stuff::Common::clear(tmpLocalMatrices[0]); + Dune::Stuff::Common::clear(tmpLocalMatrices[1]); + Dune::Stuff::Common::clear(tmpLocalMatrices[2]); + Dune::Stuff::Common::clear(tmpLocalMatrices[3]); + // evaluate the local operation localEvaluation_.evaluateLocal(localAnsatzBaseFunctionSetEntity, localTestBaseFunctionSetEntity,