[MOAB-dev] Setting connectivity for single vertex

CORTIS M. michael.cortis at durham.ac.uk
Tue Feb 3 03:48:17 CST 2015


Vijay/Paul,

As Paul mentioned, the question would be if we always want to write vertices as 1-vertex elements.

I would say that the process of writing a VTK should be

POINTS - are determined from the connectivity of the entities brought up from Range or Meshset (contains entities to be considered as elements)
CELLS & CELL_TYPES - the connectivity & element type should be created from the entities within the Range/Meshset (hence if Range/Meshset contains vertex entities, their connectivity will be created, otherwise it will be omitted)

I am not sure if this change the existing WriteVTK structure, and hence one need to investigate if my proposal make sense or not.

Will consider to create a fork and contribute to moab, but definitely not at this stage, as got all sorts of pressure!

Michael



On 3 Feb 2015, at 01:33, Paul Wilson <ppwilson at wisc.edu<mailto:ppwilson at wisc.edu>> wrote:

Hi Vijay,

I had the same thought and took a quick look.  Much of the infrastructure is there, namely, that the VTK writer appears to already know how to write out nodes as 1-vertex elements.

What is missing is to include the list of vertices among the list of elements to be written.  This happens near lines 144 & 180 in src/io/WriteVTK.cpp.  I think it would need very few changes to make it serve Michael's needs, but a little more work and testing to be implemented as an option.

There would also emerge questions about how to implement the option:

  *   when invoked, always write all vertices as 1-vertex elements, or
  *   when invoked, only write vertices that lack higher-dimension connectivity as 1-vertex elements

The former is quick and easy, but only serves the special case when a model has only unconnected vertices.

Paul

On 02/02/2015 04:49 PM, Vijay S. Mahadevan wrote:

Michael,

If the intent is just to visualize these point clouds and data on
them, we can certainly add some specific functionality for this when
we output the data to vtk. If you want to contribute some code for
this, we will be happy to take a PR directly on our bitbucket repo.

Querying connectivity of the point cloud is not currently supported
and unless you do create a higher dimensional element using sets of
vertices, we cannot compute the one ring vertex neighbors (which
involves find the element adjacencies and performing a union on the
connectivity of these entities). Depicting a point as a traditional
element (0-D element) can possibly be done but this is not supported
now and am not sure how easy it will be without few involved changes
in some parts including the I/O writers.

Vijay

On Sun, Feb 1, 2015 at 9:39 AM, CORTIS M. <michael.cortis at durham.ac.uk><mailto:michael.cortis at durham.ac.uk> wrote:


Hi,

So if you save points on vtk you have such thing where no connectivity and
no cell definition.

POINTS 2 double
10.0 0 0
-10.0 0 0
CELLS 0 0
CELL_TYPES 0

but if you want to can include connectivities and cel definition as follows

POINTS 2 double
10.0 0 0
-10.0 0 0
CELLS 2 4
1 0
1 1
CELL_TYPES 2
1
1

This way, Paraview and VisIt can recognise points as elements and
consequently can visualise them.

Michael


On 1 Feb 2015, at 15:34, Paul Wilson <ppwilson at wisc.edu><mailto:ppwilson at wisc.edu>
 wrote:

Hello again,

On 02/01/2015 09:31 AM, CORTIS M. wrote:

Hello Paul,

In fact you can create vertices and use them and store data on tag.
The only problem was that if there is no connectivity,
ParaView and VisIT does not visualise them unless you plot the points using
glyphs.
So I had to create a function which read the points from a mesh file and
insert their individual connectivities and save them as vtk.

Now I see!  Thanks for the clarification.

So are you connecting the vertices to themselves?  What is the element type
in VTK for such an element?

Paul




Problem solved. But may be MOAB would consider this problem and do something
about it.

Thanks for your input,

Michael


On 1 Feb 2015, at 15:24, Paul Wilson <ppwilson at wisc.edu><mailto:ppwilson at wisc.edu>
 wrote:

Hello Michael,

On 01/29/2015 05:08 PM, CORTIS M. wrote:

Hi Iulian,

Yes I am trying to create an element made from single vertex.
I want to used these for Material Point Method.

So there is a way of creating the vertices, but not adding connectivity to
themselves only?
Or may be another way round?


Perhaps, I'm not fully understanding your questions, but it is certainly
possible to create vertices in MOAB and then use them directly in your
analysis.  There is no need to create an element if, in fact, all you need
are the vertices.  Each vertex can be tagged with data in the same way that
an element can be.

I hope that is helpful,
Paul

If not, don't worry about. Will create a vtk writer to do this and hopefully
moab can use the vertices.

Any assistance is really appreciated.

Kind regards

Michael




On 29 Jan 2015, at 17:24, "Grindeanu, Iulian R." <iulian at mcs.anl.gov><mailto:iulian at mcs.anl.gov> wrote:

Hello,
Moab does not have elements with a single vertex. Is this what you are
trying to do?
A vertex (node) is represented with an entity handle of type MBVERTEX, and
you can get coordinates for it

I am not sure what are you trying to do.
Best Regards,
Iulian

________________________________
From: moab-dev-bounces at mcs.anl.gov<mailto:moab-dev-bounces at mcs.anl.gov> [moab-dev-bounces at mcs.anl.gov<mailto:moab-dev-bounces at mcs.anl.gov>] on behalf
of CORTIS M. [michael.cortis at durham.ac.uk<mailto:michael.cortis at durham.ac.uk>]
Sent: Thursday, January 29, 2015 10:18 AM
To: moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>
Cc: Tautges, Timothy J.
Subject: Re: [MOAB-dev] Setting connectivity for single vertex

Thanks Tim,

I am still having a problem, may be the guys at Argonne can help with this.

I've tried a simpler one and trying to crete the vertex from point.

  double points[9]={0.5,0,0};
  EntityHandle vertex;
  rval=moab2.create_vertex(points,vertex);CHKERR_PETSC(rval);
  EntityHandle dummy;
  rval = moab2.create_element(MBVERTEX,&vertex,1,dummy); CHKERR_PETSC(rval);

But I am getting Error code 2, MB_TYPE_OUT_OF_RANGE !
Is it possible to use MBVERTEX here?

Thanks,

Michael

On 29 Jan 2015, at 15:04, Tim Tautges <tautges at mcs.anl.gov><mailto:tautges at mcs.anl.gov> wrote:

[cc'ng moab-dev list, since I've left Argonne.]

dummy is 0, which is an invalid handle, but should be the handle(s) of the
entities whose connectivity you're setting; I suspect what you want there is
*vertices.begin().  And you can't set connectivity until you make an
element, so you need to call create_element, probably with the number of
verts per element as 1 and the connectivity just the single vertex defining
the point element.

- tim

On 01/29/2015 03:34 AM, CORTIS M. wrote:

Dear Tim,

I've got the following problem:

I want to create vertex entities, ie create the points and vertex entities
using those points.
So I've create a set of vertices from an array of coordinates.
And If you try to set the connectivity for every point you get Error code 4
(MB_ENTITY_NOT_FOUND).

This is my code:

double points[6]={1,0,0, 0,1,0, 0,0,1};
Range vertices;
rval = moab.create_vertices(points,2,vertices); CHKERR_PETSC(rval);
EntityHandle dummy=0;
rval = moab.set_connectivity(dummy,vertexlist,1); CHKERR_PETSC(rval);
//Error code 4

Any suggestions how to overcome this problem.

Kind regards,

Michael



--
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal: http://bit.ly/pphw-cal
Professor, Engineering Physics. ~ http://cnerg.engr.wisc.edu<http://cnerg.engr.wisc.edu/>
Faculty Director, Advanced Computing Infrastructure ~ http://aci.wisc.edu<http://aci.wisc.edu/>



--
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal: http://bit.ly/pphw-cal
Professor, Engineering Physics. ~ http://cnerg.engr.wisc.edu<http://cnerg.engr.wisc.edu/>
Faculty Director, Advanced Computing Infrastructure ~ http://aci.wisc.edu<http://aci.wisc.edu/>





--
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal: http://bit.ly/pphw-cal
Professor, Engineering Physics. ~ http://cnerg.engr.wisc.edu<http://cnerg.engr.wisc.edu/>
Faculty Director, Advanced Computing Infrastructure ~ http://aci.wisc.edu<http://aci.wisc.edu/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20150203/0ec5b2c4/attachment.html>


More information about the moab-dev mailing list