[CIG-SHORT] Cell centroids

Birendra jha bjha7333 at yahoo.com
Sun Sep 9 13:10:03 PDT 2012


Hi Brad

I used GeometryHex3D::ptsRefToGlobal. I supplied (0,0,0) as the reference point and set vertices equal to coordinatesCell to get the centroid co-ordinates for each cell. Is this correct? 

I have another question. I am trying to run pylith on multiple cores. The problem is that in my code pylith calls another application (c++ files, linked dynamically) which is parallelized using OpenMP. When I run pylith using --nodes=2 (or 4), I see that pylith solver reports 2 MPI processes which is good. But I see 2 instances of the other application running simultaneously.

When I just run on 1 core, pylith reports 1 MPI process and the other application reports using 24 threads. This, I think, is because it uses OpenMP to get as many threads as possible.

If I disable the OpenMP part of the other app i.e. remove following

#ifdef _OPENMP
#pragma omp parallel
#pragma omp master
  n_threads = omp_get_num_threads();
#else
  n_threads = 1;
#endif

so that it can only use 1 thread, will it solve the issue i.e. allow running both pylith and the other app on the same no. of cores? 

Thanks and regards
Birendra


--- On Sun, 9/9/12, Brad Aagaard <baagaard at usgs.gov> wrote:

> From: Brad Aagaard <baagaard at usgs.gov>
> Subject: Re: Cell centroids
> To: "Birendra jha" <bjha7333 at yahoo.com>
> Cc: cig-short at geodynamics.org
> Date: Sunday, September 9, 2012, 9:40 AM
> Birendra,
> 
> If you install netCDF4 you can read netcdf (Exodus files)
> via python and 
> it is trivial to compute the cell centroids in a few lines
> of code. 
> There is also a chance you can do this in ParaView either
> via a filter 
> or via a script.
> 
> Brad
> 
> 
> On 9/8/12 7:29 PM, Birendra jha wrote:
> > Hi
> >
> > Does anyone know if it is possible to compute and
> output cell centroid coordinates from CUBIT?
> >
> > If not in CUBIT, is there some other tool (c++ code
> etc.) for this?
> >
> > I need it for unstructured hexahedral grid. From google
> I found:
> > http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
> > which I tried to use but I don't understand why it does
> not work for general hexahedron.
> >
> > Thanks a lot
> > Birendra
> >
> 
> 


More information about the CIG-SHORT mailing list