24 #ifndef vtkMaterialInterfaceFilter_h 25 #define vtkMaterialInterfaceFilter_h 50 class vtkMaterialInterfaceLevel;
51 class vtkMaterialInterfaceFilterBlock;
52 class vtkMaterialInterfaceFilterIterator;
53 class vtkMaterialInterfaceEquivalenceSet;
54 class vtkMaterialInterfaceFilterRingBuffer;
72 void SelectMaterialArray(
const char* name);
76 void UnselectMaterialArray(
const char* name);
80 void UnselectAllMaterialArrays();
84 void SetMaterialArrayStatus(
const char* name,
int status);
89 int GetMaterialArrayStatus(
const char* name);
90 int GetMaterialArrayStatus(
int index);
95 int GetNumberOfMaterialArrays();
99 const char* GetMaterialArrayName(
int index);
105 void SelectMassArray(
const char* name);
109 void UnselectMassArray(
const char* name);
113 void UnselectAllMassArrays();
117 void SetMassArrayStatus(
const char* name,
int status);
122 int GetMassArrayStatus(
const char* name);
123 int GetMassArrayStatus(
int index);
128 int GetNumberOfMassArrays();
132 const char* GetMassArrayName(
int index);
138 void SelectVolumeWtdAvgArray(
const char* name);
142 void UnselectVolumeWtdAvgArray(
const char* name);
146 void UnselectAllVolumeWtdAvgArrays();
151 void SetVolumeWtdAvgArrayStatus(
const char* name,
int status);
156 int GetVolumeWtdAvgArrayStatus(
const char* name);
157 int GetVolumeWtdAvgArrayStatus(
int index);
162 int GetNumberOfVolumeWtdAvgArrays();
166 const char* GetVolumeWtdAvgArrayName(
int index);
172 void SelectMassWtdAvgArray(
const char* name);
176 void UnselectMassWtdAvgArray(
const char* name);
180 void UnselectAllMassWtdAvgArrays();
185 void SetMassWtdAvgArrayStatus(
const char* name,
int status);
190 int GetMassWtdAvgArrayStatus(
const char* name);
191 int GetMassWtdAvgArrayStatus(
int index);
196 int GetNumberOfMassWtdAvgArrays();
200 const char* GetMassWtdAvgArrayName(
int index);
206 void SelectSummationArray(
const char* name);
210 void UnselectSummationArray(
const char* name);
214 void UnselectAllSummationArrays();
218 void SetSummationArrayStatus(
const char* name,
int status);
223 int GetSummationArrayStatus(
const char* name);
224 int GetSummationArrayStatus(
int index);
229 int GetNumberOfSummationArrays();
233 const char* GetSummationArrayName(
int index);
240 void SetMaterialFractionThreshold(
double fraction);
241 vtkGetMacro(MaterialFractionThreshold,
double);
249 vtkSetMacro(ComputeOBB,
bool);
250 vtkGetMacro(ComputeOBB,
bool);
265 void SetUpperLoadingBound(
int nPolys);
266 vtkGetMacro(UpperLoadingBound,
int);
274 vtkSetStringMacro(OutputBaseName);
275 vtkGetStringMacro(OutputBaseName);
281 vtkSetMacro(WriteGeometryOutput,
bool);
282 vtkGetMacro(WriteGeometryOutput,
bool);
283 vtkSetMacro(WriteStatisticsOutput,
bool);
284 vtkGetMacro(WriteStatisticsOutput,
bool);
293 vtkSetMacro(BlockGhostLevel,
unsigned char);
294 vtkGetMacro(BlockGhostLevel,
unsigned char);
300 static void SelectionModifiedCallback(
vtkObject*,
unsigned long,
void* clientdata,
void*);
315 vtkSetMacro(InvertVolumeFraction,
int);
316 vtkGetMacro(InvertVolumeFraction,
int);
335 std::vector<std::string>& volumeWtdAvgArrayNames,
336 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
337 std::vector<std::string>& integratedArrayNames);
341 int ProcessBlock(
int blockId);
344 void ConnectFragment(vtkMaterialInterfaceFilterRingBuffer* iterator);
345 void GetNeighborIterator(vtkMaterialInterfaceFilterIterator* next,
346 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
347 int axis2,
int maxFlag2);
348 void GetNeighborIteratorPad(vtkMaterialInterfaceFilterIterator* next,
349 vtkMaterialInterfaceFilterIterator* iterator,
int axis0,
int maxFlag0,
int axis1,
int maxFlag1,
350 int axis2,
int maxFlag2);
351 void CreateFace(vtkMaterialInterfaceFilterIterator* in, vtkMaterialInterfaceFilterIterator* out,
352 int axis,
int outMaxFlag);
353 int ComputeDisplacementFactors(vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
354 double displacmentFactors[3],
int rootNeighborIdx,
int faceAxis);
355 int SubVoxelPositionCorner(
double* point,
356 vtkMaterialInterfaceFilterIterator* pointNeighborIterators[8],
int rootNeighborIdx,
358 void FindPointNeighbors(vtkMaterialInterfaceFilterIterator* iteratorMin0,
359 vtkMaterialInterfaceFilterIterator* iteratorMax0,
int axis0,
int maxFlag1,
int maxFlag2,
360 vtkMaterialInterfaceFilterIterator pointNeighborIterators[8],
double pt[3]);
368 void ShareGhostBlocks();
369 void HandleGhostBlockRequests();
370 int ComputeRequiredGhostExtent(
int level,
int inExt[6],
int outExt[6]);
372 void ComputeAndDistributeGhostBlocks(
373 int* numBlocksInProc,
int* blockMetaData,
int myProc,
int numProcs);
379 vtkMaterialInterfaceFilterIterator* neighbor1, vtkMaterialInterfaceFilterIterator* neighbor2);
381 void PrepareForResolveEquivalences();
383 void ResolveEquivalences();
384 void GatherEquivalenceSets(vtkMaterialInterfaceEquivalenceSet*
set);
385 void ShareGhostEquivalences(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffsets);
386 void ReceiveGhostFragmentIds(vtkMaterialInterfaceEquivalenceSet* globalSet,
int* procOffset);
387 void MergeGhostEquivalenceSets(vtkMaterialInterfaceEquivalenceSet* globalSet);
391 int ResolveIntegratedAttributes(
int controllingProcId);
393 int PrepareToResolveIntegratedAttributes();
396 int SendIntegratedAttributes(
int recipientProcId);
398 int ReceiveIntegratedAttributes(
int sourceProcId);
400 int PrepareToCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
401 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
402 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
403 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
404 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
405 std::vector<std::vector<vtkDoubleArray*>>& sums);
407 int CleanUpAfterCollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
408 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
409 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
410 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
411 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
412 std::vector<std::vector<vtkDoubleArray*>>& sums);
415 int CollectIntegratedAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
416 std::vector<vtkDoubleArray*>& volumes, std::vector<vtkDoubleArray*>& clipDepthMaxs,
417 std::vector<vtkDoubleArray*>& clipDepthMins, std::vector<vtkDoubleArray*>& moments,
418 std::vector<std::vector<vtkDoubleArray*>>& volumeWtdAvgs,
419 std::vector<std::vector<vtkDoubleArray*>>& massWtdAvgs,
420 std::vector<std::vector<vtkDoubleArray*>>& sums);
422 int BroadcastIntegratedAttributes(
int sourceProcessId);
424 int SendGeometricAttributes(
int controllingProcId);
426 int PrepareToCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
427 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
428 std::vector<int*>& ids);
430 int CleanUpAfterCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
431 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
432 std::vector<int*>& ids);
435 int CollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
436 std::vector<vtkDoubleArray*>& coaabb, std::vector<vtkDoubleArray*>& obb,
437 std::vector<int*>& ids);
439 int PrepareToMergeGeometricAttributes();
441 int GatherGeometricAttributes(
int recipientProcId);
443 void ResolveLocalFragmentGeometry();
445 void ResolveRemoteFragmentGeometry();
447 void CleanLocalFragmentGeometry();
449 void BuildLoadingArray(std::vector<vtkIdType>& loadingArray);
450 int PackLoadingArray(
vtkIdType*& buffer);
451 int UnPackLoadingArray(
vtkIdType* buffer,
int bufSize, std::vector<vtkIdType>& loadingArray);
455 void CopyAttributesToOutput0();
456 void CopyAttributesToOutput1();
457 void CopyAttributesToOutput2();
459 int WriteGeometryOutputToTextFile();
460 int WriteStatisticsOutputToTextFile();
467 int Accumulate(
double* dest,
472 int AccumulateMoments(
double* moments,
477 void ComputeGeometricAttributes();
478 int ComputeLocalFragmentOBB();
479 int ComputeLocalFragmentAABBCenters();
486 void DeleteAllBlocks();
488 std::string& massArrayName, std::vector<std::string>& volumeWtdAvgArrayNames,
489 std::vector<std::string>& massWtdAvgArrayNames, std::vector<std::string>& summedArrayNames,
490 std::vector<std::string>& integratedArrayNames);
491 void AddBlock(vtkMaterialInterfaceFilterBlock* block,
unsigned char levelOfGhostLayer);
494 void CheckLevelsForNeighbors(vtkMaterialInterfaceFilterBlock* block);
496 int FindFaceNeighbors(
unsigned int blockLevel,
int blockIndex[3],
int faceAxis,
int faceMaxFlag,
497 std::vector<vtkMaterialInterfaceFilterBlock*>* result);
504 int HasNeighbor(
unsigned int blockLevel,
int blockIndex[3],
int neighborDirection[3]);
515 vtkSetStringMacro(MaterialFractionArrayName);
637 double GlobalOrigin[3];
638 double RootSpacing[3];
639 int StandardBlockDimensions[3];
641 void SaveBlockSurfaces(
const char* fileName);
642 void SaveGhostSurfaces(
const char* fileName);
646 std::vector<vtkMaterialInterfaceLevel*>
Levels;
654 double FaceCornerPoints[12];
655 double FaceEdgePoints[12];
656 int FaceEdgeFlags[4];
658 void ComputeFacePoints(vtkMaterialInterfaceFilterIterator* in,
659 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
660 void ComputeFaceNeighbors(vtkMaterialInterfaceFilterIterator* in,
661 vtkMaterialInterfaceFilterIterator* out,
int axis,
int outMaxFlag);
663 long ComputeProximity(
const int faceIdx[3],
int faceLevel,
const int ext[6],
int refLevel);
665 void FindNeighbor(
int faceIndex[3],
int faceLevel, vtkMaterialInterfaceFilterIterator* neighbor,
666 vtkMaterialInterfaceFilterIterator* reference);
684 #ifdef vtkMaterialInterfaceFilterDEBUG 691 double ClipCenter[3];
695 double ClipPlaneVector[3];
696 double ClipPlaneNormal[3];
705 #ifdef vtkMaterialInterfaceFilterPROFILE 710 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