Commit 0923b0c8 authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

[box*]

Replace "continue" by proper flow paths.
(reviewed by bernd)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9476 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent afd8a50b
......@@ -92,15 +92,14 @@ public:
for (int i = 0; i < numVerts; ++i) {
(*this)[i].reset();
if (!problem.model().onBoundary(element, i))
continue;
const VertexPointer vptr = element.template subEntity<dim>(i);
problem.boundaryTypes((*this)[i], *vptr);
hasDirichlet_ = hasDirichlet_ || (*this)[i].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[i].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[i].hasOutflow();
if (problem.model().onBoundary(element, i)) {
const VertexPointer vptr = element.template subEntity<dim>(i);
problem.boundaryTypes((*this)[i], *vptr);
hasDirichlet_ = hasDirichlet_ || (*this)[i].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[i].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[i].hasOutflow();
}
}
}
......
......@@ -342,13 +342,13 @@ protected:
*/
const bool isDiagonal_(const Tensor & K) const
{
for (int i =0; i<dim; i++)
for (int k =0; k<dim; k++){
if (i==k)
continue;
if(not std::abs(K[i][k]) < 1e-25 )
return false;
for (int i = 0; i < dim; i++) {
for (int k = 0; k < dim; k++) {
if ((i != k) && (std::abs(K[i][k]) >= 1e-25)) {
return false;
}
}
}
return true;
}
};
......
......@@ -492,18 +492,16 @@ protected:
for (int i = 0; i < fvElemGeom_.numVertices; i++)
{
if (jacAsm_().vertexColor(element_(), i) == Green) {
// Green vertices are not to be changed!
continue;
}
for (int eqIdx = 0; eqIdx < numEq; eqIdx++) {
// A[i][scvIdx][eqIdx][pvIdx] is the rate of change of
// the residual of equation 'eqIdx' at vertex 'i'
// depending on the primary variable 'pvIdx' at vertex
// 'scvIdx'.
this->A_[i][scvIdx][eqIdx][pvIdx] = partialDeriv[i][eqIdx];
Valgrind::CheckDefined(this->A_[i][scvIdx][eqIdx][pvIdx]);
// Green vertices are not to be changed!
if (jacAsm_().vertexColor(element_(), i) != Green) {
for (int eqIdx = 0; eqIdx < numEq; eqIdx++) {
// A[i][scvIdx][eqIdx][pvIdx] is the rate of change of
// the residual of equation 'eqIdx' at vertex 'i'
// depending on the primary variable 'pvIdx' at vertex
// 'scvIdx'.
this->A_[i][scvIdx][eqIdx][pvIdx] = partialDeriv[i][eqIdx];
Valgrind::CheckDefined(this->A_[i][scvIdx][eqIdx][pvIdx]);
}
}
}
}
......
......@@ -339,26 +339,26 @@ protected:
PrimaryVariables dirichletValues(0);
for (int scvIdx = 0; scvIdx < fvGeometry_().numVertices; ++scvIdx) {
const BoundaryTypes &bcTypes = bcTypes_(scvIdx);
if (! bcTypes.hasDirichlet())
continue;
// ask the problem for the dirichlet values
const VertexPointer vPtr = element_().template subEntity<dim>(scvIdx);
Valgrind::SetUndefined(dirichletValues);
asImp_().problem_().dirichlet(dirichletValues, *vPtr);
// set the dirichlet conditions
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
if (!bcTypes.isDirichlet(eqIdx))
continue;
int pvIdx = bcTypes.eqToDirichletIndex(eqIdx);
assert(0 <= pvIdx && pvIdx < numEq);
Valgrind::CheckDefined(dirichletValues[pvIdx]);
residual_[scvIdx][eqIdx] =
curPriVar_(scvIdx, pvIdx) - dirichletValues[pvIdx];
storageTerm_[scvIdx][eqIdx] = 0.0;
if (bcTypes.hasDirichlet()) {
// ask the problem for the dirichlet values
const VertexPointer vPtr = element_().template subEntity<dim>(scvIdx);
Valgrind::SetUndefined(dirichletValues);
asImp_().problem_().dirichlet(dirichletValues, *vPtr);
// set the dirichlet conditions
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
if (bcTypes.isDirichlet(eqIdx)) {
int pvIdx = bcTypes.eqToDirichletIndex(eqIdx);
assert(0 <= pvIdx && pvIdx < numEq);
Valgrind::CheckDefined(dirichletValues[pvIdx]);
residual_[scvIdx][eqIdx] =
curPriVar_(scvIdx, pvIdx) - dirichletValues[pvIdx];
storageTerm_[scvIdx][eqIdx] = 0.0;
}
}
}
}
}
......@@ -377,36 +377,35 @@ protected:
for (; isIt != endIt; ++isIt)
{
// handle only faces on the boundary
if (!isIt->boundary())
continue;
// Assemble the boundary for all vertices of the current
// face
int faceIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(faceIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
{
int scvIdx = refElement.subEntity(faceIdx,
1,
faceVertIdx,
dim);
int boundaryFaceIdx =
fvGeometry_().boundaryFaceIndex(faceIdx, faceVertIdx);
// add the residual of all vertices of the boundary
// segment
asImp_().evalNeumannSegment_(isIt,
scvIdx,
boundaryFaceIdx);
// evaluate the outflow conditions at the boundary face
// ATTENTION: This is so far a beta version that is only for the 2p2c and 2p2cni model
// available and not thoroughly tested.
asImp_().evalOutflowSegment_(isIt,
scvIdx,
boundaryFaceIdx);
if (isIt->boundary()) {
// Assemble the boundary for all vertices of the current
// face
int faceIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(faceIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
{
int scvIdx = refElement.subEntity(faceIdx,
1,
faceVertIdx,
dim);
int boundaryFaceIdx =
fvGeometry_().boundaryFaceIndex(faceIdx, faceVertIdx);
// add the residual of all vertices of the boundary
// segment
asImp_().evalNeumannSegment_(isIt,
scvIdx,
boundaryFaceIdx);
// evaluate the outflow conditions at the boundary face
// ATTENTION: This is so far a beta version that is only for the 2p2c and 2p2cni model
// available and not thoroughly tested.
asImp_().evalOutflowSegment_(isIt,
scvIdx,
boundaryFaceIdx);
}
}
}
}
......
......@@ -861,22 +861,22 @@ protected:
IntersectionIterator isIt = gridView_().ibegin(*eIt);
IntersectionIterator isEndIt = gridView_().iend(*eIt);
for (; isIt != isEndIt; ++isIt) {
if (!isIt->boundary())
continue;
// add all vertices on the intersection to the set of
// boundary vertices
int faceIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(faceIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
{
int elemVertIdx = refElement.subEntity(faceIdx,
1,
faceVertIdx,
dim);
int globalVertIdx = vertexMapper().map(*eIt, elemVertIdx, dim);
boundaryIndices_[globalVertIdx] = true;
if (isIt->boundary()) {
// add all vertices on the intersection to the set of
// boundary vertices
int faceIdx = isIt->indexInInside();
int numFaceVerts = refElement.size(faceIdx, 1, dim);
for (int faceVertIdx = 0;
faceVertIdx < numFaceVerts;
++faceVertIdx)
{
int elemVertIdx = refElement.subEntity(faceIdx,
1,
faceVertIdx,
dim);
int globalVertIdx = vertexMapper().map(*eIt, elemVertIdx, dim);
boundaryIndices_[globalVertIdx] = true;
}
}
}
}
......
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