Ejemplo n.º 1
0
void
dataStore(std::ostream & stream, ColumnMajorMatrix & v, void * /*context*/)
{
  for (unsigned int i = 0; i < v.m(); i++)
    for (unsigned int j = 0; j < v.n(); j++)
    {
      Real r = v(i, j);
      stream.write((char *) &r, sizeof(r));
    }
}
Ejemplo n.º 2
0
void
dataLoad(std::istream & stream, ColumnMajorMatrix & v, void * /*context*/)
{
  for (unsigned int i = 0; i < v.m(); i++)
    for (unsigned int j = 0; j < v.n(); j++)
    {
      Real r = 0;
      stream.read((char *) &r, sizeof(r));
      v(i, j) = r;
    }
}
Ejemplo n.º 3
0
void
Nonlinear3D::computeDeformationGradient( unsigned int qp, ColumnMajorMatrix & F)
{
    mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");

    F(0,0) = _grad_disp_x[qp](0) + 1;
    F(0,1) = _grad_disp_x[qp](1);
    F(0,2) = _grad_disp_x[qp](2);
    F(1,0) = _grad_disp_y[qp](0);
    F(1,1) = _grad_disp_y[qp](1) + 1;
    F(1,2) = _grad_disp_y[qp](2);
    F(2,0) = _grad_disp_z[qp](0);
    F(2,1) = _grad_disp_z[qp](1);
    F(2,2) = _grad_disp_z[qp](2) + 1;
}
Ejemplo n.º 4
0
void
NonlinearRZ::computeDeformationGradient( unsigned int qp, ColumnMajorMatrix & F)
{
  mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");

  F(0,0) = _grad_disp_r[qp](0) + 1;
  F(0,1) = _grad_disp_r[qp](1);
  F(0,2) = 0;
  F(1,0) = _grad_disp_z[qp](0);
  F(1,1) = _grad_disp_z[qp](1) + 1;
  F(1,2) = 0;
  F(2,0) = 0;
  F(2,1) = 0;
  F(2,2) = (_solid_model.q_point(qp)(0) != 0.0 ? _disp_r[qp]/_solid_model.q_point(qp)(0) : 0.0) + 1;
}
Ejemplo n.º 5
0
void
PlaneStrain::computeDeformationGradient( unsigned int qp, ColumnMajorMatrix & F)
{
  mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");

  F(0,0) = _grad_disp_x[qp](0) + 1.0;
  F(0,1) = _grad_disp_x[qp](1);
  F(0,2) = 0.0;
  F(1,0) = _grad_disp_y[qp](0);
  F(1,1) = _grad_disp_y[qp](1) + 1.0;
  F(1,2) = 0.0;
  F(2,0) = 0.0;
  F(2,1) = 0.0;
  F(2,2) = 1.0;
}
Ejemplo n.º 6
0
Real
Element::detMatrix( const ColumnMajorMatrix & A )
{
  mooseAssert(A.n() == 3 && A.m() == 3, "detMatrix requires 3x3 matrix");

  Real Axx = A(0,0);
  Real Axy = A(0,1);
  Real Axz = A(0,2);
  Real Ayx = A(1,0);
  Real Ayy = A(1,1);
  Real Ayz = A(1,2);
  Real Azx = A(2,0);
  Real Azy = A(2,1);
  Real Azz = A(2,2);

  return   Axx*Ayy*Azz + Axy*Ayz*Azx + Axz*Ayx*Azy
         - Azx*Ayy*Axz - Azy*Ayz*Axx - Azz*Ayx*Axy;
}
Ejemplo n.º 7
0
void
NonlinearRZ::fillMatrix( unsigned int qp,
                         const VariableGradient & grad_r,
                         const VariableGradient & grad_z,
                         const VariableValue & u,
                         ColumnMajorMatrix & A) const
{
  mooseAssert(A.n() == 3 && A.m() == 3, "computeDefGrad requires 3x3 matrix");

  A(0,0) = grad_r[qp](0);
  A(0,1) = grad_r[qp](1);
  A(0,2) = 0;
  A(1,0) = grad_z[qp](0);
  A(1,1) = grad_z[qp](1);
  A(1,2) = 0;
  A(2,0) = 0;
  A(2,1) = 0;
  A(2,2) = (_solid_model.q_point(qp)(0) != 0.0 ? u[qp]/_solid_model.q_point(qp)(0) : 0.0);
}
Ejemplo n.º 8
0
void
NonlinearPlaneStrain::fillMatrix( unsigned int qp,
                                  const VariableGradient & grad_x,
                                  const VariableGradient & grad_y,
                                  const Real & strain_zz,
                                  ColumnMajorMatrix & A) const
{
  mooseAssert(A.n() == 3 && A.m() == 3, "computeDefGrad requires 3x3 matrix");

  A(0,0) = grad_x[qp](0);
  A(0,1) = grad_x[qp](1);
  A(0,2) = 0;
  A(1,0) = grad_y[qp](0);
  A(1,1) = grad_y[qp](1);
  A(1,2) = 0;
  A(2,0) = 0;
  A(2,1) = 0;
  A(2,2) = strain_zz;
}
Ejemplo n.º 9
0
void
NonlinearPlaneStrain::computeDeformationGradient( unsigned int qp, ColumnMajorMatrix & F)
{
  mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");

  F(0,0) = _grad_disp_x[qp](0) + 1;
  F(0,1) = _grad_disp_x[qp](1);
  F(0,2) = 0;
  F(1,0) = _grad_disp_y[qp](0);
  F(1,1) = _grad_disp_y[qp](1) + 1;
  F(1,2) = 0;
  F(2,0) = 0;
  F(2,1) = 0;
  if (_have_strain_zz)
    F(2,2) = _strain_zz[qp] + 1;
  else if (_have_scalar_strain_zz && _scalar_strain_zz.size()>0)
    F(2,2) = _scalar_strain_zz[qp] + 1;
  else
    F(2,2) = 1;
}