[overture] Re: regarding unstructured iterations

  • From: "Kyle K. Chand" <chand1@xxxxxxxx>
  • To: MunikrishnaNagaram@xxxxxxx
  • Date: Mon, 24 Nov 2008 15:14:26 -0800

Hi Muni,

I am copying my response to the list since it may be more generally useful.

>  1. how do we read ingrid file data(for a hyperbolic mesh generated around an 
> airfoil)
>      and link to unstructured mapping, i.e. reading the grid data and put it 
> in unst. mapping?
>     Could you please indicate the set of commands?

In code, it would be 

aString ingrid_file_name = "whatever.msh";
UnstructuredMapping umap;
umap.get(ingrid_file_name);

This will fill the umap with the data in the mesh file.
To read an ingrid file into ogen, you can either use

create mappings->read from file-> read an ingrid style file
or
create mappings->2D->unstructured->read data from a file


>  
> 2. If you could also send me a sample cmd file for using iterator and 
> adjacency iterator, 
>     it helps me to get a better understanding of how to use the class files.

Here is a loop that goes through all the cells and loops through the faces 
(there may be typos):

UnstructuredMapping umap;
umap.get(file_name);

UnstructuredMapping::EntityTypeEnum cell_type = 
(UnstructuredMapping::EntityTypeEnum) umap.getDomainDimension();
UnstructuredMapping::EntityTypeEnum face_type = 
(UnstructuredMapping::EntityTypeEnum) (umap.getDomainDimension()-1);

for ( UnstructuredMappingIterator cell = umap.begin(cell_type);
                                                 cell!=umap.end(cell_type);
                                                 cell++ ) {

  cout<<"Faces for cell "<<*cell<<" : ";

  UnstructuredMappingAdjacencyIterator face_end = umap.adjacency_end(cell, 
face_type); 
  for ( UnstructuredMappingAdjacencyIterator face = umap.adjacency_begin(cell, 
face_type);
                                                                  face != 
face_end;
                                                                  face++ ) {
       cout<<*face<<"("<<face.orientation()<<"),  ";
  }
}
cout<<endl;

This code is adapted from GridFunction/UnstructuredOperators.C
which has more examples of using adjacencies in general.

>  
> 3. Right now I am manually using a C program for generating hyperbolic grids. 
> If I want to use
>     Ogen for that, I want to know how we can input x,y coords for 2d airfoil 
> or
>    surface triangle/quad mesh data  for a 3d wing into Ogen. 

You can enter put the points into a SplineMapping or NurbsMapping in a command 
file as demonstrated by 
sampleGrids/hgrid.cmd, sampleGrids/triSail.cmd sampleGrids/wiggly.cmd . 
Basically you either want
to make a Spline mapping (create mappings->2D->spline) or a NurbsMapping 
(create mappings->2D->nurbs (curve)).
For a surface, you can do a similar thing with a DataPointMapping or an 
UnstructuredMapping to use as
a starting surface for the hyperbolic mesh generator.

Regards,
Kyle



-- 
Kyle K. Chand
mailto:chand1@xxxxxxxx
phoneto:  (925)  422 7740

Other related posts:

  • » [overture] Re: regarding unstructured iterations - Kyle K. Chand