Commit 28b65a92 authored by Philippe Pébay's avatar Philippe Pébay Committed by Code Review
Browse files

Merge topic 'UpdateYoungsExampleToNewPipeline' into master

6d326571 Updated to new pipeline
9f3c50fb Removed incorrect block assignment (which was commented out anyway)
parents fdcdf8a1 6d326571
......@@ -45,20 +45,20 @@ cellData.SetVectors( norm )
# Extract submeshes corresponding to 2 different material Ids
cellData.SetActiveScalars( "Material Id" )
threshold2 = vtkThreshold()
threshold2.SetInput( mesh )
threshold2.SetInputData( mesh )
threshold2.SetInputArrayToProcess(0, 0, 0, vtkDataObject.FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes.SCALARS );
threshold2.ThresholdByLower( 2 )
threshold2.Update()
meshMat2 = threshold2.GetOutput()
threshold3 = vtkThreshold()
threshold3.SetInput( mesh )
threshold3.SetInputData( mesh )
threshold3.SetInputArrayToProcess(0, 0, 0, vtkDataObject.FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes.SCALARS );
threshold3.ThresholdByUpper( 3 )
threshold3.Update()
meshMat3 = threshold3.GetOutput()
# Make multiblock from extracted submeshes
meshMB = vtkMultiBlockDataSet()
meshMB = vtkMultiBlockDataSet()
meshMB.SetNumberOfBlocks( 1 )
meshMB.GetMetaData( 0 ).Set( vtkCompositeDataSet.NAME(), "Material 2" )
meshMB.SetBlock( 0, meshMat2 )
......@@ -66,7 +66,7 @@ meshMB.SetBlock( 0, meshMat2 )
# Create mapper for submesh corresponding to material 3
matRange = cellData.GetScalars().GetRange()
meshMapper = vtkDataSetMapper()
meshMapper.SetInput( meshMat3 )
meshMapper.SetInputData( meshMat3 )
meshMapper.SetScalarRange( matRange )
meshMapper.SetScalarModeToUseCellData()
meshMapper.SetColorModeToMapScalars()
......@@ -83,12 +83,10 @@ renderer.AddViewProp( meshActor )
cellData.SetActiveScalars("frac_pres[1]")
# Reconstruct material interface
interface = vtkYoungsMaterialInterface()
interface.SetInput( meshMB )
interface.SetInputData( meshMB )
interface.SetNumberOfMaterials( 1 )
interface.SetMaterialVolumeFractionArray( 0, "frac_pres[1]" )
#interface.SetMaterialVolumeFractionArray( 1, "frac_pres[2]" )
interface.SetMaterialNormalArray( 0, "norme" )
#interface.SetMaterialNormalArray( 1, "norme" )
interface.FillMaterialOn()
interface.UseAllBlocksOn()
interface.Update()
......@@ -105,7 +103,7 @@ while ( interfaceIterator.IsDoneWithTraversal() == 0 ):
# Create mapper for leaf node
print "Creating mapper and actor for object with flat index", idx
interfaceMapper = vtkDataSetMapper()
interfaceMapper.SetInput( interfaceIterator.GetCurrentDataObject() )
interfaceMapper.SetInputData( interfaceIterator.GetCurrentDataObject() )
interfaceIterator.GoToNextItem()
interfaceMapper.ScalarVisibilityOff()
interfaceMapper.SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment