LCOV - code coverage report
Current view: top level - src/materials - ComputeBeamResultants.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 30 31 96.8 %
Date: 2024-02-27 11:53:14 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       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             : #include "ComputeBeamResultants.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", ComputeBeamResultants);
      13             : 
      14             : InputParameters
      15         676 : ComputeBeamResultants::validParams()
      16             : {
      17         676 :   InputParameters params = Material::validParams();
      18         676 :   params.addClassDescription("Compute forces and moments using elasticity");
      19         676 :   return params;
      20           0 : }
      21             : 
      22         504 : ComputeBeamResultants::ComputeBeamResultants(const InputParameters & parameters)
      23             :   : Material(parameters),
      24         504 :     _disp_strain_increment(
      25        1008 :         getMaterialPropertyByName<RealVectorValue>("mech_disp_strain_increment")),
      26        1008 :     _rot_strain_increment(getMaterialPropertyByName<RealVectorValue>("mech_rot_strain_increment")),
      27        1008 :     _material_stiffness(getMaterialPropertyByName<RealVectorValue>("material_stiffness")),
      28        1008 :     _material_flexure(getMaterialPropertyByName<RealVectorValue>("material_flexure")),
      29        1008 :     _total_rotation(getMaterialPropertyByName<RankTwoTensor>("total_rotation")),
      30         504 :     _force(declareProperty<RealVectorValue>("forces")),
      31         504 :     _moment(declareProperty<RealVectorValue>("moments")),
      32        1008 :     _force_old(getMaterialPropertyOld<RealVectorValue>("forces")),
      33        1512 :     _moment_old(getMaterialPropertyOld<RealVectorValue>("moments"))
      34             : {
      35         504 : }
      36             : 
      37             : void
      38        3880 : ComputeBeamResultants::initQpStatefulProperties()
      39             : {
      40        3880 :   _force[_qp].zero();
      41        3880 :   _moment[_qp].zero();
      42        3880 : }
      43             : 
      44             : void
      45      408288 : ComputeBeamResultants::computeQpProperties()
      46             : {
      47             :   // force = R^T * _material_stiffness * strain_increment + force_old
      48             :   RealVectorValue force_increment;
      49      408288 :   force_increment(0) = _material_stiffness[_qp](0) * _disp_strain_increment[_qp](0);
      50      408288 :   force_increment(1) = _material_stiffness[_qp](1) * _disp_strain_increment[_qp](1);
      51      408288 :   force_increment(2) = _material_stiffness[_qp](2) * _disp_strain_increment[_qp](2);
      52             : 
      53      408288 :   _force[_qp] = _total_rotation[0].transpose() * force_increment + _force_old[_qp];
      54             : 
      55             :   // moment = R^T * _material_flexure * rotation_increment + moment_old
      56             :   RealVectorValue moment_increment;
      57      408288 :   moment_increment(0) = _material_flexure[_qp](0) * _rot_strain_increment[_qp](0);
      58      408288 :   moment_increment(1) = _material_flexure[_qp](1) * _rot_strain_increment[_qp](1);
      59      408288 :   moment_increment(2) = _material_flexure[_qp](2) * _rot_strain_increment[_qp](2);
      60             : 
      61      408288 :   _moment[_qp] = _total_rotation[0].transpose() * moment_increment + _moment_old[_qp];
      62      408288 : }

Generated by: LCOV version 1.14