Address PR Review Comments

This commit is contained in:
Bård Skaflestad 2024-12-16 12:17:09 +01:00
parent 7ea8743943
commit 2e6a3ae79b
3 changed files with 16 additions and 9 deletions

View File

@ -110,7 +110,12 @@ class ASMHandler {
const Dune::FieldVector<double,esize>* S, const Dune::FieldVector<double,esize>* S,
const LeafIterator& cell, const LeafIterator& cell,
Vector* b=NULL); Vector* b=NULL);
void addMatElement(int i,int j,double val){ A[i][j] += val;}
void addMatElement(const int i, const int j, const double val)
{
A[i][j] += val;
}
//! \brief Extract values corresponding to cell //! \brief Extract values corresponding to cell
//! \param[in] u The global load vector //! \param[in] u The global load vector
//! \param[in] it An iterator to the cell we want to extract values for //! \param[in] it An iterator to the cell we want to extract values for

View File

@ -81,7 +81,7 @@ void Elasticity<GridType>::getBVector(Dune::FieldVector<ctype,funcdims>& Bvector
= P1ShapeFunctionSet<ctype,ctype,dim>::instance(); = P1ShapeFunctionSet<ctype,ctype,dim>::instance();
Dune::FieldMatrix<ctype,funcdims,dim> N; Dune::FieldMatrix<ctype,funcdims,dim> N;
for (int i=0;i < funcdims; i++){ for (int i = 0; i < funcdims; i++) {
Bvector[i] = basis[i].evaluateFunction(point); Bvector[i] = basis[i].evaluateFunction(point);
} }
} }

View File

@ -44,14 +44,16 @@ class MeshColorizer {
} }
//! \brief Calculate the coloring //! \brief Calculate the coloring
void calcGroups(){ void calcGroups()
tg[0].resize(1); {
tg[0].reserve(grid.size(0)); tg[0].resize(1);
for (int i = 0; i < grid.size(0); ++i) tg[0].reserve(grid.size(0));
tg[0][0].push_back(i); for (int i = 0; i < grid.size(0); ++i) {
tg[1].clear(); tg[0][0].push_back(i);
}
tg[1].clear();
} }
private: private:
IntMat tg[2]; //!< The color groups IntMat tg[2]; //!< The color groups
const GridType& grid; //!< Reference to grid being colored const GridType& grid; //!< Reference to grid being colored