Skip to content
Snippets Groups Projects
Commit fb2ded7d authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[evalGradients] fix errors

parent 0b4cb642
No related branches found
No related tags found
1 merge request!617[WIP] Next
...@@ -56,11 +56,14 @@ evalGradients(const Element& element, ...@@ -56,11 +56,14 @@ evalGradients(const Element& element,
const typename Element::Geometry::GlobalCoordinate& globalPos) const typename Element::Geometry::GlobalCoordinate& globalPos)
{ {
using PrimaryVariables = typename BoxElementSolution<TypeTag>::PrimaryVariables; using PrimaryVariables = typename BoxElementSolution<TypeTag>::PrimaryVariables;
using PriVarGradients = Dune::FieldVector<typename Element::Geometry::GlobalCoordinate, PrimaryVariables::dimension>; using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
// evalutae gradients using the local finite element basis // evaluate gradients using the local finite element basis
const auto& localBasis = fvGridGeometry.feCache().get(geometry.type()).localBasis(); const auto& localBasis = fvGridGeometry.feCache().get(geometry.type()).localBasis();
// the inverse transposed of the jacobian matrix
const auto jacInvT = g.jacobianInverseTransposed(local);
// evaluate the shape function gradients at the scv center // evaluate the shape function gradients at the scv center
using ShapeJacobian = typename decltype(localBasis)::Traits::JacobianType; using ShapeJacobian = typename decltype(localBasis)::Traits::JacobianType;
const auto localPos = geometry.local(globalPos); const auto localPos = geometry.local(globalPos);
...@@ -68,15 +71,15 @@ evalGradients(const Element& element, ...@@ -68,15 +71,15 @@ evalGradients(const Element& element,
localBasis.evaluateJacobian(localPos, shapeJacobian); localBasis.evaluateJacobian(localPos, shapeJacobian);
// interpolate the gradients // interpolate the gradients
PriVarGradients result( PrimaryVariables(0.0) ); Dune::FieldVector<GlobalPosition, PrimaryVariables::dimension> result( PrimaryVariables(0.0) );
for (int i = 0; i < element.subEntities(dim); ++i) for (int i = 0; i < element.subEntities(Element::Geometry::mydimension); ++i)
{ {
// the global shape function gradient // the global shape function gradient
GlobalPosition gradN; GlobalPosition gradN;
jacInvT.mv(shapeJacobian[i][0], gradN); jacInvT.mv(shapeJacobian[i][0], gradN);
// add gradient to global privar gradients // add gradient to global privar gradients
for (unsigned int pvIdx = 0; pvIdx < numEq; ++pvIdx) for (unsigned int pvIdx = 0; pvIdx < PrimaryVariables::dimension; ++pvIdx)
{ {
GlobalPosition tmp(gradN); GlobalPosition tmp(gradN);
tmp *= elemSol[i][pvIdx]; tmp *= elemSol[i][pvIdx];
...@@ -103,11 +106,11 @@ evalGradients(const Element& element, ...@@ -103,11 +106,11 @@ evalGradients(const Element& element,
*/ */
template< class Element, class FVGridGeometry, class TypeTag > template< class Element, class FVGridGeometry, class TypeTag >
typename CCElementSolution<TypeTag>::PrimaryVariables typename CCElementSolution<TypeTag>::PrimaryVariables
evalSolution(const Element& element, evalGradients(const Element& element,
const typename Element::Geometry& geometry, const typename Element::Geometry& geometry,
const FVGridGeometry& fvGridGeometry, const FVGridGeometry& fvGridGeometry,
const CCElementSolution<TypeTag>& elemSol, const CCElementSolution<TypeTag>& elemSol,
const typename Element::Geometry::GlobalCoordinate& globalPos) const typename Element::Geometry::GlobalCoordinate& globalPos)
{ DUNE_THROW(Dune::NotImplemented, "General gradient evaluation for cell-centered methods"); } { DUNE_THROW(Dune::NotImplemented, "General gradient evaluation for cell-centered methods"); }
} // namespace Dumux } // namespace Dumux
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment