cee::vtfx::Database Class Reference

A VTFx database. The class represents a database of data blocks. More...

Public Types

enum  SimulationType {
  SIMULATION_TYPE_STRUCTURAL = 0, SIMULATION_TYPE_THERMAL = 1, SIMULATION_TYPE_ELECTRIC = 2, SIMULATION_TYPE_MAGNETIC = 3,
  SIMULATION_TYPE_FLUID = 4, SIMULATION_TYPE_ACOUSTIC = 5, SIMULATION_TYPE_DIFFUSION = 6, SIMULATION_TYPE_OTHER = 7
}
 
enum  SolutionType {
  SOLUTION_TYPE_STATIC = 0, SOLUTION_TYPE_STEADY_STATE = 1, SOLUTION_TYPE_VIBRATION = 2, SOLUTION_TYPE_BUCKLING = 3,
  SOLUTION_TYPE_TRANSIENT = 4, SOLUTION_TYPE_SUPERELEMENT = 5, SOLUTION_TYPE_FREQRESPONSE = 6, SOLUTION_TYPE_COMPLEXEIGEN = 7,
  SOLUTION_TYPE_QUASISTATIC = 8, SOLUTION_TYPE_OUTPUT = 9, SOLUTION_TYPE_SINGULAR = 10, SOLUTION_TYPE_OTHER = 11
}
 

Public Member Functions

 Database (File *file, const Str &databaseName, int databaseId, SimulationType simulationType=SIMULATION_TYPE_OTHER, SolutionType solutionType=SOLUTION_TYPE_OTHER, const Str &description="")
 Constructs a new database. More...
 
int id () const
 Returns the database id. More...
 
Str name () const
 Returns the database name. More...
 
bool writeBlock (const Block *block)
 Writes a block to the database. More...
 
size_t blockCount (Block::BlockType blockType) const
 Returns the number of blocks of the given block type. More...
 
PtrRef< BlockblockByIndex (Block::BlockType blockType, size_t blockIndex)
 Returns the block of the given block type with index blockIndex. More...
 
PtrRef< BlockblockById (Block::BlockType blockType, int blockId)
 Returns the block of the given block type and that has the given block id. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::vtfx::Database:
cee::RefCountedObject

Detailed Description

A VTFx database. The class represents a database of data blocks.

The blocks contain data such as node coordinates, finite elements, or result values - see *Block. A database requires a unique id per VTFx file. One (and only one) geometry block and state info block are required for each database.

Constructor & Destructor Documentation

cee::vtfx::Database::Database ( File file,
const Str databaseName,
int  databaseId,
SimulationType  simulationType = SIMULATION_TYPE_OTHER,
SolutionType  solutionType = SOLUTION_TYPE_OTHER,
const Str description = "" 
)

Constructs a new database.

The constructor takes the file instance as a parameter. The File will take ownership of the database and ensure that all belonging databases are written to file.

Specify a database name and a database id. The database id needs to be unique within the file.

Member Function Documentation

PtrRef< Block > cee::vtfx::Database::blockById ( Block::BlockType  blockType,
int  blockId 
)

Returns the block of the given block type and that has the given block id.

PtrRef< Block > cee::vtfx::Database::blockByIndex ( Block::BlockType  blockType,
size_t  blockIndex 
)

Returns the block of the given block type with index blockIndex.

size_t cee::vtfx::Database::blockCount ( Block::BlockType  blockType) const

Returns the number of blocks of the given block type.

int cee::vtfx::Database::id ( ) const

Returns the database id.

Str cee::vtfx::Database::name ( ) const

Returns the database name.

bool cee::vtfx::Database::writeBlock ( const Block block)

Writes a block to the database.

Returns false if there was an error writing the block to the file. Detailed info is available in the log.