Oops... I messed up the grid convention. Grid=1 is the cylinder Dominic On Tuesday, January 17, 2012, Dominic Chandar <dominic.chandar@xxxxxxxxx> wrote: > Hi Mostafa, > I have not checked this myself but I think this is an explanation: > > Grid = 0, Side = 0 , axis = 0 corresponds to the periodic boundary (axis = 0) of the cylinder (grid =0) which is horizontal. Thus the two normals (Nx,Ny) will be (0,-1) or (0,1) depending on which periodic boundary you want. > Try side = 1, axis = 0, you will get one set of normals all 1 and the other 0. > If you want the normals on the surface of the cylinder, I believe you should set grid = 0, side = 0, axis = 1. > Dominic > > On Tue, Jan 17, 2012 at 4:13 PM, mostafa amini afshar < m_aminiafshar@xxxxxxxxx> wrote: >> >> Dear Bill >> I have tried to use "vertexBoundaryNormal" in order to get the normal vectors for "circle in a channel, cic" grid. When I diplay the results for the normals of the channel grid over side=0 on axis0, surprisingly two sets of normals are printed with one of them showing all -1 and the other all 0 for the normals. I can not interprete the zeros normal vectors on this side of the cic grid. Could you please kindly tell me where is my mistake in extracting the normals? >> >> I copy the code and the display output below. >> >> Best regards >> Mostafa >> >> >> #include "Overture.h" >> >> int >> main(int argc, char *argv[]) >> { >> Overture::start(argc,argv); // initialize Overture >> >> // create and read in a CompositeGrid >> >> CompositeGrid cg; >> getFromADataBase(cg,"cic.hdf"); >> cg.update(MappedGrid::THEvertex | MappedGrid::THEcenter | MappedGrid::THEvertexBoundaryNormal); >> >> int grid=0; >> int side=0; >> int axis=0; >> >> MappedGrid mg = cg[grid]; >> >> realArray normal=mg.vertexBoundaryNormal(side,axis); >> normal.display(); >> >> Overture::finish(); >> return 0; >> } >> >> >> >> A++ Internal_Index bounds checking: ON >> ***** Mounting file cic.hdf**** >> getFromADataBase: number of CompositeGrid(s) found =1, name[0]=cic >> Time to read in the grid is 2.12e-03(s) >> doubleArray::display() (CONST) (Array_ID = 54) -- >> Array_Data is a VALID pointer = 0x9ecd5d8 (166516184)! >> ***** AXIS 3 ( 0) ***** >> ***** AXIS 2 ( 0) ***** >> AXIS 0 --->: ( 0) >> AXIS 1 ( -2) -1.0000 >> AXIS 1 ( -1) -1.0000 >> AXIS 1 ( 0) -1.0000 >> AXIS 1 ( 1) -1.0000 >> AXIS 1 ( 2) -1.0000 >> AXIS 1 ( 3) -1.0000 >> AXIS 1 ( 4) -1.0000 >> AXIS 1 ( 5) -1.0000 >> AXIS 1 ( 6) -1.0000 >> AXIS 1 ( 7) -1.0000 >> AXIS 1 ( 8) -1.0000 >> AXIS 1 ( 9) -1.0000 >> AXIS 1 ( 10) -1.0000 >> AXIS 1 ( 11) -1.0000 >> AXIS 1 ( 12) -1.0000 >> AXIS 1 ( 13) -1.0000 >> AXIS 1 ( 14) -1.0000 >> AXIS 1 ( 15) -1.0000 >> AXIS 1 ( 16) -1.0000 >> AXIS 1 ( 17) -1.0000 >> AXIS 1 ( 18) -1.0000 >> AXIS 1 ( 19) -1.0000 >> AXIS 1 ( 20) -1.0000 >> AXIS 1 ( 21) -1.0000 >> AXIS 1 ( 22) -1.0000 >> AXIS 1 ( 23) -1.0000 >> AXIS 1 ( 24) -1.0000 >> AXIS 1 ( 25) -1.0000 >> AXIS 1 ( 26) -1.0000 >> AXIS 1 ( 27) -1.0000 >> AXIS 1 ( 28) -1.0000 >> AXIS 1 ( 29) -1.0000 >> AXIS 1 ( 30) -1.0000 >> AXIS 1 ( 31) -1.0000 >> AXIS 1 ( 32) -1.0000 >> AXIS 1 ( 33) -1.0000 >> ***** AXIS 3 ( 1) ***** >> ***** AXIS 2 ( 0) ***** >> AXIS 0 --->: ( 0) >> AXIS 1 ( -2) 0.0000 >> AXIS 1 ( -1) 0.0000 >> AXIS 1 ( 0) 0.0000 >> AXIS 1 ( 1) 0.0000 >> AXIS 1 ( 2) 0.0000 >> AXIS 1 ( 3) 0.0000 >> AXIS 1 ( 4) 0.0000 >> AXIS 1 ( 5) 0.0000 >> AXIS 1 ( 6) 0.0000 >> AXIS 1 ( 7) 0.0000 >> AXIS 1 ( 8) 0.0000 >> AXIS 1 ( 9) 0.0000 >> AXIS 1 ( 10) 0.0000 >> AXIS 1 ( 11) 0.0000 >> AXIS 1 ( 12) 0.0000 >> AXIS 1 ( 13) 0.0000 >> AXIS 1 ( 14) 0.0000 >> AXIS 1 ( 15) 0.0000 >> AXIS 1 ( 16) 0.0000 >> AXIS 1 ( 17) 0.0000 >> AXIS 1 ( 18) 0.0000 >> AXIS 1 ( 19) 0.0000 >> AXIS 1 ( 20) 0.0000 >> AXIS 1 ( 21) 0.0000 >> AXIS 1 ( 22) 0.0000 >> AXIS 1 ( 23) 0.0000 >> AXIS 1 ( 24) 0.0000 >> AXIS 1 ( 25) 0.0000 >> AXIS 1 ( 26) 0.0000 >> AXIS 1 ( 27) 0.0000 >> AXIS 1 ( 28) 0.0000 >> AXIS 1 ( 29) 0.0000 >> AXIS 1 ( 30) 0.0000 >> AXIS 1 ( 31) 0.0000 >> AXIS 1 ( 32) 0.0000 >> AXIS 1 ( 33) 0.0000 > >