26 #ifndef vtkMaterialInterfaceFilter_h 27 #define vtkMaterialInterfaceFilter_h 52 class vtkMaterialInterfaceLevel;
53 class vtkMaterialInterfaceFilterBlock;
54 class vtkMaterialInterfaceFilterIterator;
55 class vtkMaterialInterfaceEquivalenceSet;
56 class vtkMaterialInterfaceFilterRingBuffer;
74 void SelectMaterialArray(
const char* name);
78 void UnselectMaterialArray(
const char* name);
82 void UnselectAllMaterialArrays();
86 void SetMaterialArrayStatus(
const char* name,
int status);
91 int GetMaterialArrayStatus(
const char* name);
92 int GetMaterialArrayStatus(
int index);
97 int GetNumberOfMaterialArrays();
101 const char* GetMaterialArrayName(
int index);
107 void SelectMassArray(
const char* name);
111 void UnselectMassArray(
const char* name);
115 void UnselectAllMassArrays();
119 void SetMassArrayStatus(
const char* name,
int status);
124 int GetMassArrayStatus(
const char* name);
125 int GetMassArrayStatus(
int index);
130 int GetNumberOfMassArrays();
134 const char* GetMassArrayName(
int index);
140 void SelectVolumeWtdAvgArray(
const char* name);
144 void UnselectVolumeWtdAvgArray(
const char* name);
148 void UnselectAllVolumeWtdAvgArrays();
153 void SetVolumeWtdAvgArrayStatus(
const char* name,
int status);
158 int GetVolumeWtdAvgArrayStatus(
const char* name);
159 int GetVolumeWtdAvgArrayStatus(
int index);
164 int GetNumberOfVolumeWtdAvgArrays();
168 const char* GetVolumeWtdAvgArrayName(
int index);
174 void SelectMassWtdAvgArray(
const char* name);
178 void UnselectMassWtdAvgArray(
const char* name);
182 void UnselectAllMassWtdAvgArrays();
187 void SetMassWtdAvgArrayStatus(
const char* name,
int status);
192 int GetMassWtdAvgArrayStatus(
const char* name);
193 int GetMassWtdAvgArrayStatus(
int index);
198 int GetNumberOfMassWtdAvgArrays();
202 const char* GetMassWtdAvgArrayName(
int index);
208 void SelectSummationArray(
const char* name);
212 void UnselectSummationArray(
const char* name);
216 void UnselectAllSummationArrays();
220 void SetSummationArrayStatus(
const char* name,
int status);
225 int GetSummationArrayStatus(
const char* name);
226 int GetSummationArrayStatus(
int index);
231 int GetNumberOfSummationArrays();
235 const char* GetSummationArrayName(
int index);
242 void SetMaterialFractionThreshold(
double fraction);
243 vtkGetMacro(MaterialFractionThreshold,
double);
251 vtkSetMacro(ComputeOBB,
bool);
252 vtkGetMacro(ComputeOBB,
bool);
267 void SetUpperLoadingBound(
int nPolys);
268 vtkGetMacro(UpperLoadingBound,
int);
276 vtkSetStringMacro(OutputBaseName);
277 vtkGetStringMacro(OutputBaseName);
283 vtkSetMacro(WriteGeometryOutput,
bool);
284 vtkGetMacro(WriteGeometryOutput,
bool);
285 vtkSetMacro(WriteStatisticsOutput,
bool);
286 vtkGetMacro(WriteStatisticsOutput,
bool);
295 vtkSetMacro(BlockGhostLevel,
unsigned char);
296 vtkGetMacro(BlockGhostLevel,
unsigned char);
302 static void SelectionModifiedCallback(
vtkObject*,
unsigned long,
void* clientdata,
void*);
317 vtkSetMacro(InvertVolumeFraction,
int);
318 vtkGetMacro(InvertVolumeFraction,
int);
337 std::vector<std::string>& volumeWtdAvgArrayNames,
338 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
339 std::vector<std::string>& integratedArrayNames);
343 int ProcessBlock(
int blockId);
346 void ConnectFragment(vtkMaterialInterfaceFilterRingBuffer* iterator);
347 void GetNeighborIterator(vtkMaterialInterfaceFilterIterator* next,
348 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
349 int axis2,
int maxFlag2);
350 void GetNeighborIteratorPad(vtkMaterialInterfaceFilterIterator* next,
351 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
352 int axis2,
int maxFlag2);
353 void CreateFace(vtkMaterialInterfaceFilterIterator* in, vtkMaterialInterfaceFilterIterator* out,
354 int axis,
int outMaxFlag);
355 int ComputeDisplacementFactors(vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
356 double displacmentFactors[3],
int rootNeighborIdx,
int faceAxis);
357 int SubVoxelPositionCorner(
double* point,
358 vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
int rootNeighborIdx,
360 void FindPointNeighbors(vtkMaterialInterfaceFilterIterator* iteratorMin0,
361 vtkMaterialInterfaceFilterIterator* iteratorMax0,
int axis0,
int maxFlag1,
int maxFlag2,
362 vtkMaterialInterfaceFilterIterator pointNeighborIterators[8],
double pt[3]);
370 void ShareGhostBlocks();
371 void HandleGhostBlockRequests();
372 int ComputeRequiredGhostExtent(
int level,
int inExt[6],
int outExt[6]);
374 void ComputeAndDistributeGhostBlocks(
375 int* numBlocksInProc,
int* blockMetaData,
int myProc,
int numProcs);
381 vtkMaterialInterfaceFilterIterator* neighbor1, vtkMaterialInterfaceFilterIterator* neighbor2);
383 void PrepareForResolveEquivalences();
385 void ResolveEquivalences();
386 void GatherEquivalenceSets(vtkMaterialInterfaceEquivalenceSet*
set);
387 void ShareGhostEquivalences(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffsets);
388 void ReceiveGhostFragmentIds(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffset);
389 void MergeGhostEquivalenceSets(vtkMaterialInterfaceEquivalenceSet* globalSet);
393 int ResolveIntegratedAttributes(
int controllingProcId);
395 int PrepareToResolveIntegratedAttributes();
398 int SendIntegratedAttributes(
int recipientProcId);
400 int ReceiveIntegratedAttributes(
int sourceProcId);
402 int PrepareToCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
403 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
404 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
405 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
406 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
407 std::vector<std::vector<vtkDoubleArray*>>& sums);
409 int CleanUpAfterCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
410 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
411 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
412 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
413 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
414 std::vector<std::vector<vtkDoubleArray*>>& sums);
417 int CollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
418 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
419 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
420 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
421 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
422 std::vector<std::vector<vtkDoubleArray*>>& sums);
424 int BroadcastIntegratedAttributes(
int sourceProcessId);
426 int SendGeometricAttributes(
int controllingProcId);
428 int PrepareToCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
429 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
430 std::vector<int*>& ids);
432 int CleanUpAfterCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
433 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
434 std::vector<int*>& ids);
437 int CollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
438 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
439 std::vector<int*>& ids);
441 int PrepareToMergeGeometricAttributes();
443 int GatherGeometricAttributes(
int recipientProcId);
445 void ResolveLocalFragmentGeometry();
447 void ResolveRemoteFragmentGeometry();
449 void CleanLocalFragmentGeometry();
451 void BuildLoadingArray(std::vector<vtkIdType>& loadingArray);
452 int PackLoadingArray(
vtkIdType*& buffer);
453 int UnPackLoadingArray(
vtkIdType* buffer,
int bufSize, std::vector<vtkIdType>& loadingArray);
457 void CopyAttributesToOutput0();
458 void CopyAttributesToOutput1();
459 void CopyAttributesToOutput2();
461 int WriteGeometryOutputToTextFile();
462 int WriteStatisticsOutputToTextFile();
469 int Accumulate(
double* dest,
474 int AccumulateMoments(
double* moments,
479 void ComputeGeometricAttributes();
480 int ComputeLocalFragmentOBB();
481 int ComputeLocalFragmentAABBCenters();
488 void DeleteAllBlocks();
490 std::string& massArrayName, std::vector<std::string>& volumeWtdAvgArrayNames,
491 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
492 std::vector<std::string>& integratedArrayNames);
493 void AddBlock(vtkMaterialInterfaceFilterBlock* block,
unsigned char levelOfGhostLayer);
496 void CheckLevelsForNeighbors(vtkMaterialInterfaceFilterBlock* block);
498 int FindFaceNeighbors(
unsigned int blockLevel,
int blockIndex[3],
int faceAxis,
int faceMaxFlag,
499 std::vector<vtkMaterialInterfaceFilterBlock*>* result);
506 int HasNeighbor(
unsigned int blockLevel,
int blockIndex[3],
int neighborDirection[3]);
517 vtkSetStringMacro(MaterialFractionArrayName);
639 double GlobalOrigin[3];
640 double RootSpacing[3];
641 int StandardBlockDimensions[3];
643 void SaveBlockSurfaces(
const char* fileName);
644 void SaveGhostSurfaces(
const char* fileName);
648 std::vector<vtkMaterialInterfaceLevel*>
Levels;
656 double FaceCornerPoints[12];
657 double FaceEdgePoints[12];
658 int FaceEdgeFlags[4];
660 void ComputeFacePoints(vtkMaterialInterfaceFilterIterator* in,
661 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
662 void ComputeFaceNeighbors(vtkMaterialInterfaceFilterIterator* in,
663 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
665 long ComputeProximity(
const int faceIdx[3],
int faceLevel,
const int ext[6],
int refLevel);
667 void FindNeighbor(
int faceIndex[3],
int faceLevel, vtkMaterialInterfaceFilterIterator* neighbor,
668 vtkMaterialInterfaceFilterIterator* reference);
686 #ifdef vtkMaterialInterfaceFilterDEBUG 693 double ClipCenter[3];
697 double ClipPlaneVector[3];
698 double ClipPlaneNormal[3];
707 #ifdef vtkMaterialInterfaceFilterPROFILE 712 long NumberOfGhostBlocks;
vtkImplicitFunction * ClipFunction
vtkDoubleArray * ClipDepthMinimums
vtkMaterialInterfaceEquivalenceSet * EquivalenceSet
int FragmentId
class vtkMaterialInterfaceFilterIntegrator {
Extract particles and analyse them.
Data structure that describes a fragment's loading.
vtkDataArraySelection * SummationArraySelection
vtkMultiProcessController * Controller
std::vector< vtkPolyData * > FragmentMeshes
std::vector< std::vector< int > > ResolvedFragmentIds
vtkMaterialInterfaceFilterIterator * FaceNeighbors
double ProgressMaterialInc
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT
vtkIntArray * FragmentSplitGeometry
vtkDataArraySelection * MaterialArraySelection
vtkDoubleArray * ClipDepthMaximums
vtkMultiBlockDataSet * ResolvedFragments
vtkCallbackCommand * SelectionObserver
std::vector< vtkDoubleArray * > FragmentSums
unsigned char BlockGhostLevel
int * NumberOfRawFragmentsInProcess
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkMultiBlockDataSet * ResolvedFragmentOBBs
vtkTypeUInt64 vtkMTimeType
double MaterialFractionThreshold
vtkDoubleArray * FragmentVolumes
int * LocalToGlobalOffsets
static vtkMultiBlockDataSetAlgorithm * New()
vtkDoubleArray * FragmentMoments
virtual int FillOutputPortInformation(int port, vtkInformation *info)
std::vector< double > FragmentMoment
vtkMultiBlockDataSet * ResolvedFragmentCenters
std::vector< std::vector< double > > FragmentVolumeWtdAvg
int NumberOfResolvedFragments
vtkMaterialInterfaceFilterBlock ** InputBlocks
int TotalNumberOfRawFragments
std::vector< std::string > VolumeWtdAvgArrayNames
std::vector< std::vector< double > > FragmentSum
virtual vtkMTimeType GetMTime()
std::vector< std::string > MassWtdAvgArrayNames
std::vector< std::vector< int > > FragmentSplitMarker
std::vector< vtkPoints * > ResolvedFragmentPoints
double scaledMaterialFractionThreshold
std::vector< vtkDoubleArray * > FragmentMassWtdAvgs
vtkDoubleArray * FragmentAABBCenters
vtkDataArraySelection * MassWtdAvgArraySelection
std::vector< vtkDoubleArray * > FragmentVolumeWtdAvgs
char * MaterialFractionArrayName
std::vector< std::vector< double > > FragmentMassWtdAvg
std::vector< std::string > IntegratedArrayNames
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkPolyData * CurrentFragmentMesh
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
bool WriteStatisticsOutput
vtkDataArraySelection * VolumeWtdAvgArraySelection
int ResolvedFragmentCount
void operator=(const vtkObjectBase &)
std::vector< vtkMaterialInterfaceFilterBlock * > GhostBlocks
vtkDoubleArray * FragmentOBBs
};
std::vector< int > IntegratedArrayNComp
double ProgressResolutionInc
vtkDataArraySelection * MassArraySelection
std::vector< vtkMaterialInterfaceLevel * > Levels