Skip to content
Snippets Groups Projects
Commit bd1d6bee authored by Sander, Oliver's avatar Sander, Oliver
Browse files

LocalDensity: Take value by GlobalCoordinate

This is needed to support nonconforming discretizations.
parent 7dd53bf8
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ namespace Dune::GFE {
if (localDensity_->dependsOnDerivative())
derivative = localInterpolationRule.evaluateDerivative(quadPos, q) * geometryJacobianInverse;
energy += qp.weight() * integrationElement * (*localDensity_)(quadPos,q,derivative);
energy += qp.weight() * integrationElement * (*localDensity_)(quadPos,q.globalCoordinates(),derivative);
}
}
......@@ -154,7 +154,7 @@ namespace Dune::GFE {
derivative[i+derivative0.rows] = derivative1[i];
energy += weightWithintegrationElement * (*localDensity_)(x,
value,
value.globalCoordinates(),
derivative);
}
}
......
......@@ -112,7 +112,7 @@ namespace Dune::GFE {
/** \brief Evaluate the density
*/
virtual field_type operator() (const Position& x,
const GFE::ProductManifold<RealTuple<field_type,3>,Rotation<field_type,3> >& value,
const typename GFE::ProductManifold<RealTuple<field_type,3>,Rotation<field_type,3> >::CoordinateType& value,
const FieldMatrix<field_type,7,gridDim>& derivative) const override
{
using namespace Dune::Indices;
......@@ -120,9 +120,11 @@ namespace Dune::GFE {
field_type strainEnergyDensity = 0;
/////////////////////////////////////////////////////////
// Extract derivatives of the factor spaces
// Extract value and derivatives of the factor spaces
/////////////////////////////////////////////////////////
Rotation<field_type,3> rotationValue(FieldVector<field_type,4>{value[3], value[4], value[5], value[6]});
FieldMatrix<field_type,3,3> deformationDerivative = {derivative[0], derivative[1], derivative[2]};
FieldMatrix<field_type,4,3> orientationDerivative = {derivative[3], derivative[4], derivative[5], derivative[6]};
......@@ -131,7 +133,7 @@ namespace Dune::GFE {
/////////////////////////////////////////////////////////
FieldMatrix<field_type,gridDim,gridDim> R;
value[_1].matrix(R);
rotationValue.matrix(R);
GFE::CosseratStrain<field_type,gridDim,gridDim> U(deformationDerivative,R);
......@@ -139,7 +141,7 @@ namespace Dune::GFE {
// Transfer the derivative of the rotation into matrix coordinates
////////////////////////////////////////////////////////////////////
Tensor3<field_type,3,3,gridDim> DR = value[_1].quaternionTangentToMatrixTangent(orientationDerivative);
Tensor3<field_type,3,3,gridDim> DR = rotationValue.quaternionTangentToMatrixTangent(orientationDerivative);
strainEnergyDensity = quadraticEnergy(U);
#ifdef CURVATURE_WITH_WRYNESS
......
......@@ -40,7 +40,7 @@ namespace Dune::GFE
* \param derivative The derivative of the deformation at the current position
*/
virtual field_type operator() (const Position& x,
const TargetSpace& value,
const typename TargetSpace::CoordinateType& value,
const Derivative& derivative) const override
{
//////////////////////////////////////////////////////////////
......@@ -56,13 +56,12 @@ namespace Dune::GFE
// derivative[a][b] contains the partial derivative of m_a in the direction x_b
FieldVector<field_type, 3> curl = {derivative[2][1], -derivative[2][0], derivative[1][0]-derivative[0][1]};
FieldVector<field_type, 3> v = value.globalCoordinates();
density += kappa_ * (v * curl);
density += kappa_ * (value * curl);
//////////////////////////////////////////////////////////////
// Zeeman interaction term
//////////////////////////////////////////////////////////////
FieldVector<field_type, 3> v = value;
v[2] -= 1; // subtract e_3
density += 0.5 * h_ * v.two_norm2();
......
......@@ -41,7 +41,7 @@ namespace Dune::GFE
* \param derivative The derivative at the current position
*/
virtual field_type operator() (const Position& x,
const TargetSpace& value,
const typename TargetSpace::CoordinateType& value,
const FieldMatrix<field_type,embeddedBlocksize,dim>& derivative) const override
{
// 'derivative' is the derivative of the entire TargetSpace point x.
......
......@@ -25,7 +25,7 @@ namespace Dune::GFE
* \param derivative The derivative of the deformation at the current position
*/
virtual field_type operator() (const Position& x,
const TargetSpace& value,
const typename TargetSpace::CoordinateType& value,
const FieldMatrix<field_type,embeddedBlocksize,dim>& derivative) const override
{
return 0.5 * derivative.frobenius_norm2();
......
......@@ -27,7 +27,7 @@ namespace Dune::GFE {
* \param derivative The derivative of the integrand at x
*/
virtual field_type operator() (const Position& x,
const TargetSpace& value,
const typename TargetSpace::CoordinateType& value,
const DerivativeType& derivative) const = 0;
/** \brief Whether the density depends on the 'value' parameter
......
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