Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "ScalarKernel.h" 13 : 14 : #include "HomogenizationConstraint.h" 15 : 16 : /// Enforces a cell-average constraint 17 : /// 18 : /// This kernel enforces a cell-average constraint of the type 19 : /// \int_{V}\left(X_{ij}-\hat{X}_{ij}\right)dV, where $X$ 20 : /// is some stress or strain quantity by changing the value 21 : /// of a scalar variable, imposed by CalculateStrainLagrangianKernel 22 : /// as an "extra" additional strain or deformation gradient contribution 23 : /// 24 : /// It only works with the TotalLagrangianStressDivergence kernel 25 : /// but works for both large and small deformations 26 : /// 27 : /// It relies on the HomogenizationConstraint to actually 28 : /// calculate the residual and jacobian, as they are volume integrals over 29 : /// the domain. 30 : /// 31 : /// Also: the scalar-displacement off-diagonal entry, which would be 32 : /// included in this object ideally, instead is implemented in 33 : /// the TotalLagrangianStressDivergence because it varies element by 34 : /// element (and that kernel is already visiting each quadrature point) 35 : /// 36 : class HomogenizationConstraintScalarKernel : public ScalarKernel 37 : { 38 : public: 39 : static InputParameters validParams(); 40 : 41 : HomogenizationConstraintScalarKernel(const InputParameters & parameters); 42 : 43 : virtual void reinit(); 44 : /// Copies the residual from the user object 45 : virtual void computeResidual(); 46 : /// Copies the on-diagonal Jacobian from the user object 47 : virtual void computeJacobian(); 48 : 49 : protected: 50 0 : virtual Real computeQpResidual() { mooseError("not used"); } 51 : /// Copies the on-diagonal Jacobian from the user object 52 0 : virtual Real computeQpJacobian() { mooseError("not used"); } 53 : 54 : /// The user object that does the actual volume integral 55 : const HomogenizationConstraint & _constraint; 56 : 57 : /// The actual tensor residual, from the user object 58 : const RankTwoTensor & _residual; 59 : /// The actual tensor jacobian, from the user object 60 : const RankFourTensor & _jacobian; 61 : /// The constraint map 62 : const Homogenization::ConstraintMap & _cmap; 63 : };