diff --git a/dune/fufem/assemblers/dunefunctionsboundaryfunctionalassembler.hh b/dune/fufem/assemblers/dunefunctionsboundaryfunctionalassembler.hh index af6cc24bec1db36a188e9440f65f878ecd3c9584..ba3bc7238997c416e5c586e267929be79f3c11d2 100644 --- a/dune/fufem/assemblers/dunefunctionsboundaryfunctionalassembler.hh +++ b/dune/fufem/assemblers/dunefunctionsboundaryfunctionalassembler.hh @@ -35,9 +35,8 @@ public: void assembleBulkEntries(VectorBackend&& vectorBackend, LocalAssembler&& localAssembler) const { auto trialLocalView = trialBasis_.localView(); - auto trialLocalIndexSet = trialBasis_.localIndexSet(); - using Field = std::decay_t<decltype(vectorBackend(trialLocalIndexSet.index(0)))>; + using Field = std::decay_t<decltype(vectorBackend(trialLocalView.index(0)))>; using LocalVector = Dune::BlockVector<Dune::FieldVector<Field,1>>; auto localVector = LocalVector(trialLocalView.maxSize()); @@ -47,13 +46,12 @@ public: { const auto& element = it->inside(); trialLocalView.bind(element); - trialLocalIndexSet.bind(trialLocalView); localAssembler(it, localVector, trialLocalView); - for (size_t localRow=0; localRow<trialLocalIndexSet.size(); ++localRow) + for (size_t localRow=0; localRow<trialLocalView.size(); ++localRow) { - auto row = trialLocalIndexSet.index(localRow); + auto row = trialLocalView.index(localRow); vectorBackend(row) += localVector[localRow]; } } diff --git a/dune/fufem/assemblers/dunefunctionsfunctionalassembler.hh b/dune/fufem/assemblers/dunefunctionsfunctionalassembler.hh index 1692429c873a8ed277d0c8df20baf5d2bf2c3794..d7a72bba1ebf444947f1b4dd907a4dac344f2e3f 100644 --- a/dune/fufem/assemblers/dunefunctionsfunctionalassembler.hh +++ b/dune/fufem/assemblers/dunefunctionsfunctionalassembler.hh @@ -33,9 +33,8 @@ public: void assembleBulkEntries(VectorBackend&& vectorBackend, LocalAssembler&& localAssembler) const { auto trialLocalView = trialBasis_.localView(); - auto trialLocalIndexSet = trialBasis_.localIndexSet(); - using Field = std::decay_t<decltype(vectorBackend(trialLocalIndexSet.index(0)))>; + using Field = std::decay_t<decltype(vectorBackend(trialLocalView.index(0)))>; using LocalVector = Dune::BlockVector<Dune::FieldVector<Field,1>>; auto localVector = LocalVector(trialLocalView.maxSize()); @@ -43,14 +42,13 @@ public: for (const auto& element : elements(trialBasis_.gridView())) { trialLocalView.bind(element); - trialLocalIndexSet.bind(trialLocalView); localAssembler(element, localVector, trialLocalView); // Add element stiffness matrix onto the global stiffness matrix - for (size_t localRow=0; localRow<trialLocalIndexSet.size(); ++localRow) + for (size_t localRow=0; localRow<trialLocalView.size(); ++localRow) { - auto row = trialLocalIndexSet.index(localRow); + auto row = trialLocalView.index(localRow); vectorBackend(row) += localVector[localRow]; } } diff --git a/dune/fufem/assemblers/dunefunctionsoperatorassembler.hh b/dune/fufem/assemblers/dunefunctionsoperatorassembler.hh index b247a67a0df3947f25af7fdaa07a73ecddaac2f8..9400e130cd30f7263b330ae63ce836655567082a 100644 --- a/dune/fufem/assemblers/dunefunctionsoperatorassembler.hh +++ b/dune/fufem/assemblers/dunefunctionsoperatorassembler.hh @@ -38,26 +38,22 @@ public: patternBuilder.resize(trialBasis_, ansatzBasis_); auto trialLocalView = trialBasis_.localView(); - auto trialLocalIndexSet = trialBasis_.localIndexSet(); auto ansatzLocalView = ansatzBasis_.localView(); - auto ansatzLocalIndexSet = ansatzBasis_.localIndexSet(); for (const auto& element : elements(trialBasis_.gridView())) { trialLocalView.bind(element); - trialLocalIndexSet.bind(trialLocalView); ansatzLocalView.bind(element); - ansatzLocalIndexSet.bind(ansatzLocalView); // Add element stiffness matrix onto the global stiffness matrix - for (size_t i=0; i<trialLocalIndexSet.size(); ++i) + for (size_t i=0; i<trialLocalView.size(); ++i) { - auto row = trialLocalIndexSet.index(i); - for (size_t j=0; j<ansatzLocalIndexSet.size(); ++j) + auto row = trialLocalView.index(i); + for (size_t j=0; j<ansatzLocalView.size(); ++j) { - auto col = ansatzLocalIndexSet.index(j); + auto col = ansatzLocalView.index(j); patternBuilder.insertEntry(row,col); } } @@ -72,30 +68,24 @@ public: patternBuilder.resize(trialBasis_, ansatzBasis_); auto insideTrialLocalView = trialBasis_.localView(); - auto insideTrialLocalIndexSet = trialBasis_.localIndexSet(); auto insideAnsatzLocalView = ansatzBasis_.localView(); - auto insideAnsatzLocalIndexSet = ansatzBasis_.localIndexSet(); auto outsideTrialLocalView = trialBasis_.localView(); - auto outsideTrialLocalIndexSet = trialBasis_.localIndexSet(); auto outsideAnsatzLocalView = ansatzBasis_.localView(); - auto outsideAnsatzLocalIndexSet = ansatzBasis_.localIndexSet(); for (const auto& element : elements(trialBasis_.gridView())) { insideTrialLocalView.bind(element); - insideTrialLocalIndexSet.bind(insideTrialLocalView); insideAnsatzLocalView.bind(element); - insideAnsatzLocalIndexSet.bind(insideAnsatzLocalView); /* Coupling on the same element */ - for (size_t i = 0; i < insideTrialLocalIndexSet.size(); i++) { - auto row = insideTrialLocalIndexSet.index(i); - for (size_t j = 0; j < insideAnsatzLocalIndexSet.size(); j++) { - auto col = insideAnsatzLocalIndexSet.index(j); + for (size_t i = 0; i < insideTrialLocalView.size(); i++) { + auto row = insideTrialLocalView.index(i); + for (size_t j = 0; j < insideAnsatzLocalView.size(); j++) { + auto col = insideAnsatzLocalView.index(j); patternBuilder.insertEntry(row,col); } } @@ -110,18 +100,16 @@ public: // Bind the outer parts to the outer element outsideTrialLocalView.bind(outsideElement); - outsideTrialLocalIndexSet.bind(outsideTrialLocalView); outsideAnsatzLocalView.bind(outsideElement); - outsideAnsatzLocalIndexSet.bind(outsideAnsatzLocalView); // We assume that all basis functions of the inner element couple with all basis functions from the outer one - for (size_t i=0; i<insideTrialLocalIndexSet.size(); ++i) + for (size_t i=0; i<insideTrialLocalView.size(); ++i) { - auto row = insideTrialLocalIndexSet.index(i); - for (size_t j=0; j<outsideAnsatzLocalIndexSet.size(); ++j) + auto row = insideTrialLocalView.index(i); + for (size_t j=0; j<outsideAnsatzLocalView.size(); ++j) { - auto col = outsideAnsatzLocalIndexSet.index(j); + auto col = outsideAnsatzLocalView.index(j); patternBuilder.insertEntry(row,col); } } @@ -136,12 +124,10 @@ public: void assembleBulkEntries(MatrixBackend&& matrixBackend, LocalAssembler&& localAssembler) const { auto trialLocalView = trialBasis_.localView(); - auto trialLocalIndexSet = trialBasis_.localIndexSet(); auto ansatzLocalView = ansatzBasis_.localView(); - auto ansatzLocalIndexSet = ansatzBasis_.localIndexSet(); - using Field = std::decay_t<decltype(matrixBackend(trialLocalIndexSet.index(0), ansatzLocalIndexSet.index(0)))>; + using Field = std::decay_t<decltype(matrixBackend(trialLocalView.index(0), ansatzLocalView.index(0)))>; using LocalMatrix = Dune::Matrix<Dune::FieldMatrix<Field,1,1>>; auto localMatrix = LocalMatrix(trialLocalView.maxSize(), ansatzLocalView.maxSize()); @@ -149,20 +135,18 @@ public: for (const auto& element : elements(trialBasis_.gridView())) { trialLocalView.bind(element); - trialLocalIndexSet.bind(trialLocalView); ansatzLocalView.bind(element); - ansatzLocalIndexSet.bind(ansatzLocalView); localAssembler(element, localMatrix, trialLocalView, ansatzLocalView); // Add element stiffness matrix onto the global stiffness matrix - for (size_t localRow=0; localRow<trialLocalIndexSet.size(); ++localRow) + for (size_t localRow=0; localRow<trialLocalView.size(); ++localRow) { - auto row = trialLocalIndexSet.index(localRow); - for (size_t localCol=0; localCol<ansatzLocalIndexSet.size(); ++localCol) + auto row = trialLocalView.index(localRow); + for (size_t localCol=0; localCol<ansatzLocalView.size(); ++localCol) { - auto col = ansatzLocalIndexSet.index(localCol); + auto col = ansatzLocalView.index(localCol); matrixBackend(row,col) += localMatrix[localRow][localCol]; } } @@ -184,18 +168,14 @@ public: Dune::MultipleCodimMultipleGeomTypeMapper<GridView> faceMapper(trialBasis_.gridView(), mcmgElementLayout()); auto insideTrialLocalView = trialBasis_.localView(); - auto insideTrialLocalIndexSet = trialBasis_.localIndexSet(); auto insideAnsatzLocalView = ansatzBasis_.localView(); - auto insideAnsatzLocalIndexSet = ansatzBasis_.localIndexSet(); auto outsideTrialLocalView = trialBasis_.localView(); - auto outsideTrialLocalIndexSet = trialBasis_.localIndexSet(); auto outsideAnsatzLocalView = ansatzBasis_.localView(); - auto outsideAnsatzLocalIndexSet = ansatzBasis_.localIndexSet(); - using Field = std::decay_t<decltype(matrixBackend(insideTrialLocalIndexSet.index(0), insideAnsatzLocalIndexSet.index(0)))>; + using Field = std::decay_t<decltype(matrixBackend(insideTrialLocalView.index(0), insideAnsatzLocalView.index(0)))>; using LocalMatrix = Dune::Matrix<Dune::FieldMatrix<Field,1,1>>; using MatrixContainer = Dune::Matrix<LocalMatrix>; auto matrixContrainer = MatrixContainer(2,2); @@ -209,10 +189,8 @@ public: for (const auto& element : elements(trialBasis_.gridView())) { insideTrialLocalView.bind(element); - insideTrialLocalIndexSet.bind(insideTrialLocalView); insideAnsatzLocalView.bind(element); - insideAnsatzLocalIndexSet.bind(insideAnsatzLocalView); for (const auto& is : intersections(trialBasis_.gridView(), element)) { @@ -223,9 +201,9 @@ public: auto& localMatrix = matrixContrainer[0][0]; localBoundaryAssembler(is, localMatrix, insideTrialLocalView, insideAnsatzLocalView); - for (size_t i=0; i< insideTrialLocalIndexSet.size(); i++) { - for (size_t j=0; j< insideAnsatzLocalIndexSet.size(); j++) - matrixBackend(insideTrialLocalIndexSet.index(i), insideAnsatzLocalIndexSet.index(j))+=localMatrix[i][j]; + for (size_t i=0; i< insideTrialLocalView.size(); i++) { + for (size_t j=0; j< insideAnsatzLocalView.size(); j++) + matrixBackend(insideTrialLocalView.index(i), insideAnsatzLocalView.index(j))+=localMatrix[i][j]; } } else if (is.neighbor()) @@ -240,43 +218,41 @@ public: // Bind the outer parts to the outer element outsideTrialLocalView.bind(outsideElement); - outsideTrialLocalIndexSet.bind(outsideTrialLocalView); outsideAnsatzLocalView.bind(outsideElement); - outsideAnsatzLocalIndexSet.bind(outsideAnsatzLocalView); localAssembler(is, matrixContrainer, insideTrialLocalView, insideAnsatzLocalView, outsideTrialLocalView, outsideAnsatzLocalView); - for (size_t i=0; i < insideTrialLocalIndexSet.size(); i++) + for (size_t i=0; i < insideTrialLocalView.size(); i++) { - auto row = insideTrialLocalIndexSet.index(i); + auto row = insideTrialLocalView.index(i); // inside x inside - for (size_t j=0; j < insideTrialLocalIndexSet.size(); j++) + for (size_t j=0; j < insideTrialLocalView.size(); j++) { - auto col = insideTrialLocalIndexSet.index(j); + auto col = insideTrialLocalView.index(j); matrixBackend(row, col) += matrixContrainer[0][0][i][j]; } // inside x outside - for (size_t j=0; j < outsideAnsatzLocalIndexSet.size(); j++) + for (size_t j=0; j < outsideAnsatzLocalView.size(); j++) { - auto col = outsideAnsatzLocalIndexSet.index(j); + auto col = outsideAnsatzLocalView.index(j); matrixBackend(row, col) += matrixContrainer[0][1][i][j]; } } - for (size_t i=0; i < outsideTrialLocalIndexSet.size(); i++) + for (size_t i=0; i < outsideTrialLocalView.size(); i++) { - auto row = outsideTrialLocalIndexSet.index(i); + auto row = outsideTrialLocalView.index(i); // outside x inside - for (size_t j=0; j < insideAnsatzLocalIndexSet.size(); j++) + for (size_t j=0; j < insideAnsatzLocalView.size(); j++) { - auto col = insideAnsatzLocalIndexSet.index(j); + auto col = insideAnsatzLocalView.index(j); matrixBackend(row, col) += matrixContrainer[1][0][i][j]; } // outside x outside - for (size_t j=0; j < outsideAnsatzLocalIndexSet.size(); j++) + for (size_t j=0; j < outsideAnsatzLocalView.size(); j++) { - auto col = outsideAnsatzLocalIndexSet.index(j); + auto col = outsideAnsatzLocalView.index(j); matrixBackend(row, col) += matrixContrainer[1][1][i][j]; } } diff --git a/dune/fufem/functionspacebases/dunefunctionsbasis.hh b/dune/fufem/functionspacebases/dunefunctionsbasis.hh index 0d9cd0942ba76cdee5b6b6b8ca04d15e2e5e767a..5b8636b2129079bd0f7205f671f0968cb1b09112 100644 --- a/dune/fufem/functionspacebases/dunefunctionsbasis.hh +++ b/dune/fufem/functionspacebases/dunefunctionsbasis.hh @@ -71,12 +71,8 @@ public: */ int index(const Element& element, const int i) const { - auto localIndexSet = dfBasis_.localIndexSet(); - localView_.bind(element); - localIndexSet.bind(localView_); - - return localIndexSet.index(i)[0]; + return localView_.index(i)[0]; } protected: