UnitCube Class Reference

#include <unitcube.h>

Collaboration diagram for UnitCube:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UnitCube ()
 ~UnitCube ()
ArrayOfVecDoublevertices ()
void project_2d_points_into_faces (const VecDouble &pt2D, VecDouble *ppt3D, FaceDirection3D dir)
void face_base_vectors (Index FaceId, VecDouble *v1, VecDouble *v2)

Static Public Member Functions

static unsigned n_faces ()
static unsigned n_vertices ()

Protected Attributes

VecDouble e1
VecDouble e2
VecDouble e3
ArrayOfVecDouble _vertices

Detailed Description

Definition at line 13 of file unitcube.h.


Constructor & Destructor Documentation

UnitCube::UnitCube (  ) 

Definition at line 5 of file unitcube.cpp.

00006 {
00007   //Set the unit vectors
00008   e1.reinit(3);
00009   e2.reinit(3);
00010   e3.reinit(3);
00011 
00012   e1=0;
00013   e2=0;
00014   e3=0;
00015 
00016   e1(0)=1;
00017   e2(1)=1;
00018   e3(2)=1;
00019 
00020   //Set the vertices
00021   _vertices.reinit(8,3);
00022   _vertices(0,0) = 0;  _vertices(0,1) = 0;  _vertices(0,2) = 0;
00023   _vertices(1,0) = 1;  _vertices(1,1) = 0;  _vertices(1,2) = 0;
00024   _vertices(2,0) = 0;  _vertices(2,1) = 1;  _vertices(2,2) = 0;
00025   _vertices(3,0) = 1;  _vertices(3,1) = 1;  _vertices(3,2) = 0;
00026   _vertices(4,0) = 0;  _vertices(4,1) = 0;  _vertices(4,2) = 1;
00027   _vertices(5,0) = 1;  _vertices(5,1) = 0;  _vertices(5,2) = 1;
00028   _vertices(6,0) = 0;  _vertices(6,1) = 1;  _vertices(6,2) = 1;
00029   _vertices(7,0) = 1;  _vertices(7,1) = 1;  _vertices(7,2) = 1;
00030 
00031 
00032   
00033 
00034 
00035 }

UnitCube::~UnitCube (  ) 

Definition at line 37 of file unitcube.cpp.

00038 {
00039 
00040 }


Member Function Documentation

void UnitCube::face_base_vectors ( Index  FaceId,
VecDouble v1,
VecDouble v2 
)

Definition at line 67 of file unitcube.cpp.

00068 {
00069   if (faceId < 2)
00070   {
00071     (*v1)=e2;
00072     (*v2)=e3;
00073     return;
00074   }
00075   if (faceId < 4)
00076   {
00077     (*v1)=e1;
00078     (*v2)=e3;
00079     return;
00080   }
00081   if (faceId < 7)
00082   {
00083     (*v1)=e1;
00084     (*v2)=e2;
00085     return;
00086   }
00087   assert(0); //Invalid faceId
00088   return;
00089 }

static unsigned UnitCube::n_faces (  )  [inline, static]

Definition at line 25 of file unitcube.h.

00025 {return 6;}

static unsigned UnitCube::n_vertices (  )  [inline, static]

Definition at line 26 of file unitcube.h.

00026 {return 8;}

void UnitCube::project_2d_points_into_faces ( const VecDouble pt2D,
VecDouble ppt3D,
FaceDirection3D  dir 
)

Definition at line 54 of file unitcube.cpp.

00055 {
00056   assert(pt2D.size() == 2);
00057   assert(ppt3D->size() == 3);
00058   VecDouble &pt3D = *ppt3D;
00059   pt3D(proj_info[dir][0])=pt2D(0);
00060   pt3D(proj_info[dir][1])=pt2D(1);
00061   pt3D(proj_info[dir][2])=static_cast<double>(proj_info[dir][3]);
00062   
00063   
00064 }

ArrayOfVecDouble& UnitCube::vertices (  )  [inline]

Definition at line 27 of file unitcube.h.

00027 {return _vertices;}


Member Data Documentation

Definition at line 19 of file unitcube.h.

VecDouble UnitCube::e1 [protected]

Definition at line 18 of file unitcube.h.

VecDouble UnitCube::e2 [protected]

Definition at line 18 of file unitcube.h.

VecDouble UnitCube::e3 [protected]

Definition at line 18 of file unitcube.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:13:29 2012 for CO2INJECTION by  doxygen 1.6.3