More VTF problems, now for multi-patch and/or multi-steps...
git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1209 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
parent
1230b54a8d
commit
ace1672700
@ -386,11 +386,11 @@ int main (int argc, char** argv)
|
||||
if (iop != 10 && format >= 0)
|
||||
{
|
||||
// Write VTF-file with model geometry
|
||||
if (!model->writeGlv(infile,n,format))
|
||||
if (!model->writeGlvG(n,nBlock,infile,format))
|
||||
return 7;
|
||||
|
||||
// Write boundary tractions, if any
|
||||
if (!model->writeGlvT(iStep,++nBlock))
|
||||
if (!model->writeGlvT(iStep,nBlock))
|
||||
return 8;
|
||||
|
||||
// Write Dirichlet boundary conditions
|
||||
|
@ -408,7 +408,7 @@ bool NonLinSIM::saveModel (char* fileName, int format, int* nViz)
|
||||
nBlock = 0; // initialize the result block counter
|
||||
|
||||
// Write VTF-file with model geometry
|
||||
if (!model->writeGlv(fileName,nViz,format))
|
||||
if (!model->writeGlvG(nViz,nBlock,fileName,format))
|
||||
return false;
|
||||
|
||||
// Write Dirichlet boundary conditions
|
||||
|
@ -980,6 +980,8 @@ bool SIMbase::writeGlvG (const int* nViz, int& nBlock,
|
||||
myVtf = new VTF(vtfName,format);
|
||||
delete[] vtfName;
|
||||
}
|
||||
else
|
||||
myVtf->clearGeometryBlocks();
|
||||
|
||||
// Convert and write model geometry
|
||||
char pname[16];
|
||||
|
@ -74,6 +74,10 @@ VTF::~VTF ()
|
||||
{
|
||||
if (!myFile) return;
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < myBlocks.size(); i++)
|
||||
delete myBlocks[i].second;
|
||||
|
||||
#if HAS_VTFAPI == 1
|
||||
if (myGBlock)
|
||||
{
|
||||
@ -81,8 +85,6 @@ VTF::~VTF ()
|
||||
showError("Error writing Geometry Block");
|
||||
delete myGBlock;
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < myDBlock.size(); i++)
|
||||
if (myDBlock[i])
|
||||
{
|
||||
@ -125,7 +127,6 @@ VTF::~VTF ()
|
||||
delete myGBlock;
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < myDBlock.size(); i++)
|
||||
if (myDBlock[i])
|
||||
{
|
||||
@ -181,17 +182,12 @@ VTF::~VTF ()
|
||||
|
||||
void VTF::writeGeometryBlocks (int iStep)
|
||||
{
|
||||
pointGeoID = 0;
|
||||
if (myBlocks.empty())
|
||||
return;
|
||||
|
||||
std::vector<int> geomID(myBlocks.size());
|
||||
for (size_t i = 0; i < myBlocks.size(); i++)
|
||||
{
|
||||
geomID[i] = myBlocks[i].first;
|
||||
delete myBlocks[i].second;
|
||||
}
|
||||
myBlocks.clear();
|
||||
|
||||
#ifdef HAS_VTFAPI
|
||||
if (!myGBlock) myGBlock = new VTFAGeometryBlock();
|
||||
@ -204,6 +200,16 @@ void VTF::writeGeometryBlocks (int iStep)
|
||||
}
|
||||
|
||||
|
||||
void VTF::clearGeometryBlocks ()
|
||||
{
|
||||
for (size_t i = 0; i < myBlocks.size(); i++)
|
||||
delete myBlocks[i].second;
|
||||
|
||||
myBlocks.clear();
|
||||
pointGeoID = 0;
|
||||
}
|
||||
|
||||
|
||||
bool VTF::writeGrid (const ElementBlock* block, const char* partname,
|
||||
int nBlock)
|
||||
{
|
||||
|
@ -147,6 +147,8 @@ public:
|
||||
|
||||
//! \brief Adds the current FE geometry blocks to the description block.
|
||||
void writeGeometryBlocks(int iStep);
|
||||
//! \brief Dropd current FE geometry blocks.
|
||||
void clearGeometryBlocks();
|
||||
|
||||
private:
|
||||
//! \brief Writes a node block to the VTF-file.
|
||||
|
Loading…
Reference in New Issue
Block a user