ESyS-Particle  4.0.1
HexagBlockIterator.hpp
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 
00014 #ifndef ESYS_LSMHEXAGBLOCKITERATOR_HPP
00015 #define ESYS_LSMHEXAGBLOCKITERATOR_HPP
00016 
00017 namespace esys
00018 {
00019   namespace lsm
00020   {
00021     HexagBlockIterator::HexagBlockIterator()
00022       : ClosePackIterator()
00023     {
00024     }
00025 
00026     HexagBlockIterator::HexagBlockIterator(
00027       int numI,
00028       int numJ,
00029       int numK,
00030       double sphereRadius,
00031       ClosePackOrientation orientation
00032     )
00033       : ClosePackIterator(numI, numJ, numK, sphereRadius, orientation)
00034     {
00035       setDimRepeat(Vec3L(2,2,2));
00036       
00037       OffsetMatrix offsetMatrix;
00038       offsetMatrix(0,0,0) = 0.0;
00039       offsetMatrix(0,0,1) = getRadius();
00040       offsetMatrix(0,0,2) = 0.0;
00041 
00042       offsetMatrix(0,1,0) = getRadius();
00043       offsetMatrix(0,1,1) = 0.0;
00044       offsetMatrix(0,1,2) = 0.0;
00045 
00046       offsetMatrix(0,2,0) = 0.0;
00047       offsetMatrix(0,2,1) = 0.0;
00048       offsetMatrix(0,2,2) = 0.0;
00049 
00050       offsetMatrix(1,0,0) = 0.0;
00051       offsetMatrix(1,0,1) = 0.0;
00052       offsetMatrix(1,0,2) = 0.0;
00053 
00054       offsetMatrix(1,1,0) = SQRT_1_OVER_3*getRadius();
00055       offsetMatrix(1,1,1) = SQRT_1_OVER_3*getRadius();
00056       offsetMatrix(1,1,2) = SQRT_1_OVER_3*getRadius();
00057 
00058       offsetMatrix(1,2,0) = 0.0;
00059       offsetMatrix(1,2,1) = 0.0;
00060       offsetMatrix(1,2,2) = 0.0;
00061 
00062       offsetMatrix(2,0,0) = 0.0;
00063       offsetMatrix(2,0,1) = 0.0;
00064       offsetMatrix(2,0,2) = 0.0;
00065 
00066       offsetMatrix(2,1,0) = 0.0;
00067       offsetMatrix(2,1,1) = 0.0;
00068       offsetMatrix(2,1,2) = 0.0;
00069 
00070       offsetMatrix(2,2,0) = 0.0;
00071       offsetMatrix(2,2,1) = 0.0;
00072       offsetMatrix(2,2,2) = 0.0;
00073 
00074       setOffsetMatrix(offsetMatrix);
00075     }
00076   }
00077 }
00078 
00079 #endif