Skip to content
Snippets Groups Projects
Commit 19ffe697 authored by Max Kahnt's avatar Max Kahnt
Browse files

Use auto keyword, fix typos.

parent 0408e2ea
No related branches found
No related tags found
No related merge requests found
...@@ -45,9 +45,6 @@ void setupSubgridToHostgridTransfer(TransferOperatorType& matrix, const SubGridB ...@@ -45,9 +45,6 @@ void setupSubgridToHostgridTransfer(TransferOperatorType& matrix, const SubGridB
{ {
typedef typename SubGridBasis::GridView::Grid SubGridType; typedef typename SubGridBasis::GridView::Grid SubGridType;
typedef typename SubGridType::HostGridType HostGridType; typedef typename SubGridType::HostGridType HostGridType;
//typedef typename HostGridType::LeafGridView::template Codim<0>::Entity HostElement;
//typedef typename SubGridType::LeafGridView::template Codim<0>::Iterator ElementIterator;
typedef typename HostGridType::template Codim<0>::Entity::HierarchicIterator HierarchicIterator;
typedef std::map<int, double> LinearCombination; typedef std::map<int, double> LinearCombination;
typedef std::vector<LinearCombination> BasisTransformation; typedef std::vector<LinearCombination> BasisTransformation;
typedef typename SubGridBasis::LocalFiniteElement CLFE; typedef typename SubGridBasis::LocalFiniteElement CLFE;
...@@ -98,13 +95,13 @@ void setupSubgridToHostgridTransfer(TransferOperatorType& matrix, const SubGridB ...@@ -98,13 +95,13 @@ void setupSubgridToHostgridTransfer(TransferOperatorType& matrix, const SubGridB
std::vector<CFERange> valuesAtPosition(coarseFE.localBasis().size()); std::vector<CFERange> valuesAtPosition(coarseFE.localBasis().size());
// loop over all children on next level // loop over all children on next level
HierarchicIterator fIt = hostElement.hbegin(level+1); auto fIt = hostElement.hbegin(level+1);
HierarchicIterator fEnd = hostElement.hend(level+1); auto fEnd = hostElement.hend(level+1);
for (; fIt != fEnd; ++fIt) for (; fIt != fEnd; ++fIt)
{ {
const FLFE& fineFE = hostgridbasis.getLocalFiniteElement(*fIt); const FLFE& fineFE = hostgridbasis.getLocalFiniteElement(*fIt);
// we need the refrence element to get the local position of the subentities corresponding to fine basis functions // we need the reference element to get the local position of the subentities corresponding to fine basis functions
const Dune::ReferenceElement<double,dim>& fineRefElement = Dune::ReferenceElements<double, dim>::general(fIt->type()); const Dune::ReferenceElement<double,dim>& fineRefElement = Dune::ReferenceElements<double, dim>::general(fIt->type());
// loop over all child nodes // loop over all child nodes
...@@ -184,9 +181,8 @@ struct SubgridL2FunctionalAssemblerTestSuite ...@@ -184,9 +181,8 @@ struct SubgridL2FunctionalAssemblerTestSuite
grid.insertLevel(hostgrid.maxLevel()-1); grid.insertLevel(hostgrid.maxLevel()-1);
/* ...but we do want it to contain some hostgrid leafelements */ /* ...but we do want it to contain some hostgrid leafelements */
typedef typename HostGridType::LeafGridView::template Codim<0>::Iterator HostElementIterator; auto helt=hostgrid.leafGridView().template begin<0>();
HostElementIterator helt=hostgrid.leafGridView().template begin<0>(); auto hend=hostgrid.leafGridView().template end<0>();
HostElementIterator hend=hostgrid.leafGridView().template end<0>();
for (int n_elts=0; helt!=hend and n_elts<hostgrid.size(0)/4; ++helt, ++n_elts) for (int n_elts=0; helt!=hend and n_elts<hostgrid.size(0)/4; ++helt, ++n_elts)
grid.insert(*helt); grid.insert(*helt);
...@@ -250,7 +246,7 @@ struct SubgridL2FunctionalAssemblerTestSuite ...@@ -250,7 +246,7 @@ struct SubgridL2FunctionalAssemblerTestSuite
{ {
if (g[j][k]-gsubcoeffs[j][k]>1e-14) if (g[j][k]-gsubcoeffs[j][k]>1e-14)
{ {
std::cout << "g[" << j << "," << k << "]= " << g[j][k] << " gsubcoeffs[" << j << "," << k << "]= " << gsubcoeffs[j][k] << std::endl;; std::cout << "Problem detected: g[" << j << "," << k << "]= " << g[j][k] << " gsubcoeffs[" << j << "," << k << "]= " << gsubcoeffs[j][k] << std::endl;;
return false; return false;
} }
} }
...@@ -279,9 +275,8 @@ struct SubgridH1FunctionalAssemblerTestSuite ...@@ -279,9 +275,8 @@ struct SubgridH1FunctionalAssemblerTestSuite
grid.insertLevel(hostgrid.maxLevel()-1); grid.insertLevel(hostgrid.maxLevel()-1);
/* ...but we do want it to contain some hostgrid leafelements */ /* ...but we do want it to contain some hostgrid leafelements */
typedef typename HostGridType::LeafGridView::template Codim<0>::Iterator HostElementIterator; auto helt=hostgrid.leafGridView().template begin<0>();
HostElementIterator helt=hostgrid.leafGridView().template begin<0>(); auto hend=hostgrid.leafGridView().template end<0>();
HostElementIterator hend=hostgrid.leafGridView().template end<0>();
for (int n_elts=0; helt!=hend and n_elts<hostgrid.size(0)/4; ++helt, ++n_elts) for (int n_elts=0; helt!=hend and n_elts<hostgrid.size(0)/4; ++helt, ++n_elts)
grid.insert(*helt); grid.insert(*helt);
...@@ -364,7 +359,7 @@ struct SubgridH1FunctionalAssemblerTestSuite ...@@ -364,7 +359,7 @@ struct SubgridH1FunctionalAssemblerTestSuite
{ {
if (g[j][k]-gsubcoeffs[j][k]>1e-14) if (g[j][k]-gsubcoeffs[j][k]>1e-14)
{ {
std::cout << "g[" << j << "," << k << "]= " << g[j][k] << " gsubcoeffs[" << j << "," << k << "]= " << gsubcoeffs[j][k] << std::endl;; std::cout << "Problem detected: g[" << j << "," << k << "]= " << g[j][k] << " gsubcoeffs[" << j << "," << k << "]= " << gsubcoeffs[j][k] << std::endl;;
return false; return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment