if(anEntity != VISU::NODE_ENTITY){
VISU::PGaussPtsIDMapper aGaussMesh =
aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
- VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
/*
+ VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
}else{
VISU::PIDMapper anIDMapper =
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
/*
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
int anObjID = anIDMapper->GetElemObjID(anCellId);
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
- VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
{
/*
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
int aNbCells, anCellId, anObjID, aVTKID;
aNbCells = aDataSet->GetNumberOfCells();
for(anCellId = 0; anCellId < aNbCells; anCellId++){
const std::string& theFieldName,
int theStampsNum) = 0;
- //! Get amount of memory to build mesh for corresponding MED TIMESTAMP
+ //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
size_t
- GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum) = 0;
+ GetTimeStampOnMeshSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum) = 0;
+
+ //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
+ virtual
+ size_t
+ GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum) = 0;
//! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
virtual
namespace VISU
{
+ //---------------------------------------------------------------
+ /*! Computes number of points by the given number of cells
+ * in assumption of regular hexahedral mesh structure
+ */
+ size_t
+ GetNumberofPoints(size_t theNbCells)
+ {
+ return size_t(pow(pow(theNbCells, 1.0/3.0) + 1.0, 3.0));
+ }
+
+ //---------------------------------------------------------------
+ /*! Computes size dataset the given number of mesh macro metrics
+ * in assumption of regular hexahedral mesh structure
+ */
+ size_t
+ GetDataSetSize(size_t theNbOfPoints,
+ size_t theNbOfCells,
+ size_t theCellsSize,
+ bool theComputeLinks)
+ {
+ size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
+ size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
+ size_t aLocationsSize = theNbOfCells*sizeof(int);
+ vtkFloatingPointType aNbCellsPerPoint = theCellsSize / theNbOfCells - 1;
+ size_t aLinksSize = theNbOfPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
+ if(!theComputeLinks)
+ aLinksSize = 0;
+ size_t aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
+ return aResult;
+ }
+
//---------------------------------------------------------------
TIsVTKDone::TIsVTKDone():
myIsVTKDone(false),
return GetSource().GetPointer();
}
+ unsigned long int
+ TSource
+ ::GetMemorySize()
+ {
+ if(TVTKOutput* anOutput = GetVTKOutput()){
+ anOutput->Update();
+ return GetVTKOutput()->GetActualMemorySize() * 1024;
+ }
+ if(myIsDone){
+ size_t aNbPoints = GetNumberofPoints(myNbCells);
+ return GetDataSetSize(aNbPoints, myNbCells, myCellsSize, false);
+ }
+ throw std::runtime_error("TSource::GetMemorySize - myIsDone == false !!!");
+ return 0;
+ }
+
+ //---------------------------------------------------------------
+ unsigned long int
+ TMemoryCheckIDMapper
+ ::GetMemorySize()
+ {
+ if(myIsVTKDone){
+ GetVTKOutput()->Update();
+ return GetVTKOutput()->GetActualMemorySize() * 1024;
+ }else
+ throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
+ return 0;
+ }
+
//---------------------------------------------------------------
TAppendFilter::TAppendFilter()
return GetFilter()->GetOutput();
}
-
//---------------------------------------------------------------
TMergeFilter::TMergeFilter()
{}
return GetFilter()->GetUnstructuredGridOutput();
}
-
//---------------------------------------------------------------
TPointCoords
::TPointCoords():
return TCoordSlice(myCoord,std::slice(theNodeId*myDim,myDim,1));
}
+ unsigned long int
+ TPointCoords
+ ::GetMemorySize()
+ {
+ size_t aSize = sizeof(TCoord) * myCoord.size();
+ aSize += myPoints->GetActualMemorySize() * 1024;
+ return aSize;
+ }
+
//---------------------------------------------------------------
void
return theID;
}
+ unsigned long int
+ TSubProfileImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TSource::GetMemorySize();
+ aSize += sizeof(vtkIdType) * mySubMeshID.size();
+ return aSize;
+ }
+
//---------------------------------------------------------------
bool
return anAppendFilter->GetOutput();
}
+ unsigned long int
+ TProfileImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TAppendFilter::GetMemorySize();
+ aSize += myNamedPointCoords->GetMemorySize();
+ aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
+ for(size_t anId = 0; anId < mySubProfileArr.size(); anId++)
+ aSize += mySubProfileArr[anId]->GetMemorySize();
+ return aSize;
+ }
+
std::string
TProfileImpl
::GetNodeName(vtkIdType theObjID) const
return myFilter->GetUnstructuredGridOutput();
}
+ unsigned long int
+ TIDMapperFilter
+ ::GetMemorySize()
+ {
+ size_t aSize = myIDMapper->GetMemorySize();
+ aSize += mySource.GetMemorySize();
+ return aSize;
+ }
+
vtkIdType
TIDMapperFilter
::GetNodeObjID(vtkIdType theID) const
return TGaussPointID(aCellID,aLocalPntID);
}
+ unsigned long int
+ TGaussSubMeshImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TSource::GetMemorySize();
+ aSize += myPointCoords.GetMemorySize();
+ return aSize;
+ }
+
//---------------------------------------------------------------
bool
operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight)
return mySource.GetVTKOutput();
}
+ unsigned long int
+ TGaussMeshImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TAppendFilter::GetMemorySize();
+ aSize += mySource.GetMemorySize();
+ for(size_t anId = 0; anId < myGaussSubMeshArr.size(); anId++)
+ aSize += myGaussSubMeshArr[anId]->GetMemorySize();
+ return aSize;
+ }
+
TNamedIDMapper*
TGaussMeshImpl::
GetParent()
return "";
}
+ unsigned long int
+ TSubMeshImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TSource::GetMemorySize();
+ for(size_t anId = 0; anId < myCell2Connect.size(); anId++){
+ const TConnect& aConnect = myCell2Connect[anId];
+ aSize += aConnect.size() * sizeof(vtkIdType);
+ }
+ return aSize;
+ }
+
//---------------------------------------------------------------
vtkIdType
TMeshOnEntityImpl
return aSubMesh->GetElemName(anInputID);
}
+ unsigned long int
+ TMeshOnEntityImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TAppendFilter::GetMemorySize();
+ aSize += myNamedPointCoords->GetMemorySize();
+ aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
+ for(size_t anId = 0; anId < mySubMeshArr.size(); anId++){
+ const PSubMeshImpl& aSubMesh = mySubMeshArr[anId];
+ aSize += aSubMesh->GetMemorySize();
+ }
+ return aSize;
+ }
+
//---------------------------------------------------------------
vtkIdType
TFamilyImpl
return TSource::GetVTKOutput();
}
+ unsigned long int
+ TFamilyImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TSource::GetMemorySize();
+ aSize += myNamedPointCoords->GetMemorySize();
+ aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
+ aSize += myMeshID.size() * sizeof(vtkIdType);
+ TGeom2SubMeshID::const_iterator anIter = myGeom2SubMeshID.begin();
+ TGeom2SubMeshID::const_iterator anIterEnd = myGeom2SubMeshID.end();
+ for(; anIter != anIterEnd; anIter++){
+ const TSubMeshID& aSubMeshID = anIter->second;
+ aSize += aSubMeshID.size() * sizeof(vtkIdType);
+ aSize += sizeof(EGeometry);
+ }
+ return aSize;
+ }
+
//---------------------------------------------------------------
TNbASizeCells
return myNamedPointCoords->GetVTKID(theID);
}
+ unsigned long int
+ TGroupImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = TAppendFilter::GetMemorySize();
+ aSize += myNamedPointCoords->GetMemorySize();
+ aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
+ for(size_t anId = 0; anId < myFamilyArr.size(); anId++){
+ const PFamilyImpl& aFamily = myFamilyArr[anId];
+ aSize += aFamily->GetMemorySize();
+ }
+ return aSize;
+ }
+
+
//---------------------------------------------------------------
TFieldImpl
return aValueSliceArr;
}
+ unsigned long int
+ TMeshValue
+ ::GetMemorySize() const
+ {
+ size_t aSize = sizeof(TMeshValue);
+ aSize += myValue.size() * sizeof(vtkFloatingPointType);
+ return aSize;
+ }
+
//---------------------------------------------------------------
TValForTimeImpl
return anIter->second;
}
+ unsigned long int
+ TValForTimeImpl
+ ::GetMemorySize()
+ {
+ size_t aSize = sizeof(TValForTimeImpl);
+ TGeom2Value::const_iterator anIter = myGeom2Value.begin();
+ TGeom2Value::const_iterator anIterEnd = myGeom2Value.end();
+ for(; anIter != anIterEnd; anIter++){
+ const TMeshValue& aMeshValue = anIter->second;
+ aSize += aMeshValue.GetMemorySize();
+ aSize += sizeof(EGeometry);
+ }
+ return aSize;
+ }
+
+
//---------------------------------------------------------------
vtkIdType
size_t aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
aLinksSize = 0;
- vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
+ size_t aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
MSG(MYDEBUG,"GetMeshOnEntitySize "<<
"- aResult = "<<vtkFloatingPointType(aResult)<<
BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
}
- aResult = vtkIdType(aResult*ERR_SIZE_CALC);
+ aResult = size_t(aResult*ERR_SIZE_CALC);
return aResult;
}
size_t aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
aLinksSize = 0;
- vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
+ size_t aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
MSG(MYDEBUG,"GetFamilyOnEntitySize "<<
"- aResult = "<<vtkFloatingPointType(aResult)<<
BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
}
- aResult = vtkIdType(aResult*ERR_SIZE_CALC);
+ aResult = size_t(aResult*ERR_SIZE_CALC);
return aResult;
}
size_t aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
aLinksSize = 0;
- vtkIdType aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
+ size_t aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
if(MYDEBUG){
MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<<vtkFloatingPointType(aPointsSize));
MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aConnectivityAndTypesSize = "<<vtkFloatingPointType(aConnectivityAndTypesSize));
MSG(MYDEBUG,"GetMeshOnGroupSize - aResult = "<<vtkFloatingPointType(aResult)<<"; theMeshName = '"
<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
- aResult = vtkIdType(aResult*ERR_SIZE_CALC);
+ aResult = size_t(aResult*ERR_SIZE_CALC);
return aResult;
}
PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindTimeStamp);
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
- size_t aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
+ size_t aMeshSize = GetMeshOnEntitySize(theMeshName, aVTKMeshOnEntity->myEntity);
size_t aTimeStampSize = size_t(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC);
size_t aResult = aMeshSize + aTimeStampSize;
}
+size_t
+VISU_Convertor_impl
+::GetTimeStampOnMeshSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
+{
+ size_t aSize = 0;
+
+ //Cheching possibility do the query
+ TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+ theEntity,
+ theFieldName,
+ theStampsNum);
+
+ PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+ PIDMapperFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
+ if(anIDMapperFilter->myIsVTKDone){
+ VISU::PIDMapper anIDMapper = GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theStampsNum);
+ anIDMapper->GetVTKOutput();
+ aSize += anIDMapper->GetMemorySize();
+ }else
+ aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+
+ cout<<"VISU_Convertor_impl::GetTimeStampOnMeshSize - "<<aSize<<"; "<<(anIDMapperFilter->myIsVTKDone)<<endl;
+ return aSize;
+}
+
+
+size_t
+VISU_Convertor_impl
+::GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
+{
+ size_t aSize = 0;
+
+ //Cheching possibility do the query
+ TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+ theEntity,
+ theFieldName,
+ theStampsNum);
+
+ PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+ PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter;
+ if(aGaussPtsIDFilter->myIsVTKDone){
+ VISU::PGaussPtsIDMapper aGaussPtsIDMapper = GetTimeStampOnGaussPts(theMeshName,
+ theEntity,
+ theFieldName,
+ theStampsNum);
+ aGaussPtsIDMapper->GetVTKOutput();
+ aSize += aGaussPtsIDMapper->GetMemorySize();
+ }else
+ aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+
+ cout<<"VISU_Convertor_impl::GetTimeStampOnGaussPtsSize - "<<aSize<<"; "<<(aGaussPtsIDFilter->myIsVTKDone)<<endl;
+ return aSize;
+}
+
+
const VISU::PField
VISU_Convertor_impl
::GetField(const string& theMeshName,
virtual
TVTKOutput*
GetVTKOutput();
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+ };
+
+
+ //---------------------------------------------------------------
+ //! Define an intermediate class which unifies memory size calculation
+ struct TMemoryCheckIDMapper: public virtual TIsVTKDone,
+ public virtual TIDMapper
+ {
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
/*!
This container allow to combine other VTK representation into single one.
*/
- class TAppendFilter: public virtual TIsVTKDone,
- public virtual TIDMapper
+ class TAppendFilter: public virtual TMemoryCheckIDMapper
{
protected:
mutable TVTKAppendFilter myFilter;
/*!
This container allow to assign data to mesh and represent them into single VTK representation
*/
- class TMergeFilter: public virtual TIsVTKDone,
- public virtual TIDMapper
+ class TMergeFilter: public virtual TMemoryCheckIDMapper
{
protected:
mutable TVTKMergeFilter myFilter;
const TVTKPoints&
GetPoints() const { return myPoints;}
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TPointCoords> PPointCoords;
protected:
typedef TVector<std::string> TPointsDim;
TPointsDim myPointsDim; //!< Keeps name of each dimension
- TVectorID myVectorID; //!< Keeps object¶ numeration
+ TVectorID myVectorID; //!< Keeps object¶ numeration
TObj2VTKID myObj2VTKID; //!< Keeps mapping from object number to VTK one
public:
vtkIdType
GetElemObjID(int theVtkI) const;
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
//! Keeps status of the structure
/*!
In some cases MED file does not use MED PROFILES, but at VISU creates corresponding data strucutre
TVTKOutput*
GetVTKOutput();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
//! Reimplement the TNamedIDMapper::GetNodeName
virtual
std::string
PNamedPointCoords myNamedPointCoords; //!< Keeps reference on the same TNamedPointCoords as TMesh
TMeshOnEntityImpl* myMeshOnEntity; //<! Keeps backward reference to corresponding MED ENTITY mesh
- TSource mySource; //!< Keeps VTK representation of the MED TIMESTAMP mesh
TGeom2SubProfile myGeom2SubProfile; //!< Keeps TSubProfiles according to their geometrical type
};
typedef SharedPtr<TProfileImpl> PProfileImpl;
virtual
TVTKOutput*
GetVTKOutput();
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TIDMapperFilter> PIDMapperFilter;
GetObjID(vtkIdType theID,
vtkIdType theStartID) const;
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
PGaussImpl myGauss; //<! Keep reference to corresponding TGauss structure
//! Keeps status of the structure
TVTKOutput*
GetVTKOutput();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
//! Reimplement the TGaussPtsIDMapper::GetParent
virtual
TNamedIDMapper*
std::string
GetElemName(vtkIdType theObjID) const;
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
vtkIdType myStartID;
TCell2Connect myCell2Connect; //!< Contains connectivity for the cells
};
std::string
GetElemName(vtkIdType theObjID) const;
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
TSubMeshArr mySubMeshArr; //!< Keeps sequence of TSubMeshImpl as they were added into TAppendFilter
PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
TVTKOutput*
GetVTKOutput();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
vtkIdType
GetNodeVTKID(vtkIdType theID) const;
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
TFamilyArr myFamilyArr; //!< Keeps sequence of TFamily as they were added into TAppendFilter
PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
//! To get assigned values first by components and then by Gauss Points
TValueSliceArr
GetCompValueSliceArr(vtkIdType theElemId);
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize() const;
};
virtual
int
GetNbGauss(EGeometry theGeom) const;
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TValForTimeImpl> PValForTimeImpl;
}
const std::string& theFieldName,
int theStampsNum);
- //! Implemention of the VISU_Convertor::GetTimeStampSize
+ //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
- size_t
- GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ size_t
+ GetTimeStampOnMeshSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+
+ //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
+ virtual
+ size_t
+ GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
//! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
virtual
const VISU::TEntity& theEntity);
protected:
+ //! Implemention of the VISU_Convertor::GetTimeStampSize
+ virtual
+ size_t
+ GetTimeStampSize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+
//! To fill intermeiate representation of TMeshOnEntity from a MED source
virtual
int
virtual
TVTKOutput*
GetVTKOutput() = 0;
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize() = 0;
};
typedef SharedPtr<TIDMapper> PIDMapper;
VISU_Actor
::GetMemorySize()
{
+ static vtkFloatingPointType ERR_SIZE_CALC = 1.00;
vtkDataSet* aDataSet = GetMapper()->GetInput();
- unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024;
+ unsigned long int aSize = size_t(aDataSet->GetActualMemorySize() * 1024 * ERR_SIZE_CALC);
aDataSet = myGeomFilter->GetOutput();
aSize += aDataSet->GetActualMemorySize() * 1024;
size_t aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false);
if(theIsMemoryCheck && aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
- size_t aSize = anInput->GetTimeStampSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
}
}
+//----------------------------------------------------------------------------
+CORBA::Float
+VISU::GaussPoints_i
+::GetMemorySize()
+{
+ CORBA::Float aMemorySize = TSuperClass::GetMemorySize();
+
+ // To calculate memory used by VISU Converter
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ CORBA::Float aSize = anInput->GetTimeStampOnGaussPtsSize(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
+ // Convert to mega bytes
+ aMemorySize += aSize / (1024.0 * 1024.0);
+ cout<<"GaussPoints_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
+ cout<<endl;
+ return aMemorySize;
+}
//----------------------------------------------------------------------------
VISU::Storable*
public:
//----------------------------------------------------------------------------
typedef ColoredPrs3d_i TSuperClass;
+ typedef VISU::GaussPoints TInterface;
explicit
GaussPoints_i(EPublishInStudyMode thePublishInStudyModep);
return VISU::TGAUSSPOINTS;
}
- typedef VISU::GaussPoints TInterface;
+ //----------------------------------------------------------------------------
+ //! Gets memory size actually used by the presentation (Mb).
+ virtual
+ CORBA::Float
+ GetMemorySize();
+ //----------------------------------------------------------------------------
int
GetFaceLimit() { return myFaceLimit; }
VISU::Prs3d_i
::GetMemorySize()
{
- // To calculate memory used by VISU Converter
- static int INCMEMORY = 4;
- vtkDataSet* aDataSet = GetPipeLine()->GetInput();
- CORBA::Float aSize = aDataSet->GetActualMemorySize() * INCMEMORY * 1024.0;
- //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; aDataSet = "<<aSize / (1024.0 * 1024.0)<<endl;
-
// To calculate memory used by VISU PipeLine
- aSize += GetPipeLine()->GetMemorySize();
- //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; GetPipeLine = "<<aSize / (1024.0 * 1024.0)<<endl;
+ CORBA::Float aSize = GetPipeLine()->GetMemorySize();
+ cout<<"Prs3d_i::GetMemorySize - "<<this<<"; GetPipeLine = "<<aSize / (1024.0 * 1024.0)<<endl;
// To calculate memory used by VISU Actos
int anEnd = myActorCollection->GetNumberOfItems();
if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject)){
aSize += anActor->GetMemorySize();
- //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
+ cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
}
- //cout<<endl;
// Convert to mega bytes
return aSize / (1024.0 * 1024.0);
}
theFieldName);
if(aField->myNbComp <= 1)
return 0;
- size_t aSize = anInput->GetTimeStampSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
try{
if(theResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
- size_t aSize = anInput->GetTimeStampSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
aSize *= INCMEMORY;
aResult = 1;
if(theIsMemoryCheck){
return this;
}
+//----------------------------------------------------------------------------
+CORBA::Float
+VISU::ScalarMap_i
+::GetMemorySize()
+{
+ CORBA::Float aMemorySize = TSuperClass::GetMemorySize();
+
+ // To calculate memory used by VISU Converter
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ CORBA::Float aSize = anInput->GetTimeStampOnMeshSize(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
+ // Convert to mega bytes
+ aMemorySize += aSize / (1024.0 * 1024.0);
+ cout<<"ScalarMap_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
+ cout<<endl;
+ return aMemorySize;
+}
+
//----------------------------------------------------------------------------
VISU::Storable*
VISU::ScalarMap_i
public:
//----------------------------------------------------------------------------
typedef ColoredPrs3d_i TSuperClass;
+ typedef VISU::ScalarMap TInterface;
explicit
ScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
return VISU::TSCALARMAP;
}
+ //----------------------------------------------------------------------------
+ //! Gets memory size actually used by the presentation (Mb).
+ virtual
+ CORBA::Float
+ GetMemorySize();
+
+ //----------------------------------------------------------------------------
virtual
VISU::Scaling
GetScaling();
virtual
void
SetSourceRange();
-
// To provide backward compatibility
virtual
VISU::ScalarMap::Orientation
GetBarOrientation();
- typedef VISU::ScalarMap TInterface;
-
protected:
//! Redefines VISU_ColoredPrs3d_i::DoSetInput
virtual
false);
if(theIsMemoryCheck && aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
- size_t aSize = anInput->GetTimeStampSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)