Commit c212e765 authored by Natalie Schroeder's avatar Natalie Schroeder
Browse files

[dim vs dimWorld]

changing dim-matrices to dimWorld-matrices, needed for dim!=dimWorld grids

reviewed by A.Kissinger



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13392 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 7a506b8d
......@@ -93,7 +93,7 @@ class ImplicitForchheimerFluxVariables
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dune::FieldMatrix<Scalar, dim, dim> DimMatrix;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> Tensor;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimWorldMatrix;
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
......@@ -135,7 +135,7 @@ protected:
{
// calculate the mean intrinsic permeability
const SpatialParams &spatialParams = problem.spatialParams();
DimMatrix K;
DimWorldMatrix K;
if (GET_PROP_VALUE(TypeTag, ImplicitIsBox))
{
spatialParams.meanK(K,
......@@ -169,7 +169,7 @@ protected:
// Make sure the permeability matrix does not have off-diagonal entries
assert( isDiagonal_(K) );
DimMatrix sqrtK(0.0);
DimWorldMatrix sqrtK(0.0);
for (int i = 0; i < dim; ++i)
sqrtK[i][i] = std::sqrt(K[i][i]);
......@@ -183,7 +183,7 @@ protected:
GlobalPosition deltaV; // the change in velocity between Newton iterations
GlobalPosition residual(10e10); // the residual (function value that is to be minimized)
GlobalPosition tmp; // temporary variable for numerical differentiation
Tensor gradF; // slope of equation that is to be solved
DimWorldMatrix gradF; // slope of equation that is to be solved
// search by means of the Newton method for a root of Forchheimer equation
for (int k = 0; residual.two_norm() > 1e-12 ; ++k) {
......@@ -261,8 +261,8 @@ protected:
*/
void forchheimerResidual_(GlobalPosition & residual,
const Scalar forchCoeff,
const DimMatrix & sqrtK,
const DimMatrix & K,
const DimWorldMatrix & sqrtK,
const DimWorldMatrix & K,
const GlobalPosition & velocity,
const ElementVolumeVariables & elemVolVars,
const GlobalPosition & potentialGrad,
......@@ -329,9 +329,9 @@ protected:
* \param elemVolVars The volume variables of the current element
* \param phaseIdx The index of the currently considered phase
*/
void forchheimerDerivative_(Tensor & derivative,
void forchheimerDerivative_(DimWorldMatrix & derivative,
const Scalar forchCoeff,
const DimMatrix & sqrtK,
const DimWorldMatrix & sqrtK,
const GlobalPosition & velocity,
const ElementVolumeVariables & elemVolVars,
const unsigned int phaseIdx) const
......@@ -380,7 +380,7 @@ protected:
* \return True if all off-diagonals are zero.
*
*/
const bool isDiagonal_(const DimMatrix & K) const
const bool isDiagonal_(const DimWorldMatrix & K) const
{
for (int i = 0; i < dim; i++) {
for (int k = 0; k < dim; k++) {
......
......@@ -65,7 +65,7 @@ class FVSpatialParamsOneP
typedef typename GridView::template Codim<0>::Entity Element;
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
typedef Dune::FieldMatrix<Scalar, dim, dim> DimMatrix;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimWorldMatrix;
public:
FVSpatialParamsOneP(const GridView &gridView)
......@@ -93,7 +93,7 @@ public:
* \param K1 intrinsic permeability of the first element
* \param K2 intrinsic permeability of the second element
*/
void meanK(DimMatrix &result, Scalar K1, Scalar K2) const
void meanK(DimWorldMatrix &result, Scalar K1, Scalar K2) const
{
const Scalar K = Dumux::harmonicMean(K1, K2);
for (int i = 0; i < dimWorld; ++i)
......@@ -110,7 +110,7 @@ public:
* \param K1 intrinsic permeability of the first element
* \param K2 intrinsic permeability of the second element
*/
void meanK(DimMatrix &result, const DimMatrix &K1, const DimMatrix &K2) const
void meanK(DimWorldMatrix &result, const DimWorldMatrix &K1, const DimWorldMatrix &K2) const
{
// entry-wise harmonic mean at the main diagonal and arithmetic mean at the off-diagonal
for (int i = 0; i < dimWorld; ++i)
......@@ -131,7 +131,7 @@ public:
* \param result intrinsic permeability
* \param K intrinsic permeability of the element
*/
void meanK(DimMatrix &result, Scalar K) const
void meanK(DimWorldMatrix &result, Scalar K) const
{
for (int i = 0; i < dimWorld; ++i)
{
......@@ -146,7 +146,7 @@ public:
* \param result intrinsic permeability
* \param K intrinsic permeability of the element
*/
void meanK(DimMatrix &result, const DimMatrix &K) const
void meanK(DimWorldMatrix &result, const DimWorldMatrix &K) const
{
result = K;
}
......@@ -157,7 +157,7 @@ public:
* \return intrinsic (absolute) permeability
* \param element The element
*/
const DimMatrix& intrinsicPermeability (const Element& element) const
const DimWorldMatrix& intrinsicPermeability (const Element& element) const
{
return asImp_().intrinsicPermeabilityAtPos(element.geometry().center());
}
......@@ -168,7 +168,7 @@ public:
* \return intrinsic (absolute) permeability
* \param globalPos The position of the center of the element
*/
const DimMatrix& intrinsicPermeabilityAtPos (const GlobalPosition& globalPos) const
const DimWorldMatrix& intrinsicPermeabilityAtPos (const GlobalPosition& globalPos) const
{
DUNE_THROW(Dune::InvalidStateException,
"The spatial parameters do not provide "
......
......@@ -63,7 +63,7 @@ class ImplicitSpatialParamsOneP
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldMatrix<Scalar, dim, dim> DimMatrix;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimWorldMatrix;
typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition;
public:
......@@ -79,13 +79,13 @@ public:
* \param K1 intrinsic permeability of the first node
* \param K2 intrinsic permeability of the second node
*/
void meanK(DimMatrix &result,
void meanK(DimWorldMatrix &result,
Scalar K1,
Scalar K2) const
{
const Scalar K = Dumux::harmonicMean(K1, K2);
for (int i = 0; i < dim; ++i) {
for (int j = 0; j < dim; ++j)
for (int i = 0; i < dimWorld; ++i) {
for (int j = 0; j < dimWorld; ++j)
result[i][j] = 0;
result[i][i] = K;
}
......@@ -97,14 +97,14 @@ public:
* \param K1 intrinsic permeability of the first node
* \param K2 intrinsic permeability of the second node
*/
void meanK(DimMatrix &result,
const DimMatrix &K1,
const DimMatrix &K2) const
void meanK(DimWorldMatrix &result,
const DimWorldMatrix &K1,
const DimWorldMatrix &K2) const
{
// entry-wise harmonic mean. this is almost certainly wrong if
// you have off-main diagonal entries in your permeabilities!
for (int i = 0; i < dim; ++i)
for (int j = 0; j < dim; ++j)
for (int i = 0; i < dimWorld; ++i)
for (int j = 0; j < dimWorld; ++j)
result[i][j] = harmonicMean(K1[i][j], K2[i][j]);
}
......@@ -116,7 +116,7 @@ public:
* \param scvIdx The index of the sub-control volume.
* \return the intrinsic permeability
*/
const DimMatrix& intrinsicPermeability (const Element &element,
const DimWorldMatrix& intrinsicPermeability (const Element &element,
const FVElementGeometry &fvGeometry,
int scvIdx) const
{
......@@ -129,7 +129,7 @@ public:
* \return intrinsic (absolute) permeability
* \param globalPos The position of the center of the element
*/
const DimMatrix& intrinsicPermeabilityAtPos (const GlobalPosition& globalPos) const
const DimWorldMatrix& intrinsicPermeabilityAtPos (const GlobalPosition& globalPos) const
{
DUNE_THROW(Dune::InvalidStateException,
"The spatial parameters do not provide "
......
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