How to use the Isosurface Node Printer

From KratosWiki
Jump to: navigation, search

The porpouse of this utility is creating a list of nodes that define the elements which contain an isosurface. For example, if the surface is defined by the red line below, the nodes which match this criteria are the ones in blue. (shown in 2D for visualization porpuses, currenly the utility only supports 3D meshes)

Since it is a simple utility, it works both for serial and parallel problems without any changes.

x


This is useful when results are wanted only on the isosurface, having the list of the nodes that define the

To use it we must first call the constructor:

 Iso_App = IsosurfacePrinterApplication(model_part)


and then, in each time step in which results must be printed:

 Iso_App.ClearData()
 variable1 = PRESSURE
 variable2 = DISTANCE
 isovalue1 = 0.001
 isovalue2 = 5.0
 Iso_App.AddScalarVarIsosurface(variable1, isovalue1)
 Iso_App.AddScalarVarIsosurface(variable2, isovalue2)
 #conditions can be also added
 
 #after all the isosurfaces needed, the array must be created      
 used_nodes_array=Iso_App.CreateNodesArray() 
 size=used_nodes_array.Size()
 	
 if size!=0: #results must be printed only when the array is not empty, otherwise it will segfault
   gid_io.WriteNodalResults(PRESSURE,used_nodes_array,time,0)
   gid_io.WriteNodalResults(VELOCITY,used_nodes_array,time,0)


Printing nodes that are above or below the isosurface

It is also possible to include in the list of nodes to be printed the nodes that are above or below the isosurface. To do so simply call the following functions insted of AddScalarVariableIsosurface:

  Iso_App.AddScalarVarIsosurfaceAndHigher(variable1, isovalue1)

or

 Iso_App.AddScalarVarIsosurfaceAndHigher(variable1, isovalue1)
Personal tools
Categories