Commit 077015a6 authored by Johannes Hommel's avatar Johannes Hommel
Browse files

[naming] replace nodeIdx, faceVertIdx, elemVertIdx, innerFaceIdx,

pglobal, global by vIdxGlobal, faceVertexIdx, vIdx, fIdxInner, pGlobal,
globalPos

As decided at the Dumux day.

Made by Bernd, partially reviewed by Johannes.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13784 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent b4fedfeb
......@@ -101,7 +101,7 @@ template<class TypeTag> class FvMpfaL2dVelocity2p
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -98,7 +98,7 @@ template<class TypeTag> class FvMpfaL2dVelocity2pAdaptive : public FvMpfaL2dVelo
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -104,7 +104,7 @@ class FvMpfaL3dPressure2p: public FVPressure<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -108,7 +108,7 @@ class FvMpfaL3dPressure2pAdaptive: public FvMpfaL3dPressure2p<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -101,7 +101,7 @@ template<class TypeTag> class FvMpfaL3dVelocity2p
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -101,7 +101,7 @@ template<class TypeTag> class FvMpfaL3dVelocity2pAdaptive: public FvMpfaL3dVeloc
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -99,7 +99,7 @@ template<class TypeTag> class FvMpfaO2dVelocity2P
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -86,7 +86,7 @@ class MimeticTwoPLocalStiffness: public LocalStiffness<TypeTag, 1>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -87,7 +87,7 @@ class MimeticTwoPLocalStiffnessAdaptive: public LocalStiffness<TypeTag, 1>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -83,7 +83,7 @@ template<class TypeTag> class MimeticPressure2PAdaptive
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
vw = Indices::velocityW,
......
......@@ -107,7 +107,7 @@ template<class TypeTag> class FV3dPressure2P2CAdaptive
{
pw = Indices::pressureW,
pn = Indices::pressureN,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationN
};
......
......@@ -94,7 +94,7 @@ template<class TypeTag> class FVPressure2P2C
{
pw = Indices::pressureW,
pn = Indices::pressureN,
pglobal = Indices::pressureGlobal
pGlobal = Indices::pressureGlobal
};
enum
{
......
......@@ -374,15 +374,15 @@ protected:
const int numFaceVertices = refElement.size(fIdx, 1, dim);
// loop over the single vertices on the current face
for (int faceVertIdx = 0; faceVertIdx < numFaceVertices; ++faceVertIdx)
for (int faceVertexIdx = 0; faceVertexIdx < numFaceVertices; ++faceVertexIdx)
{
// only evaluate, if we consider the same face vertex as in the outer
// loop over the element vertices
if (refElement.subEntity(fIdx, 1, faceVertIdx, dim)
if (refElement.subEntity(fIdx, 1, faceVertexIdx, dim)
!= scvIdx)
continue;
const int boundaryFaceIdx = this->fvGeometry_().boundaryFaceIndex(fIdx, faceVertIdx);
const int boundaryFaceIdx = this->fvGeometry_().boundaryFaceIndex(fIdx, faceVertexIdx);
const FluxVariables boundaryVars(this->problem_(),
this->element_(),
this->fvGeometry_(),
......
......@@ -121,7 +121,7 @@ public:
bool hasLeft = false;
bool hasRight = false;
for (int i = 0; i < fvGeometry.numScv; i++) {
const GlobalPosition &global = fvGeometry.subContVol[i].global;
const GlobalPosition &globalPos = fvGeometry.subContVol[i].global;
if (globalI[axis] < coordVal)
hasLeft = true;
else if (globalI[axis] >= coordVal)
......@@ -131,7 +131,7 @@ public:
continue;
for (int i = 0; i < fvGeometry.numScv; i++) {
const GlobalPosition &global = fvGeometry.subContVol[i].global;
const GlobalPosition &globalPos = fvGeometry.subContVol[i].global;
if (globalI[axis] < coordVal)
flux += this->localResidual().residual(i);
}
......
......@@ -971,15 +971,15 @@ protected:
// boundary vertices
int fIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(fIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
for (int faceVertexIdx = 0;
faceVertexIdx < numFaceVerts;
++faceVertexIdx)
{
int elemVertIdx = refElement.subEntity(fIdx,
int vIdx = refElement.subEntity(fIdx,
1,
faceVertIdx,
faceVertexIdx,
dim);
int vIdxGlobal = vertexMapper().map(*eIt, elemVertIdx, dim);
int vIdxGlobal = vertexMapper().map(*eIt, vIdx, dim);
boundaryIndices_[vIdxGlobal] = true;
}
}
......
......@@ -126,17 +126,17 @@ protected:
// face
int fIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(fIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
for (int faceVertexIdx = 0;
faceVertexIdx < numFaceVerts;
++faceVertexIdx)
{
int scvIdx = refElement.subEntity(fIdx,
1,
faceVertIdx,
faceVertexIdx,
dim);
int boundaryFaceIdx =
this->fvGeometry_().boundaryFaceIndex(fIdx, faceVertIdx);
this->fvGeometry_().boundaryFaceIndex(fIdx, faceVertexIdx);
// add the residual of all vertices of the boundary
// segment
......
......@@ -80,10 +80,10 @@ public:
int fIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(fIdx, 1, dim);
for (int faceVertIdx = 0; faceVertIdx < numFaceVerts; ++faceVertIdx)
for (int faceVertexIdx = 0; faceVertexIdx < numFaceVerts; ++faceVertexIdx)
{
int elemVertIdx = refElement.subEntity(fIdx, 1, faceVertIdx, dim);
int vIdxGlobal = problem.vertexMapper().map(*eIt, elemVertIdx, dim);
int vIdx = refElement.subEntity(fIdx, 1, faceVertexIdx, dim);
int vIdxGlobal = problem.vertexMapper().map(*eIt, vIdx, dim);
for (int eqIdx = 0; eqIdx < numEq; eqIdx++)
if (bcTypes.isDirichlet(eqIdx))
......
......@@ -972,15 +972,15 @@ protected:
// boundary vertices
int fIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(fIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
for (int faceVertexIdx = 0;
faceVertexIdx < numFaceVerts;
++faceVertexIdx)
{
int elemVertIdx = refElement.subEntity(fIdx,
int vIdx = refElement.subEntity(fIdx,
1,
faceVertIdx,
faceVertexIdx,
dim);
int vIdxGlobal = vertexMapper().map(*eIt, elemVertIdx, dim);
int vIdxGlobal = vertexMapper().map(*eIt, vIdx, dim);
boundaryIndices_[vIdxGlobal] = true;
}
}
......
......@@ -192,7 +192,7 @@ public:
{
Dune::FieldVector<Scalar, 2*dim> scvVelocities(0.0);
int innerFaceIdx = 0;
int fIdxInner = 0;
IntersectionIterator isEndIt = problem_.gridView().iend(element);
for (IntersectionIterator isIt = problem_.gridView().ibegin(element);
isIt != isEndIt; ++isIt)
......@@ -204,13 +204,13 @@ public:
FluxVariables fluxVars(problem_,
element,
fvGeometry,
innerFaceIdx,
fIdxInner,
elemVolVars);
Scalar flux = fluxVars.volumeFlux(phaseIdx);
scvVelocities[fIdx] = flux;
innerFaceIdx++;
fIdxInner++;
}
else if (isIt->boundary())
{
......
......@@ -274,7 +274,7 @@ public:
for (int i=0; i<faceNumber_; i++)
{
std::vector<unsigned int> nodeIdx(3);
std::vector<unsigned int> vIdxGlobal(3);
Dune::FieldVector<double,3> point(0);
#if PLOT
std::cout << "=====================================" << std::endl;
......@@ -283,15 +283,15 @@ public:
#endif
int edgeIdx = 0;
//first node of the element - from first edge Node 1
nodeIdx[0] = edges_[faces_[i][edgeIdx+1]][1];
vIdxGlobal[0] = edges_[faces_[i][edgeIdx+1]][1];
//second node of the element- from first edge Node 2
nodeIdx[1] = edges_[faces_[i][edgeIdx+1]][2];
vIdxGlobal[1] = edges_[faces_[i][edgeIdx+1]][2];
//third node of the element - from the second edge
nodeIdx[2] = edges_[faces_[i][edgeIdx+2]][1];
vIdxGlobal[2] = edges_[faces_[i][edgeIdx+2]][1];
// if the nodes of the edges are identical swap
if (nodeIdx[1] == nodeIdx[2] || nodeIdx[0] == nodeIdx[2])
if (vIdxGlobal[1] == vIdxGlobal[2] || vIdxGlobal[0] == vIdxGlobal[2])
{
nodeIdx[2] = edges_[faces_[i][edgeIdx+2]][2];
vIdxGlobal[2] = edges_[faces_[i][edgeIdx+2]][2];
}
/* Check if the order of the nodes is trigonometric
......@@ -300,36 +300,36 @@ public:
Dune::FieldVector<double, 2> v(0);
Dune::FieldVector<double, 2> w(0);
double cross1;
v[0] = vertices_[nodeIdx[0]][0] - vertices_[nodeIdx[1]][0];
v[1] = vertices_[nodeIdx[0]][1] - vertices_[nodeIdx[1]][1];
w[0] = vertices_[nodeIdx[0]][0] - vertices_[nodeIdx[2]][0];
w[1] = vertices_[nodeIdx[0]][1] - vertices_[nodeIdx[2]][1];
v[0] = vertices_[vIdxGlobal[0]][0] - vertices_[vIdxGlobal[1]][0];
v[1] = vertices_[vIdxGlobal[0]][1] - vertices_[vIdxGlobal[1]][1];
w[0] = vertices_[vIdxGlobal[0]][0] - vertices_[vIdxGlobal[2]][0];
w[1] = vertices_[vIdxGlobal[0]][1] - vertices_[vIdxGlobal[2]][1];
cross1 = v[0]*w[1]-v[1]*w[0];
//If the cross product is negative switch the order of the vertices
if (cross1 < 0)
{
nodeIdx[0] = edges_[faces_[i][edgeIdx+1]][2]; //node 0 is node 1
nodeIdx[1] = edges_[faces_[i][edgeIdx+1]][1]; //node 1 is node 0
vIdxGlobal[0] = edges_[faces_[i][edgeIdx+1]][2]; //node 0 is node 1
vIdxGlobal[1] = edges_[faces_[i][edgeIdx+1]][1]; //node 1 is node 0
}
v[0] = vertices_[nodeIdx[0]][0] - vertices_[nodeIdx[1]][0];
v[1] = vertices_[nodeIdx[0]][1] - vertices_[nodeIdx[1]][1];
w[0] = vertices_[nodeIdx[0]][0] - vertices_[nodeIdx[2]][0];
w[1] = vertices_[nodeIdx[0]][1] - vertices_[nodeIdx[2]][1];
v[0] = vertices_[vIdxGlobal[0]][0] - vertices_[vIdxGlobal[1]][0];
v[1] = vertices_[vIdxGlobal[0]][1] - vertices_[vIdxGlobal[1]][1];
w[0] = vertices_[vIdxGlobal[0]][0] - vertices_[vIdxGlobal[2]][0];
w[1] = vertices_[vIdxGlobal[0]][1] - vertices_[vIdxGlobal[2]][1];
factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex,2),
nodeIdx);
vIdxGlobal);
#if PLOT
std::cout << "edges of the element "<< faces_[i] << std::endl;
std::cout << "nodes of the element " << nodeIdx[0]
<< ", " << nodeIdx[1] << ", "
<< nodeIdx[2] << std::endl;
std::cout << "1st " << nodeIdx[0]
<< "\t" << "2nd " << nodeIdx[1]
<< "\t" << "3rd " << nodeIdx[2]
std::cout << "nodes of the element " << vIdxGlobal[0]
<< ", " << vIdxGlobal[1] << ", "
<< vIdxGlobal[2] << std::endl;
std::cout << "1st " << vIdxGlobal[0]
<< "\t" << "2nd " << vIdxGlobal[1]
<< "\t" << "3rd " << vIdxGlobal[2]
<< std::endl;
#endif
if (nodeIdx[0] == nodeIdx[1] || nodeIdx[1] == nodeIdx[2]
|| nodeIdx[0] == nodeIdx[2])
if (vIdxGlobal[0] == vIdxGlobal[1] || vIdxGlobal[1] == vIdxGlobal[2]
|| vIdxGlobal[0] == vIdxGlobal[2])
{
std::cout << "Error. The node index is identical in the element"
<< std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment