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

USERD_get_part_coords.H

Go to the documentation of this file.
00001 // Note: coord_array is 1-based.
00002 
00003 int USERD_get_part_coords
00004 (
00005     int part_number,
00006     float **coord_array
00007 )
00008 {
00009 
00010 #ifdef ENSIGHTDEBUG
00011     Info << "Entering: USERD_get_part_coords" << endl << 
00012         "part_number = " << part_number << endl << flush;
00013 #endif
00014 
00015     if (part_number == 1)
00016     {
00017 
00018         //#       include "checkForNewMesh.H"
00019 
00020         const vectorField& points = meshPtr->points();
00021         label nPoints = points.size();
00022         
00023         for (label indx=0; indx<nPoints; indx++)
00024         {
00025             coord_array[0][indx+1] = (float)points[indx].x();
00026             coord_array[1][indx+1] = (float)points[indx].y();
00027             coord_array[2][indx+1] = (float)points[indx].z();
00028         }
00029     }
00030     else if (part_number < nPatches+2)
00031     {
00032 
00033         //#       include "checkForNewMesh.H"
00034 
00035         label patchi = part_number-2;
00036         const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
00037         const vectorField& points = bMesh[patchi].points();
00038         label nPoints = points.size();
00039         
00040         for (label indx=0; indx<nPoints; indx++)
00041         {
00042             coord_array[0][indx+1] = (float)points[indx].x();
00043             coord_array[1][indx+1] = (float)points[indx].y();
00044             coord_array[2][indx+1] = (float)points[indx].z();
00045         }
00046 
00047     }
00048     else if (part_number == nPatches+2)
00049     {
00050 
00051         label indx = 1;
00052 
00053         for
00054         (
00055             Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
00056             elmnt != sprayPtr->end();
00057             ++elmnt
00058         )
00059         {
00060             coord_array[0][indx] = (float)elmnt().position().x();
00061             coord_array[1][indx] = (float)elmnt().position().y();
00062             coord_array[2][indx] = (float)elmnt().position().z();
00063             indx++;
00064         }
00065 
00066     }
00067     else
00068     {
00069         return Z_ERR;
00070     }
00071 
00072 #ifdef ENSIGHTDEBUG
00073     Info << "Leaving: USERD_get_part_coords" << endl << flush;
00074 #endif
00075 
00076     return Z_OK;
00077 }
Copyright © 2000-2009 OpenCFD Ltd