Commit 73af2ada authored by Klaus Mosthaf's avatar Klaus Mosthaf
Browse files

added outflow bc to the boundarytypes and gradCenter in

boxfvelementgeometry (returns the gradient at the center of the SCV


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4048 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 4391830c
......@@ -692,7 +692,7 @@ public:
// calculate the shape function gradients
//typedef Dune::FieldVector< Dune::FieldVector< CoordScalar, dim >, 1 > ShapeJacobian;
typedef Dune::FieldVector< CoordScalar, 1 > ShapeValue;
typedef Dune::FieldVector< CoordScalar, 1 > ShapeValue;
std::vector<ShapeJacobian> localJac;
std::vector<ShapeValue> shapeVal;
localFiniteElement.localBasis().evaluateJacobian(subContVolFace[k].ipLocal, localJac);
......@@ -816,17 +816,13 @@ public:
}
}
// typedef Dune::FieldVector< CoordScalar, 1 > ShapeValue;
std::vector<ShapeJacobian> localJac;
// std::vector<ShapeValue> shapeVal;
localFiniteElement.localBasis().evaluateJacobian(subContVol[vert].localCenter, localJac);
// localFiniteElement.localBasis().evaluateFunction(subContVol[vert].ipLocal, shapeVal);
Dune::FieldMatrix<CoordScalar,dim,dim> jacInvT =
geometry.jacobianInverseTransposed(subContVol[vert].localCenter);
for (int vert = 0; vert < numVertices; vert++)
jacInvT.mv(localJac[vert][0], subContVol[vert].gradCenter[vert]);
// subContVol[vert].shapeValue[vert] = Scalar(shapeVal[vert]);
}
}
}
......
......@@ -51,6 +51,7 @@ public:
boundaryInfo_[i].isDirichlet = 0;
boundaryInfo_[i].isNeumann = 0;
boundaryInfo_[i].isOutflow = 0;
eq2pvIdx_[i] = i;
pv2eqIdx_[i] = i;
......@@ -85,6 +86,7 @@ public:
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 1;
boundaryInfo_[eqIdx].isOutflow = 0;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
......@@ -99,6 +101,7 @@ public:
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 1;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 0;
eq2pvIdx_[eqIdx] = eqIdx;
pv2eqIdx_[eqIdx] = eqIdx;
......@@ -107,6 +110,21 @@ public:
}
}
/*!
* \brief Set all boundary conditions to neuman.
*/
void setAllOutflow()
{
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 1;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
}
/*!
* \brief Set a neumann boundary condition for a single a single
* equation.
......@@ -114,6 +132,9 @@ public:
void setNeumann(int eqIdx)
{
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 1;
boundaryInfo_[eqIdx].isOutflow = 0;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
......@@ -133,6 +154,7 @@ public:
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 1;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 0;
// update the equation <-> primary variable mapping
eq2pvIdx_[eqIdx] = pvIdx;
......@@ -141,6 +163,20 @@ public:
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
/*!
* \brief Set a neumann boundary condition for a single a single
* equation.
*/
void setOutflow(int eqIdx)
{
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 1;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
/*!
* \brief Set a dirichlet boundary condition for a single primary
* variable
......@@ -191,6 +227,25 @@ public:
return false;
};
/*!
* \brief Returns true if an equation is used to specify an
* outflow condition.
*/
bool isOutflow(unsigned eqIdx) const
{ return boundaryInfo_[eqIdx].isOutflow; };
/*!
* \brief Returns true if some equation is used to specify an
* outflow condition.
*/
bool hasOutflow() const
{
for (int i = 0; i < numEq; ++i)
if (boundaryInfo_[i].isOutflow)
return true;
return false;
};
/*!
* \brief Returns the index of the equation which should be used
* for the dirichlet condition of the pvIdx's primary
......@@ -213,6 +268,9 @@ private:
unsigned char visited : 1;
unsigned char isDirichlet : 1;
unsigned char isNeumann : 1;
unsigned char isOutflow : 1;
// unsigned char isCouplingInflow : 1;
// unsigned char isCouplingOutflow : 1;
} boundaryInfo_[numEq];
unsigned char eq2pvIdx_[numEq];
......
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