• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

CurrentCoords_Def.hpp

Go to the documentation of this file.
00001 //*****************************************************************//
00002 //    Albany 2.0:  Copyright 2012 Sandia Corporation               //
00003 //    This Software is released under the BSD license detailed     //
00004 //    in the file "license.txt" in the top-level Albany directory  //
00005 //*****************************************************************//
00006 
00007 #include "Teuchos_TestForException.hpp"
00008 #include "Phalanx_DataLayout.hpp"
00009 
00010 #include "Intrepid_FunctionSpaceTools.hpp"
00011 
00012 namespace LCM {
00013 
00014 //**********************************************************************
00015 template<typename EvalT, typename Traits>
00016 CurrentCoords<EvalT, Traits>::
00017 CurrentCoords(const Teuchos::ParameterList& p,
00018               const Teuchos::RCP<Albany::Layouts>& dl) :
00019   refCoords     (p.get<std::string>("Reference Coordinates Name"),dl->vertices_vector),
00020   displacement  (p.get<std::string>("Displacement Name"),dl->node_vector),
00021   currentCoords (p.get<std::string>("Current Coordinates Name"),dl->node_vector)
00022 {
00023   this->addDependentField(refCoords);
00024   this->addDependentField(displacement);
00025 
00026   this->addEvaluatedField(currentCoords);
00027 
00028   this->setName("Current Coordinates"+PHX::TypeString<EvalT>::value);
00029 
00030   std::vector<PHX::DataLayout::size_type> dims;
00031   dl->node_vector->dimensions(dims);
00032   worksetSize = dims[0];
00033   numNodes = dims[1];
00034   numDims = dims[2];
00035 }
00036 
00037 //**********************************************************************
00038 template<typename EvalT, typename Traits>
00039 void CurrentCoords<EvalT, Traits>::
00040 postRegistrationSetup(typename Traits::SetupData d,
00041                       PHX::FieldManager<Traits>& fm)
00042 {
00043   this->utils.setFieldData(refCoords,fm);
00044   this->utils.setFieldData(displacement,fm);
00045   this->utils.setFieldData(currentCoords,fm);
00046 }
00047 
00048 //**********************************************************************
00049 template<typename EvalT, typename Traits>
00050 void CurrentCoords<EvalT, Traits>::
00051 evaluateFields(typename Traits::EvalData workset)
00052 {
00053   for (std::size_t cell=0; cell < workset.numCells; ++cell)
00054     for (std::size_t node=0; node < numNodes; ++node)
00055       for (std::size_t dim=0; dim < numDims; ++dim)
00056         currentCoords(cell,node,dim) = refCoords(cell,node,dim) + displacement(cell,node,dim);
00057 }
00058 
00059 //**********************************************************************
00060 }
00061 

Generated on Wed Mar 26 2014 18:36:37 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1