OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

getFieldTensor.H

Go to the documentation of this file.
00001 if (nVar >= Num_variables - nSprayVariables)
00002 {
00003     return Z_UNDEF;
00004 }
00005 
00006 
00007 IOobject fieldObjectPtr
00008 (
00009     fieldNames[var2field[nVar]],
00010     runTime.timeName(),
00011     mesh,
00012     IOobject::NO_READ
00013 );
00014 
00015 if (!fieldObjectPtr.headerOk())
00016 {
00017     return Z_UNDEF;
00018 }
00019 
00020 IOobject fieldObject
00021 (
00022     fieldNames[var2field[nVar]],
00023     runTime.timeName(),
00024     mesh,
00025     IOobject::MUST_READ,
00026     IOobject::NO_WRITE
00027 );
00028 
00029 volTensorField tf
00030 (
00031     fieldObject,
00032     mesh
00033 );
00034 
00035 const cellShapeList& cellShapes = meshPtr->cellShapes();
00036 
00037 // hexa's
00038 if (which_type == Z_HEX08)
00039 {
00040     const cellModel& hex = *(cellModeller::lookup("hex"));
00041     //const cellModel& wedge = *(cellModeller::lookup("wedge"));
00042 
00043     label counter = 1;
00044     for (label n=0; n<nCells; n++)
00045     {
00046         const cellShape& cellShape = cellShapes[n];
00047         const cellModel& cellModel = cellShape.model();
00048 
00049         if (cellModel == hex) // || (cellModel == wedge))
00050         {
00051 #           include "tensorConversion.H"
00052         }
00053     }
00054 }
00055 
00056 // penta's
00057 if (which_type == Z_PEN06)
00058 {
00059     const cellModel& prism = *(cellModeller::lookup("prism"));
00060 
00061     label counter = 1;    
00062     for (label n=0; n<nCells; n++)
00063     {
00064         const cellShape& cellShape = cellShapes[n];
00065         const cellModel& cellModel = cellShape.model();
00066         
00067         if (cellModel == prism)
00068         {
00069 #           include "tensorConversion.H"
00070         }
00071     }
00072 }
00073 
00074 // pyramids's
00075 if (which_type == Z_PYR05)
00076 {
00077     const cellModel& pyr = *(cellModeller::lookup("pyr"));
00078 
00079     label counter = 1;    
00080     for (label n=0; n<nCells; n++)
00081     {
00082         const cellShape& cellShape = cellShapes[n];
00083         const cellModel& cellModel = cellShape.model();
00084 
00085         if (cellModel == pyr)
00086         {
00087 #           include "tensorConversion.H"
00088         }
00089     }
00090 }
00091 
00092 
00093 // penta's
00094 if (which_type == Z_TET04)
00095 {
00096     const cellModel& tet = *(cellModeller::lookup("tet"));
00097 
00098     label counter = 1;
00099     
00100     for (label n=0; n<nCells; n++)
00101     {
00102         const cellShape& cellShape = cellShapes[n];
00103         const cellModel& cellModel = cellShape.model();
00104 
00105         if (cellModel == tet)
00106         {
00107 #           include "tensorConversion.H"
00108         }
00109     }
00110 }
00111 
00112 if (which_type == Z_NFACED)
00113 {
00114     const cellList& cells = meshPtr->cells();
00115 
00116     label counter = 1;
00117     for (label n=0; n<nCells; n++)
00118     {
00119         const labelList& points = cellShapes[n];
00120         label nFacesInCell = cells[n].size();
00121 
00122         if ((nFacesInCell == 6) && (points.size() == 8))
00123         {}
00124         else if ((nFacesInCell == 4) && (points.size() == 4))
00125         {}
00126         else if (nFacesInCell == 5)
00127         {
00128             if (points.size() == 6)
00129             {}
00130             else if (points.size() == 5)
00131             {}
00132             else
00133             {
00134 #               include "tensorConversion.H"
00135             }
00136         }
00137         else
00138         {
00139 #           include "tensorConversion.H"
00140         }
00141     }
00142 }
Copyright © 2000-2009 OpenCFD Ltd