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

AlbPUMI_QPData_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 "AlbPUMI_QPData.hpp"
00008 
00009 template<typename DataType, unsigned Dim, class traits>
00010 AlbPUMI::QPData<DataType, Dim, traits>::QPData(const std::string& name_,
00011                const std::vector<int>& dim, const bool output_) :
00012   name(name_),
00013   output(output_),
00014   dims(dim),
00015   nfield_dofs(1),
00016   beginning_index(0)
00017 {
00018 
00019   for(std::size_t i = 1; i < dims.size(); i++) // multiply it by the number of dofs per node
00020 
00021     nfield_dofs *= dims[i];
00022 
00023 }
00024 
00025 template<typename DataType, unsigned Dim, class traits>
00026 void
00027 AlbPUMI::QPData<DataType, Dim, traits>::reAllocateBuffer(const std::size_t nelems){
00028 
00029   std::size_t total_size = nelems * nfield_dofs;
00030 
00031   buffer.resize(total_size);
00032 
00033   beginning_index = 0;
00034 
00035   return;
00036 
00037 }
00038 
00039 template<typename DataType, unsigned Dim, class traits>
00040 Albany::MDArray
00041 AlbPUMI::QPData<DataType, Dim, traits>::getMDA(const std::size_t nelems){
00042 
00043   unsigned total_size = nelems * nfield_dofs;
00044 
00045   field_type the_array = traits_type::buildArray(&buffer[beginning_index], nelems, dims);
00046 
00047   beginning_index += total_size;
00048 
00049   return the_array;
00050 
00051 }

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