Re: [Paraview] Normal vector to Exodus Sideset elements

2018-04-09 Thread Moreland, Kenneth
Dennis,

Yes, this cat has a zipper that allows it's skin to come right off. (Maybe I 
took that "skin the cat" metaphor a bit too far.)

Anyway, just run the Extract Surface filter. After that you can run the 
Generate Surface Normals filter.

-Ken

From: ParaView [mailto:paraview-boun...@public.kitware.com] On Behalf Of Dennis 
Conklin
Sent: Monday, April 9, 2018 1:22 PM
To: Paraview (parav...@paraview.org) 
Subject: [EXTERNAL] [Paraview] Normal vector to Exodus Sideset elements

All,

I'm sure I'm missing something here, so please knock me up alongside the head 
and point it out.

I load a sideset (surface) from an Exodus file.   I end up with a bunch of 
quads that Paraview conveniently created for me from the surface.   I need to 
calculate a Normal vector for each of these quads.  I have tried:

Generate surface normal - this is greyed out (wants poly data?)

Delaunay 3D on this to generate poly data, which I could then hopefully run 
Generate surface normal on, but it was still greyed

Tried Normal Glyphs which gave me point Normal vectors but gave me a bunch of 
Triangle and Polygon elements - I'm not sure what's going on here.
PointDataToCellData to get GlyphVector for each Cell
Python Calculator and ask for area(inputs[0]) the Polygon elements all get 
an Area of -1
Calculator to get Area_X as product of GlyphVector_X and Area
Threshold on Area_X > 0 -  don't want negative areas or some boundary cells 
with GlyphVector_X as negative
Python Calculator to get sum(Area_X)
This number appears to be about half of my expected number

These must be an easier way.  I'm not a vtk guru.   When I first load my 
surface, is there some vtk routine I could call within a Programmable filter to 
get the cell normal?

Alternatively, anyone got an easier way to skin this cat?

Thanks for any hints  you may have.

Dennis

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview


[Paraview] [ANNOUNCE] ParaView 5.5.0 now available for download

2018-04-09 Thread Cory Quammen
Dear ParaView community,

On behalf of the Paraview team, it is my great pleasure to announce
that ParaView 5.5.0 is available for download.

https://www.paraview.org/download/

Full release notes for ParaView 5.5.0 are available at

https://blog.kitware.com/paraview-5-5-0-release-notes/

Additionally, both ParaView's git repository and superbuild repository
have been tagged with "v5.5.0".

Signed installers for macOS are not yet available, but they are in the works.

Thank you,
Cory and the ParaView team


-- 
Cory Quammen
Staff R Engineer
Kitware, Inc.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview


[Paraview] Normal vector to Exodus Sideset elements

2018-04-09 Thread Dennis Conklin
All,

I'm sure I'm missing something here, so please knock me up alongside the head 
and point it out.

I load a sideset (surface) from an Exodus file.   I end up with a bunch of 
quads that Paraview conveniently created for me from the surface.   I need to 
calculate a Normal vector for each of these quads.  I have tried:

Generate surface normal - this is greyed out (wants poly data?)

Delaunay 3D on this to generate poly data, which I could then hopefully run 
Generate surface normal on, but it was still greyed

Tried Normal Glyphs which gave me point Normal vectors but gave me a bunch of 
Triangle and Polygon elements - I'm not sure what's going on here.
PointDataToCellData to get GlyphVector for each Cell
Python Calculator and ask for area(inputs[0]) the Polygon elements all get 
an Area of -1
Calculator to get Area_X as product of GlyphVector_X and Area
Threshold on Area_X > 0 -  don't want negative areas or some boundary cells 
with GlyphVector_X as negative
Python Calculator to get sum(Area_X)
This number appears to be about half of my expected number

These must be an easier way.  I'm not a vtk guru.   When I first load my 
surface, is there some vtk routine I could call within a Programmable filter to 
get the cell normal?

Alternatively, anyone got an easier way to skin this cat?

Thanks for any hints  you may have.

Dennis

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview


[Paraview] Creating Spatial Positions For Optimum Results In Paraview

2018-04-09 Thread GILLILAND G. (929919)
Hi there,

I've had some great advice on here previously, however it isn't supplying the 
correct results.

I've spoken to my lecturer and have done some digging myself, and the reason i 
believe that the code (attached below) isn't providing a decent output to use 
in Paraview is that it's missing spatial positioning. I know the equations to 
do so, but i'm absolutely stuck on where to include them in the code: to find 
the position of x is: i * dx / xMax. where i is the index of the current data 
sample and xMax is 10. dx is the unit position between the data samples, so to 
find this it will be number of data samples along x / xMax.V The same applies 
for y. But just to reiterate, i have not the slightest idea on where or how to 
implement this in my current set up.

Secondly, when using the output provided by the code, if to loo, it looks as if 
all of the z slices are on top of one another. (To note, when compiling the 
code in commandline, i use 64 64 64 1). Correct me if i'm wrong, but I believe 
that the spatial positioning will rectify, or it could be the row id that 
Paraview generates. (Side note, i'm using dot to points to just to get an idea 
of the datas layout)

Thanks so much for the help in advance

#include
#include
#include
#include

void gen_sally( int xs, int ys, int zs, int time, float *sally )
/*
 *  Gen_Sally creates a vector field of dimension [xs,ys,zs,3] from
 *  a proceedural function. By passing in different time arguements,
 *  a slightly different and rotating field is created.
 *
 *  The magnitude of the vector field is highest at some funnel shape
 *  and values range from 0.0 to around 0.4 (I think).
 *
 *  I just wrote these comments, 8 years after I wrote the function.
 *
 *  Developed by Sally of Sally University
 *
 */
{
  float x, y, z;
  int ix, iy, iz;
  float r, xc, yc, scale, temp, z0;
  float r2 = 8;
  float SMALL = 0.001;
  float xdelta = 1.0 / (xs-1.0);
  float ydelta = 1.0 / (ys-1.0);
  float zdelta = 1.0 / (zs-1.0);

  for( iz = 0; iz < zs; iz++ )
  {
z = iz * zdelta;// map z to 0->1
xc = 0.5 + 0.1*sin(0.04*time+10.0*z);   // For each z-slice, determine the 
spiral circle.
yc = 0.5 + 0.1*cos(0.03*time+3.0*z);//(xc,yc) determine the center 
of the circle.
r = 0.1 + 0.4 * z*z + 0.1 * z * sin(8.0*z); //  The radius also changes at 
each z-slice.
r2 = 0.2 + 0.1*z;   //r is the center radius, 
r2 is for damping
for( iy = 0; iy < ys; iy++ )
{
y = iy * ydelta;
for( ix = 0; ix < xs; ix++ )
{
x = ix * xdelta;
temp = sqrt( (y-yc)*(y-yc) + (x-xc)*(x-xc) );
scale = fabs( r - temp );
/*
 *  I do not like this next line. It produces a discontinuity
 *  in the magnitude. Fix it later.
 *
 */
   if ( scale > r2 )
  scale = 0.8 - scale;
   else
  scale = 1.0;
z0 = 0.1 * (0.1 - temp*z );
   if ( z0 < 0.0 )  z0 = 0.0;
   temp = sqrt( temp*temp + z0*z0 );
scale = (r + r2 - temp) * scale / (temp + SMALL);
scale = scale / (1+z);
   *sally++ = scale * (y-yc) + 0.1*(x-xc);
   *sally++ = scale * -(x-xc) + 0.1*(y-yc);
   *sally++ = scale * z0;
}
}
  }
}


void create_csv(char* filename, float *sally, int size) {
printf("1\n Creating %s.csv file\n", filename);

FILE *fp;

fp = fopen(filename, "w");

fprintf(fp, "X,Y,Z\n");
int i;

for (i = 0; i < size; i++) {
fprintf(fp, "%f%c", sally[i], (i % 3) ? ',' : '\n');
}

fclose(fp);
printf("\n %sfile created", filename);
}




int main(int argc, char *argv[]){

printf("1\n");
//read from args
int xs;
int ys;
int zs;
int time;
sscanf(argv[1],"%d",);
sscanf(argv[2],"%d",);
sscanf(argv[3],"%d",);
sscanf(argv[4],"%d",);


int arraySize = xs*ys*zs*3;

//allocate memeory for array. This is done so that stack memory doesn't run 
out.'
float* sally;
sally = (float*)malloc((arraySize) * sizeof(*sally));

//runs the code. One of the args is a pointer so no return type is needed.
gen_sally(xs,ys,zs,time,sally);

//create varibles for file generation
char filename[20] = "results.csv";
create_csv(filename, sally, arraySize);

free(sally);
return 0;
}
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview