35 #ifndef vtkMaterialInterfaceFilter_h 36 #define vtkMaterialInterfaceFilter_h 61 class vtkMaterialInterfaceLevel;
62 class vtkMaterialInterfaceFilterBlock;
63 class vtkMaterialInterfaceFilterIterator;
64 class vtkMaterialInterfaceEquivalenceSet;
65 class vtkMaterialInterfaceFilterRingBuffer;
83 void SelectMaterialArray(
const char* name);
87 void UnselectMaterialArray(
const char* name);
91 void UnselectAllMaterialArrays();
95 void SetMaterialArrayStatus(
const char* name,
int status);
100 int GetMaterialArrayStatus(
const char* name);
101 int GetMaterialArrayStatus(
int index);
106 int GetNumberOfMaterialArrays();
110 const char* GetMaterialArrayName(
int index);
116 void SelectMassArray(
const char* name);
120 void UnselectMassArray(
const char* name);
124 void UnselectAllMassArrays();
128 void SetMassArrayStatus(
const char* name,
int status);
133 int GetMassArrayStatus(
const char* name);
134 int GetMassArrayStatus(
int index);
139 int GetNumberOfMassArrays();
143 const char* GetMassArrayName(
int index);
149 void SelectVolumeWtdAvgArray(
const char* name);
153 void UnselectVolumeWtdAvgArray(
const char* name);
157 void UnselectAllVolumeWtdAvgArrays();
162 void SetVolumeWtdAvgArrayStatus(
const char* name,
int status);
167 int GetVolumeWtdAvgArrayStatus(
const char* name);
168 int GetVolumeWtdAvgArrayStatus(
int index);
173 int GetNumberOfVolumeWtdAvgArrays();
177 const char* GetVolumeWtdAvgArrayName(
int index);
183 void SelectMassWtdAvgArray(
const char* name);
187 void UnselectMassWtdAvgArray(
const char* name);
191 void UnselectAllMassWtdAvgArrays();
196 void SetMassWtdAvgArrayStatus(
const char* name,
int status);
201 int GetMassWtdAvgArrayStatus(
const char* name);
202 int GetMassWtdAvgArrayStatus(
int index);
207 int GetNumberOfMassWtdAvgArrays();
211 const char* GetMassWtdAvgArrayName(
int index);
217 void SelectSummationArray(
const char* name);
221 void UnselectSummationArray(
const char* name);
225 void UnselectAllSummationArrays();
229 void SetSummationArrayStatus(
const char* name,
int status);
234 int GetSummationArrayStatus(
const char* name);
235 int GetSummationArrayStatus(
int index);
240 int GetNumberOfSummationArrays();
244 const char* GetSummationArrayName(
int index);
251 void SetMaterialFractionThreshold(
double fraction);
252 vtkGetMacro(MaterialFractionThreshold,
double);
260 vtkSetMacro(ComputeOBB,
bool);
261 vtkGetMacro(ComputeOBB,
bool);
276 void SetUpperLoadingBound(
int nPolys);
277 vtkGetMacro(UpperLoadingBound,
int);
285 vtkSetStringMacro(OutputBaseName);
286 vtkGetStringMacro(OutputBaseName);
292 vtkSetMacro(WriteGeometryOutput,
bool);
293 vtkGetMacro(WriteGeometryOutput,
bool);
294 vtkSetMacro(WriteStatisticsOutput,
bool);
295 vtkGetMacro(WriteStatisticsOutput,
bool);
304 vtkSetMacro(BlockGhostLevel,
unsigned char);
305 vtkGetMacro(BlockGhostLevel,
unsigned char);
311 static void SelectionModifiedCallback(
vtkObject*,
unsigned long,
void* clientdata,
void*);
326 vtkSetMacro(InvertVolumeFraction,
int);
327 vtkGetMacro(InvertVolumeFraction,
int);
346 std::vector<std::string>& volumeWtdAvgArrayNames,
347 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
348 std::vector<std::string>& integratedArrayNames);
352 int ProcessBlock(
int blockId);
355 void ConnectFragment(vtkMaterialInterfaceFilterRingBuffer* iterator);
356 void GetNeighborIterator(vtkMaterialInterfaceFilterIterator* next,
357 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
358 int axis2,
int maxFlag2);
359 void GetNeighborIteratorPad(vtkMaterialInterfaceFilterIterator* next,
360 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
361 int axis2,
int maxFlag2);
362 void CreateFace(vtkMaterialInterfaceFilterIterator* in, vtkMaterialInterfaceFilterIterator* out,
363 int axis,
int outMaxFlag);
364 int ComputeDisplacementFactors(vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
365 double displacmentFactors[3],
int rootNeighborIdx,
int faceAxis);
366 int SubVoxelPositionCorner(
double* point,
367 vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
int rootNeighborIdx,
369 void FindPointNeighbors(vtkMaterialInterfaceFilterIterator* iteratorMin0,
370 vtkMaterialInterfaceFilterIterator* iteratorMax0,
int axis0,
int maxFlag1,
int maxFlag2,
371 vtkMaterialInterfaceFilterIterator pointNeighborIterators[8],
double pt[3]);
379 void ShareGhostBlocks();
380 void HandleGhostBlockRequests();
381 int ComputeRequiredGhostExtent(
int level,
int inExt[6],
int outExt[6]);
383 void ComputeAndDistributeGhostBlocks(
384 int* numBlocksInProc,
int* blockMetaData,
int myProc,
int numProcs);
390 vtkMaterialInterfaceFilterIterator* neighbor1, vtkMaterialInterfaceFilterIterator* neighbor2);
392 void PrepareForResolveEquivalences();
394 void ResolveEquivalences();
395 void GatherEquivalenceSets(vtkMaterialInterfaceEquivalenceSet*
set);
396 void ShareGhostEquivalences(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffsets);
397 void ReceiveGhostFragmentIds(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffset);
398 void MergeGhostEquivalenceSets(vtkMaterialInterfaceEquivalenceSet* globalSet);
402 int ResolveIntegratedAttributes(
const int controllingProcId);
404 int PrepareToResolveIntegratedAttributes();
407 int SendIntegratedAttributes(
const int recipientProcId);
409 int ReceiveIntegratedAttributes(
const int sourceProcId);
411 int PrepareToCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
412 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
413 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
414 std::vector<std::vector<vtkDoubleArray*> >& volumeWtdAvgs,
415 std::vector<std::vector<vtkDoubleArray*> >& massWtdAvgs,
416 std::vector<std::vector<vtkDoubleArray*> >& sums);
418 int CleanUpAfterCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
419 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
420 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
421 std::vector<std::vector<vtkDoubleArray*> >& volumeWtdAvgs,
422 std::vector<std::vector<vtkDoubleArray*> >& massWtdAvgs,
423 std::vector<std::vector<vtkDoubleArray*> >& sums);
426 int CollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
427 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
428 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
429 std::vector<std::vector<vtkDoubleArray*> >& volumeWtdAvgs,
430 std::vector<std::vector<vtkDoubleArray*> >& massWtdAvgs,
431 std::vector<std::vector<vtkDoubleArray*> >& sums);
433 int BroadcastIntegratedAttributes(
const int sourceProcessId);
435 int SendGeometricAttributes(
const int controllingProcId);
437 int PrepareToCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
438 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
439 std::vector<int*>& ids);
441 int CleanUpAfterCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
442 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
443 std::vector<int*>& ids);
446 int CollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
447 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
448 std::vector<int*>& ids);
450 int PrepareToMergeGeometricAttributes();
452 int GatherGeometricAttributes(
const int recipientProcId);
454 void ResolveLocalFragmentGeometry();
456 void ResolveRemoteFragmentGeometry();
458 void CleanLocalFragmentGeometry();
460 void BuildLoadingArray(std::vector<vtkIdType>& loadingArray);
461 int PackLoadingArray(
vtkIdType*& buffer);
462 int UnPackLoadingArray(
vtkIdType* buffer,
int bufSize, std::vector<vtkIdType>& loadingArray);
466 void CopyAttributesToOutput0();
467 void CopyAttributesToOutput1();
468 void CopyAttributesToOutput2();
470 int WriteGeometryOutputToTextFile();
471 int WriteStatisticsOutputToTextFile();
478 int Accumulate(
double* dest,
483 int AccumulateMoments(
double* moments,
488 void ComputeGeometricAttributes();
489 int ComputeLocalFragmentOBB();
490 int ComputeLocalFragmentAABBCenters();
497 void DeleteAllBlocks();
499 std::string& massArrayName, std::vector<std::string>& volumeWtdAvgArrayNames,
500 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
501 std::vector<std::string>& integratedArrayNames);
502 void AddBlock(vtkMaterialInterfaceFilterBlock* block,
unsigned char levelOfGhostLayer);
505 void CheckLevelsForNeighbors(vtkMaterialInterfaceFilterBlock* block);
507 int FindFaceNeighbors(
unsigned int blockLevel,
int blockIndex[3],
int faceAxis,
int faceMaxFlag,
508 std::vector<vtkMaterialInterfaceFilterBlock*>* result);
515 int HasNeighbor(
unsigned int blockLevel,
int blockIndex[3],
int neighborDirection[3]);
526 vtkSetStringMacro(MaterialFractionArrayName);
648 double GlobalOrigin[3];
649 double RootSpacing[3];
650 int StandardBlockDimensions[3];
652 void SaveBlockSurfaces(
const char* fileName);
653 void SaveGhostSurfaces(
const char* fileName);
657 std::vector<vtkMaterialInterfaceLevel*>
Levels;
665 double FaceCornerPoints[12];
666 double FaceEdgePoints[12];
667 int FaceEdgeFlags[4];
669 void ComputeFacePoints(vtkMaterialInterfaceFilterIterator* in,
670 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
671 void ComputeFaceNeighbors(vtkMaterialInterfaceFilterIterator* in,
672 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
674 long ComputeProximity(
const int faceIdx[3],
int faceLevel,
const int ext[6],
int refLevel);
676 void FindNeighbor(
int faceIndex[3],
int faceLevel, vtkMaterialInterfaceFilterIterator* neighbor,
677 vtkMaterialInterfaceFilterIterator* reference);
695 #ifdef vtkMaterialInterfaceFilterDEBUG 702 double ClipCenter[3];
706 double ClipPlaneVector[3];
707 double ClipPlaneNormal[3];
716 #ifdef vtkMaterialInterfaceFilterPROFILE 721 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