vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
- if(GetNumberOfInputConnections(0) > 1)
+ if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector,
this->GetNumberOfInputConnections(0),
theOutputVector,
if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
vtkIdType aNbCells = aDataSet->GetNumberOfCells();
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
- aDataArray->SetValue(aTupleId++, anInputId);
aDataArray->SetValue(aTupleId++, aCellId);
+ aDataArray->SetValue(aTupleId++, anInputId);
}
}
}
vtkInformationVector **theInputVector,
vtkInformationVector *theOutputVector)
{
- bool anIsExecuted = VISU::PolyDataRequestData(theInputVector,
- this->GetNumberOfInputConnections(0),
- theOutputVector,
- GetSharedPointSet(),
- IsMergingInputs(),
- IsMappingInputs());
+ bool anIsExecuted = false;
+ if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
+ anIsExecuted = VISU::PolyDataRequestData(theInputVector,
+ this->GetNumberOfInputConnections(0),
+ theOutputVector,
+ GetSharedPointSet(),
+ IsMergingInputs(),
+ IsMappingInputs());
if(!anIsExecuted)
anIsExecuted = Superclass::RequestData(theRequest,
theInputVector,
GetObjID(vtkDataSet *theDataSet, vtkIdType theID)
{
theDataSet->Update();
- vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData();
- if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_GAUSS_MAPPER")){
+ vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
+ if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
vtkIdType anID = 2 * theID;
TCellID aCellID = anIntArray->GetValue(anID);
GetInputCellID(vtkDataSet *theDataSet, vtkIdType theObjID)
{
theDataSet->Update();
- vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData();
+ vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_INPUTS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID);
vtkIdType aTupleID = 2 * aVTKID;
- TInputID anInputID = anIntArray->GetValue(aTupleID);
- TCellID aCellID = anIntArray->GetValue(aTupleID + 1);
+ TCellID aCellID = anIntArray->GetValue(aTupleID);
+ TInputID anInputID = anIntArray->GetValue(aTupleID + 1);
return TInputCellID(anInputID, aCellID);
}
}
//---------------------------------------------------------------
void
- GetSource(const VISU::PPolyData& theSource,
- const VISU::PGaussSubMeshImpl& theGaussSubMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity)
+ GetGaussSubMeshSource(const VISU::PPolyData& theSource,
+ const VISU::PGaussSubMeshImpl& theGaussSubMesh,
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity)
{
vtkCellArray* aConnectivity = vtkCellArray::New();
vtkIdType aCellsSize = theGaussSubMesh->myCellsSize;
aSource->SetVerts(aConnectivity);
aConnectivity->Delete();
+
+ {
+ vtkIdType aNbTuples = aNbPoints;
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_POINTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbTuples);
+ int *aDataArrayPtr = aDataArray->GetPointer(0);
+ for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+ vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId);
+ *aDataArrayPtr++ = aGlobalID;
+ *aDataArrayPtr++ = 0;
+ }
+ aSource->GetPointData()->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
+
+ {
+ vtkIdType aNbTuples = aNbPoints;
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_CELLS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbTuples);
+ int *aDataArrayPtr = aDataArray->GetPointer(0);
+ for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+ VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId);
+ *aDataArrayPtr++ = aGaussPointID.first;
+ *aDataArrayPtr++ = aGaussPointID.second;
+ }
+ aSource->GetCellData()->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
}
INITMSG(MYDEBUG,"GetGaussSubMesh - aVGeom = "<<aGauss->myGeom<<endl);
const VISU::PPolyData& aSource = theGaussSubMesh->GetSource();
- GetSource(aSource, theGaussSubMesh, theMeshOnEntity);
+ GetGaussSubMeshSource(aSource, theGaussSubMesh, theMeshOnEntity);
INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
const VISU::PAppendPolyData& anAppendFilter = theGaussMesh->GetFilter();
const VISU::TGeom2GaussSubMesh& aGeom2GaussSubMesh = theGaussMesh->myGeom2GaussSubMesh;
VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
- for(; anIter != aGeom2GaussSubMesh.end(); anIter++){
+ for(vtkIdType aStartID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){
VISU::PGaussSubMeshImpl aGaussSubMesh = anIter->second;
if(aGaussSubMesh->myStatus == VISU::eRemoveAll)
continue;
-
+
+ aGaussSubMesh->myStartID = aStartID;
+
GetGaussSubMesh(theMesh,
theMeshOnEntity,
theGaussMesh,
aGaussSubMesh);
const VISU::PPolyData& aSource = aGaussSubMesh->GetSource();
-
+ aStartID += aSource->GetNumberOfCells();
+
anAppendFilter->AddInput(aSource.GetPointer());
}
anAppendFilter->Update(); // Fix on VTK
if(MYDEBUGWITHFILES){
std::string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-Conv.vtk";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk";
VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
std::string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
std::string aFamilyName = QString(theFamilyName.c_str()).simplifyWhiteSpace().latin1();
std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-Conv.vtk";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk";
VISU::WriteToFile(aSource.GetPointer(),aFileName);
}
std::string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
std::string aGroupName = QString(theGroupName.c_str()).simplifyWhiteSpace().latin1();
std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + "-" + aGroupName + "-Conv.vtk";
+ aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk";
VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
}
std::string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1();
std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d", theStampsNum) + "-Conv.vtk";
+ aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk";
VISU::WriteToFile(anOutput,aFileName);
}
if(MYVTKDEBUG){
std::string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1();
std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d",theStampsNum) + "-Conv.vtk";
+ aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk";
VISU::WriteToFile(anOutput, aFileName);
}
if(MYVTKDEBUG){
//---------------------------------------------------------------
TGaussPointID
TMEDGaussSubMesh
- ::GetObjID(vtkIdType theID,
- vtkIdType theStartID) const
+ ::GetObjID(vtkIdType theID) const
{
TCellID aCellID = theID / myGauss->myNbPoints;
TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
if(myIsElemNum)
aCellID = (*myElemNum)[aCellID];
else
- aCellID += theStartID;
+ aCellID += myStartID;
return TGaussPointID(aCellID, aLocalPntID);
}
virtual
TGaussPointID
- GetObjID(vtkIdType theID,
- vtkIdType theStartID) const;
+ GetObjID(vtkIdType theID) const;
//! Gets memory size used by the instance (bytes).
virtual
return myCoord->GetCoordSlice(theNodeId);
}
+ vtkIdType
+ TPointCoords
+ ::GetObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+ vtkIdType
+ TPointCoords
+ ::GetVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
void
TPointCoords
::SetVoidArray() const
return myPointsDim[theDim];
}
- vtkIdType
- TNamedPointCoords
- ::GetObjID(vtkIdType theID) const
- {
- return theID;
- }
-
- vtkIdType
- TNamedPointCoords
- ::GetVTKID(vtkIdType theID) const
- {
- return theID;
- }
-
std::string
TNamedPointCoords
::GetNodeName(vtkIdType theObjID) const
TCoordSlice
GetCoordSlice(vtkIdType theNodeId);
+ //! Get object number for node by its VTK one
+ virtual
+ vtkIdType
+ GetObjID(vtkIdType theID) const;
+
+ //! Get VTK number for node by its object one
+ virtual
+ vtkIdType
+ GetVTKID(vtkIdType theID) const;
+
protected:
//! An container for coordinates of the nodes
/*!
const std::string&
GetName(vtkIdType theDim) const;
- //! Get object number for node by its VTK one
- virtual
- vtkIdType
- GetObjID(vtkIdType theID) const;
-
- //! Get VTK number for node by its object one
- virtual
- vtkIdType
- GetVTKID(vtkIdType theID) const;
-
//! Get name of node by its object number
virtual
std::string
TGaussSubMeshImpl
::TGaussSubMeshImpl():
myPointCoords(new TPointCoords()),
- myStatus(eNone)
+ myStatus(eNone),
+ myStartID(0)
{}
TGaussPointID
TGaussSubMeshImpl
- ::GetObjID(vtkIdType theID,
- vtkIdType theStartID) const
+ ::GetObjID(vtkIdType theID) const
{
- TCellID aCellID = theStartID + theID / myGauss->myNbPoints;
+ TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
- return TGaussPointID(aCellID,aLocalPntID);
+ return TGaussPointID(aCellID, aLocalPntID);
+ }
+
+ vtkIdType
+ TGaussSubMeshImpl
+ ::GetGlobalID(vtkIdType theID) const
+ {
+ return myStartID + theID;
}
unsigned long int
//---------------------------------------------------------------
+ TSubMeshImpl
+ ::TSubMeshImpl():
+ myStartID(0)
+ {}
+
vtkIdType
TSubMeshImpl
::GetElemObjID(vtkIdType theID) const
}
//---------------------------------------------------------------
+ TMeshOnEntityImpl
+ ::TMeshOnEntityImpl()
+ {
+ const PAppendFilter& anAppendFilter = GetFilter();
+ anAppendFilter->SetMappingInputs(true);
+ }
+
vtkIdType
TMeshOnEntityImpl
::GetNodeVTKID(vtkIdType theID) const
//! To implement the TGaussPtsIDMapper::GetObjID
virtual
TGaussPointID
- GetObjID(vtkIdType theID,
- vtkIdType theStartID) const;
+ GetObjID(vtkIdType theID) const;
+
+ virtual
+ vtkIdType
+ GetGlobalID(vtkIdType theID) const;
//! Gets memory size used by the instance (bytes).
virtual
*/
ESubMeshStatus myStatus;
+ vtkIdType myStartID;
PPointCoords myPointCoords; //!< Keeps coordinates of Gauss Points
};
//! The class is responsible for mapping of cells of defined geometrical type
struct TSubMeshImpl: virtual TUnstructuredGridHolder
{
+ TSubMeshImpl();
+
//! To implement the TIDMapper::GetElemObjID
virtual
vtkIdType
virtual TAppendFilterHolder,
virtual TSizeCounter
{
+ TMeshOnEntityImpl();
+
//! Reimplement the TIDMapper::GetNodeVTKID
virtual
vtkIdType