[overture] Re: vertexBoundaryNormal

  • From: Bill Henshaw <henshaw@xxxxxxxx>
  • To: "overture@xxxxxxxxxxxxx" <overture@xxxxxxxxxxxxx>
  • Date: Tue, 17 Jan 2012 16:05:31 -0800

Hi Mostafa:

  The normal vector at a point (i1,i2,i3) on the boundary is
        ( normal(i1,i2,i3,0), normal(i1,i2,i3,1) )
What you have is therefore the correct outward normal on the left
side of the square grid (grid=0).

 Note that you should use a reference:
     realArray & normal = mg.vertexBoundaryNormal(side,axis);

Regards,
 Bill
mostafa amini afshar 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

Other related posts: