Example #1
0
void ElasticityResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
  typedef Intrepid::FunctionSpaceTools FST;

    for (std::size_t cell=0; cell < workset.numCells; ++cell) {
      for (std::size_t node=0; node < numNodes; ++node) {
              for (std::size_t dim=0; dim<numDims; dim++)  ExResidual(cell,node,dim)=0.0;
          for (std::size_t qp=0; qp < numQPs; ++qp) {
            for (std::size_t i=0; i<numDims; i++) {
              for (std::size_t dim=0; dim<numDims; dim++) {
                ExResidual(cell,node,i) += Stress(cell, qp, i, dim) * wGradBF(cell, node, qp, dim);
    } } } } }


  if (workset.transientTerms && enableTransient)
    for (std::size_t cell=0; cell < workset.numCells; ++cell) {
      for (std::size_t node=0; node < numNodes; ++node) {
          for (std::size_t qp=0; qp < numQPs; ++qp) {
            for (std::size_t i=0; i<numDims; i++) {
                ExResidual(cell,node,i) += uDotDot(cell, qp, i) * wBF(cell, node, qp);
    } } } }


//  FST::integrate<ScalarT>(ExResidual, Stress, wGradBF, Intrepid::COMP_CPP, false); // "false" overwrites

}
void MicroResidual<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
  typedef Intrepid2::FunctionSpaceTools FST;

    for (std::size_t cell=0; cell < workset.numCells; ++cell) {
      for (std::size_t node=0; node < numNodes; ++node) {
          for (std::size_t idim=0; idim<numDims; idim++)  
            for (std::size_t jdim=0; jdim<numDims; jdim++)  
              ExResidual(cell,node,idim,jdim)=0.0;
          for (std::size_t qp=0; qp < numQPs; ++qp) {
            for (std::size_t i=0; i<numDims; i++) {
              for (std::size_t j=0; j<numDims; j++) {
                for (std::size_t dim=0; dim<numDims; dim++) {
                  ExResidual(cell,node,i,j) += doubleStress(cell, qp, i, j, dim) * wGradBF(cell, node, qp, dim)
                                             + microStress(cell, qp, i, j) * wBF(cell, node, qp);
    } } } } } }


  if (workset.transientTerms && enableTransient)
    for (std::size_t cell=0; cell < workset.numCells; ++cell) {
      for (std::size_t node=0; node < numNodes; ++node) {
          for (std::size_t qp=0; qp < numQPs; ++qp) {
            for (std::size_t i=0; i<numDims; i++) {
              for (std::size_t j=0; j<numDims; j++) {
                ExResidual(cell,node,i,j) += epsDotDot(cell, qp, i, j) * wBF(cell, node, qp);
    } } } } }

}
void VectorResidual<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
  for (std::size_t cell=0; cell < workset.numCells; ++cell) {
    for (std::size_t node=0; node < numNodes; ++node) {
        ExResidual(cell,node)=0.0;
        for (std::size_t qp=0; qp < numQPs; ++qp)
          for (std::size_t dim=0; dim<numDims; dim++)
            ExResidual(cell,node) += vector(cell, qp, dim) * wGradBF(cell, node, qp, dim);
    } 
  }
}
void ElasticityDispErrResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
  for (int cell=0; cell < workset.numCells; ++cell) {
    for (int node=0; node < numNodes; ++node) {
      for (int dim=0; dim<numDims; dim++)  ExResidual(cell,node,dim)=0.0;
      for (int qp=0; qp < numQPs; ++qp) {
        for (int i=0; i<numDims; i++) {
          ExResidual(cell,node,i) += DispResid(cell,node,i);
          for (int dim=0; dim<numDims; dim++) {
            ExResidual(cell,node,i) += ErrorStress(cell, qp, i, dim) * wGradBF(cell, node, qp, dim);
    } } } } }
}
void ThermoPoroPlasticityResidMomentum<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
  typedef Intrepid::FunctionSpaceTools FST;
  typedef Intrepid::RealSpaceTools<ScalarT> RST;

    RST::inverse(F_inv, defgrad);
    RST::transpose(F_invT, F_inv);
    FST::scalarMultiplyDataData<ScalarT>(JF_invT, J, F_invT);
    FST::scalarMultiplyDataData<ScalarT>(thermoEPS, alphaSkeleton , JF_invT);

    for (int cell=0; cell < workset.numCells; ++cell) {
      for (int node=0; node < numNodes; ++node) {
              for (int dim=0; dim<numDims; dim++)  {
            	  ExResidual(cell,node,dim)=0.0;
              }
          for (int qp=0; qp < numQPs; ++qp) {

        	dTemp = Temp(cell,qp) - TempRef(cell,qp);

            for (int i=0; i<numDims; i++) {
              for (int dim=0; dim<numDims; dim++) {
                ExResidual(cell,node,i) += (TotalStress(cell, qp, i, dim)
                		                   - Bulk(cell,qp)*thermoEPS(cell, qp, i, dim)
                		                   *dTemp)
                		                   * wGradBF(cell, node, qp, dim);
    } } } } }

//Irina comment: everything below was commented out
 /*
  if (workset.transientTerms && enableTransient)
    for (int cell=0; cell < workset.numCells; ++cell) {
      for (int node=0; node < numNodes; ++node) {
          for (int qp=0; qp < numQPs; ++qp) {
            for (int i=0; i<numDims; i++) {
                ExResidual(cell,node,i) += uDotDot(cell, qp, i) * wBF(cell, node, qp);
    } } } }
*/

//   FST::integrate<ScalarT>(ExResidual, TotalStress, wGradBF, Intrepid::COMP_CPP, false); // "false" overwrites

}
void
TLPoroPlasticityResidMomentum<EvalT, Traits>::evaluateFields(
    typename Traits::EvalData workset)
{
  typedef Intrepid2::FunctionSpaceTools<PHX::Device> FST;
  typedef Intrepid2::RealSpaceTools<PHX::Device>     RST;
  RST::inverse(F_inv, defgrad.get_view());
  RST::transpose(F_invT, F_inv);
  FST::scalarMultiplyDataData(JF_invT, J.get_view(), F_invT);
  // FST::tensorMultiplyDataData(P.get_view(), TotalStress.get_view(), JF_invT);

  for (int cell = 0; cell < workset.numCells; ++cell) {
    for (int node = 0; node < numNodes; ++node) {
      for (int dim = 0; dim < numDims; dim++) ExResidual(cell, node, dim) = 0.0;
      for (int qp = 0; qp < numQPs; ++qp) {
        for (int i = 0; i < numDims; i++) {
          for (int dim = 0; dim < numDims; dim++) {
            ExResidual(cell, node, i) +=
                TotalStress(cell, qp, i, dim) * wGradBF(cell, node, qp, dim);
          }
        }
      }
    }
  }

  if (workset.transientTerms && enableTransient)
    for (int cell = 0; cell < workset.numCells; ++cell) {
      for (int node = 0; node < numNodes; ++node) {
        for (int qp = 0; qp < numQPs; ++qp) {
          for (int i = 0; i < numDims; i++) {
            ExResidual(cell, node, i) +=
                uDotDot(cell, qp, i) * wBF(cell, node, qp);
          }
        }
      }
    }

  //   FST::integrate(ExResidual.get_view(), TotalStress.get_view(),
  //   wGradBF.get_view(), false); // "false" overwrites
}