diff --git a/dumux/boxmodels/common/boxassembler.hh b/dumux/boxmodels/common/boxassembler.hh index 4f73f263b296cf967eac3586765e6d0d3473618c..01984abd420567387c90235d934cf971a4b95e8c 100644 --- a/dumux/boxmodels/common/boxassembler.hh +++ b/dumux/boxmodels/common/boxassembler.hh @@ -49,30 +49,16 @@ class BoxAssembler typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexMapper)) VertexMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementMapper)) ElementMapper; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(JacobianMatrix)) JacobianMatrix; typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(BoundaryTypes)) BoundaryTypes; - enum{dim = GridView::dimension}; + enum{ dim = GridView::dimension }; typedef typename GridView::template Codim<0>::Entity Element; typedef typename GridView::template Codim<0>::Iterator ElementIterator; - typedef typename GridView::IntersectionIterator IntersectionIterator; - - typedef typename GridView::template Codim<dim>::Entity Vertex; typedef typename GridView::template Codim<dim>::EntityPointer VertexPointer; - typedef typename GridView::template Codim<dim>::Iterator VertexIterator; - - typedef SolutionVector Vector; - typedef JacobianMatrix Matrix; - typedef Matrix RepresentationType; - - enum { - numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)) - }; + enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)) }; typedef Dune::FieldMatrix<Scalar, numEq, numEq> MatrixBlock; typedef Dune::FieldVector<Scalar, numEq> VectorBlock; @@ -545,7 +531,7 @@ public: /*! * \brief Return constant reference to global Jacobian matrix. */ - const Matrix& matrix() const + const JacobianMatrix& matrix() const { return *matrix_; } /*! @@ -566,7 +552,7 @@ private: int nVerts = gridView_().size(dim); // allocate raw matrix - matrix_ = new Matrix(nVerts, nVerts, Matrix::random); + matrix_ = new JacobianMatrix(nVerts, nVerts, JacobianMatrix::random); // find out the global indices of the neighboring vertices of // each vertex @@ -790,7 +776,7 @@ private: // set main diagonal entries for the vertex int vIdx = vertexMapper_().map(*vp); - typedef typename Matrix::block_type BlockType; + typedef typename JacobianMatrix::block_type BlockType; BlockType &J = (*matrix_)[vIdx][vIdx]; for (int j = 0; j < BlockType::rows; ++j) J[j][j] = 1.0; @@ -819,7 +805,7 @@ private: Problem *problemPtr_; // the jacobian matrix - Matrix *matrix_; + JacobianMatrix *matrix_; // the right-hand side SolutionVector residual_; diff --git a/dumux/boxmodels/common/boxelementboundarytypes.hh b/dumux/boxmodels/common/boxelementboundarytypes.hh index dc38f6cfb9de9b861d21c7c8b2dd1678914d8154..9201346f819aa3019ddf32f41f8acd1c47e6286a 100644 --- a/dumux/boxmodels/common/boxelementboundarytypes.hh +++ b/dumux/boxmodels/common/boxelementboundarytypes.hh @@ -49,18 +49,15 @@ class BoxElementBoundaryTypes : public std::vector<typename GET_PROP_TYPE(TypeTa typedef std::vector<BoundaryTypes> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; enum { dim = GridView::dimension }; - typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<dim>::Entity Vertex; typedef typename GridView::template Codim<dim>::EntityPointer VertexPointer; typedef typename GridView::IntersectionIterator IntersectionIterator; - typedef typename GridView::ctype CoordScalar; + typedef typename Dune::GenericReferenceElements<CoordScalar, dim> ReferenceElements; typedef typename Dune::GenericReferenceElement<CoordScalar, dim> ReferenceElement; diff --git a/dumux/boxmodels/common/boxelementvolumevariables.hh b/dumux/boxmodels/common/boxelementvolumevariables.hh index d3bfb36a06425d5e4ed99bd77b1acdab3055ebd1..4e94ab304c41c0d9c699bd750eee51f789fea47a 100644 --- a/dumux/boxmodels/common/boxelementvolumevariables.hh +++ b/dumux/boxmodels/common/boxelementvolumevariables.hh @@ -42,10 +42,6 @@ namespace Dumux template<class TypeTag> class BoxElementVolumeVariables : public std::vector<typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) > { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; - typedef std::vector<VolumeVariables> ParentType; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; @@ -54,7 +50,6 @@ class BoxElementVolumeVariables : public std::vector<typename GET_PROP_TYPE(Type typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::IntersectionIterator IntersectionIterator; enum { dim = GridView::dimension }; enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)) }; diff --git a/dumux/boxmodels/common/boxfvelementgeometry.hh b/dumux/boxmodels/common/boxfvelementgeometry.hh index 034b546120ddc3e33f8a46f127f8ff9c129a163b..168f5aa6b89a2fa6c5ed81d9c6161011f3601e36 100644 --- a/dumux/boxmodels/common/boxfvelementgeometry.hh +++ b/dumux/boxmodels/common/boxfvelementgeometry.hh @@ -39,7 +39,6 @@ namespace Dumux { namespace Properties { -NEW_PROP_TAG(Grid); NEW_PROP_TAG(GridView); NEW_PROP_TAG(Scalar); } @@ -302,25 +301,23 @@ public: template<class TypeTag> class BoxFVElementGeometry { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Grid)) Grid; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + enum{dim = GridView::dimension}; typedef BoxFVElementGeometry<TypeTag> ThisType; /** \todo Please doc me! */ - friend class _BoxFVElemGeomHelper<ThisType, Grid::dimension>; + friend class _BoxFVElemGeomHelper<ThisType, dim>; - typedef _BoxFVElemGeomHelper<ThisType, Grid::dimension> BoxFVElemGeomHelper; + typedef _BoxFVElemGeomHelper<ThisType, dim> BoxFVElemGeomHelper; - enum{dim = Grid::dimension}; enum{maxNC = (dim < 3 ? 4 : 8)}; enum{maxNE = (dim < 3 ? 4 : 12)}; enum{maxNF = (dim < 3 ? 1 : 6)}; enum{maxCOS = (dim < 3 ? 2 : 4)}; enum{maxBF = (dim < 3 ? 8 : 24)}; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename Grid::ctype CoordScalar; - //typedef Scalar CoordScalar; + typedef typename GridView::ctype CoordScalar; typedef typename GridView::Traits::template Codim<0>::Entity Element; typedef typename Element::Geometry Geometry; typedef Dune::FieldVector<CoordScalar,dim> FV; @@ -345,14 +342,6 @@ class BoxFVElementGeometry Scalar pyramidVolume (const FV& p0, const FV& p1, const FV& p2, const FV& p3, const FV& p4) { - /* - FV a = p2 - p0; - FV b = p3 - p1; - FV h = p4 - p0; - FV n = crossProduct(a, b); - return 1.0/6.0*(n*h); - */ - FV a(p2); a -= p0; FV b(p3); b -= p1; @@ -366,18 +355,6 @@ class BoxFVElementGeometry Scalar prismVolume (const FV& p0, const FV& p1, const FV& p2, const FV& p3, const FV& p4, const FV& p5) { - /* - FV a = p4 - p0; - FV b = p1 - p3; - FV c = p1 - p0; - FV d = p2 - p0; - FV e = p5 - p0; - FV m = crossProduct(a, b); - FV n = m + crossProduct(c, d); - - return fabs(1.0/6.0*(n*e)); - */ - FV a(p4); a -= p0; FV b(p1); b -= p3; FV m; diff --git a/dumux/boxmodels/common/boxlocaljacobian.hh b/dumux/boxmodels/common/boxlocaljacobian.hh index 4ff8b60bc80e8ef0515dee5e2e31e2583f3086b6..a9c74008f43888b69b7d74dabccd1ed208ac46da 100644 --- a/dumux/boxmodels/common/boxlocaljacobian.hh +++ b/dumux/boxmodels/common/boxlocaljacobian.hh @@ -69,43 +69,24 @@ template<class TypeTag> class BoxLocalJacobian { private: - typedef BoxLocalJacobian<TypeTag> ThisType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalJacobian)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalResidual)) LocalResidual; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Model)) Model; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + typedef typename GridView::template Codim<0>::Entity Element; typedef typename GET_PROP_TYPE(TypeTag, PTAG(JacobianAssembler)) JacobianAssembler; enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)), - dim = GridView::dimension, - dimWorld = GridView::dimensionworld, Red = JacobianAssembler::Red, Yellow = JacobianAssembler::Yellow, Green = JacobianAssembler::Green }; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GridView::Grid::ctype CoordScalar; - - typedef Dune::FieldVector<Scalar, dim> LocalPosition; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; - - typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<0>::Iterator ElementIterator; - typedef typename Element::EntityPointer ElementPointer; - - typedef typename Dune::GenericReferenceElements<CoordScalar, dim> ReferenceElements; - typedef typename Dune::GenericReferenceElement<CoordScalar, dim> ReferenceElement; - - typedef typename GridView::IntersectionIterator IntersectionIterator; - typedef typename Element::Geometry Geometry; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexMapper)) VertexMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSolutionVector)) ElementSolutionVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; @@ -114,6 +95,7 @@ private: typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementBoundaryTypes)) ElementBoundaryTypes; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef Dune::FieldMatrix<Scalar, numEq, numEq> MatrixBlock; typedef Dune::Matrix<MatrixBlock> LocalBlockMatrix; diff --git a/dumux/boxmodels/common/boxlocalresidual.hh b/dumux/boxmodels/common/boxlocalresidual.hh index c5d5a4fbc07c5a5dae6c953ddfc3463c080dcd73..e3c447116f46c46cd22ab154807a2f29d569f967 100644 --- a/dumux/boxmodels/common/boxlocalresidual.hh +++ b/dumux/boxmodels/common/boxlocalresidual.hh @@ -48,37 +48,26 @@ template<class TypeTag> class BoxLocalResidual { private: - typedef BoxLocalResidual<TypeTag> ThisType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalResidual)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Model)) Model; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)), - - dim = GridView::dimension, - dimWorld = GridView::dimensionworld + dim = GridView::dimension }; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GridView::Grid::ctype CoordScalar; - - typedef Dune::FieldVector<Scalar, dim> LocalPosition; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; - typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<0>::Iterator ElementIterator; - typedef typename GridView::template Codim<dim>::Entity Vertex; typedef typename GridView::template Codim<dim>::EntityPointer VertexPointer; + typedef typename GridView::IntersectionIterator IntersectionIterator; + typedef typename GridView::Grid::ctype CoordScalar; typedef typename Dune::GenericReferenceElements<CoordScalar, dim> ReferenceElements; typedef typename Dune::GenericReferenceElement<CoordScalar, dim> ReferenceElement; - typedef typename GridView::IntersectionIterator IntersectionIterator; - typedef typename Element::Geometry Geometry; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexMapper)) VertexMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSolutionVector)) ElementSolutionVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; @@ -87,9 +76,6 @@ private: typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; - typedef Dune::FieldMatrix<Scalar, numEq, numEq> MatrixBlock; - typedef Dune::Matrix<MatrixBlock> LocalBlockMatrix; - // copying the local residual class is not a good idea BoxLocalResidual(const BoxLocalResidual &); diff --git a/dumux/boxmodels/common/boxmodel.hh b/dumux/boxmodels/common/boxmodel.hh index 5d4abd231edeaa7dc22ed96da238833a7bad9d65..69ebccbb5aae1b3b5f5e06485366b0fda37e4855 100644 --- a/dumux/boxmodels/common/boxmodel.hh +++ b/dumux/boxmodels/common/boxmodel.hh @@ -50,47 +50,35 @@ namespace Dumux template<class TypeTag> class BoxModel { - typedef BoxModel<TypeTag> ThisType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Model)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GridView::Grid::ctype CoordScalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementMapper)) ElementMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexMapper)) VertexMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(DofMapper)) DofMapper; typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(JacobianAssembler)) JacobianAssembler; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; - enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)), dim = GridView::dimension }; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalJacobian)) LocalJacobian; typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalResidual)) LocalResidual; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(NewtonMethod)) NewtonMethod; typedef typename GET_PROP_TYPE(TypeTag, PTAG(NewtonController)) NewtonController; typedef typename GridView::template Codim<0>::Entity Element; typedef typename GridView::template Codim<0>::Iterator ElementIterator; - typedef typename GridView::IntersectionIterator IntersectionIterator; typedef typename GridView::template Codim<dim>::Entity Vertex; typedef typename GridView::template Codim<dim>::Iterator VertexIterator; - typedef typename Dune::GenericReferenceElements<CoordScalar, dim> ReferenceElements; - typedef typename Dune::GenericReferenceElement<CoordScalar, dim> ReferenceElement; - // copying a model is not a good idea BoxModel(const BoxModel &); diff --git a/dumux/boxmodels/common/boxproblem.hh b/dumux/boxmodels/common/boxproblem.hh index 876a147882a6ef732eccc707a97234d79b4e7a7d..a9c47a6940ab1d9b233dcfa42fd4a353507d4776 100644 --- a/dumux/boxmodels/common/boxproblem.hh +++ b/dumux/boxmodels/common/boxproblem.hh @@ -73,7 +73,6 @@ private: }; typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<dim>::Entity Vertex; typedef typename GridView::template Codim<dim>::Iterator VertexIterator; typedef typename GridView::Intersection Intersection;