make some things const where possible

This commit is contained in:
Arne Morten Kvarving 2021-09-30 12:04:09 +02:00
parent a75a0c7158
commit 3e9014c8d0
4 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ public:
std::string getName() const override { return "Semi3D"; }
//! \brief Adds fields to a data exporter.
void registerFields(DataExporter& exporter)
void registerFields(const DataExporter& exporter)
{
std::string name = exporter.getName();
int plane = 1 + startCtx;

View File

@ -326,7 +326,7 @@ bool ASMs2DC1::addRigidCpl (int lindx, int ldim, int basis,
\brief Computes coupling coefficients for a 2-master constraint in a C1-patch.
*/
static void initMPC2 (MPC* mpc, std::vector<Vec3>& X)
static void initMPC2 (MPC* mpc, const std::vector<Vec3>& X)
{
double s1 = (X[1]-X[0]).length();
double s2 = (X[2]-X[0]).length();
@ -339,7 +339,7 @@ static void initMPC2 (MPC* mpc, std::vector<Vec3>& X)
\brief Computes coupling coefficients for a 3-master constraint in a C1-patch.
*/
static void initMPC3 (MPC* mpc, std::vector<Vec3>& X)
static void initMPC3 (MPC* mpc, const std::vector<Vec3>& X)
{
Vec3 V10(X[0]-X[1]);
Vec3 V12(X[2]-X[1]);

View File

@ -207,7 +207,7 @@ static void getNumEdges(void* mesh, int sizeGID, int sizeLID,
int numCells, ZOLTAN_ID_PTR globalID,
ZOLTAN_ID_PTR localID, int* numEdges, int* err)
{
IntMat& neigh = *static_cast<IntMat*>(mesh);
const IntMat& neigh = *static_cast<const IntMat*>(mesh);
int* ne = numEdges;
for (const std::vector<int>& n : neigh)
*ne++ = std::accumulate(n.begin(), n.end(), 0,
@ -225,7 +225,7 @@ static void getEdges(void* mesh, int sizeGID, int sizeLID, int numCells,
int* numEdges, ZOLTAN_ID_PTR nborGID, int* nborProc,
int wgtDim, float* egts, int* err)
{
IntMat& neigh = *static_cast<IntMat*>(mesh);
const IntMat& neigh = *static_cast<const IntMat*>(mesh);
memset(nborProc, 0, numCells*sizeof(int));
for (const std::vector<int>& elm : neigh)

View File

@ -42,7 +42,7 @@ int IFEM::Init (int arg_c, char** arg_v, const char* title)
{
argc = arg_c;
argv = arg_v;
LinAlgInit& linalg = LinAlgInit::Init(argc,argv);
const LinAlgInit& linalg = LinAlgInit::Init(argc,argv);
LinAlgInit::increfs();
bool enableController = false;