*vdm_LManBegin - create an instance of a LMan object vdm_LManEnd - destroy an instance of a LMan object vdm_LManError - return LMan object error flag
vdm_LManExport - write ASCII representation of library vdm_LManGetObject - get pointer to attribute objects vdm_LManImport - read ASCII representation of library vdm_LManList - print the contents of a dataset vdm_LManLoadModel - load a VisTools Model object vdm_LManSaveModel - save a VisTools Model object vdm_LManLoadState - load a VisTools State object vdm_LManLoadIdTranState - load a VisTools State object subset vdm_LManSaveState - save a VisTools State object vdm_LManLoadHistory - load a VisTools History object vdm_LManSaveHistory - lave a VisTools History object vdm_LManLoadRedMat - load a VisTools RedMat object vdm_LManSaveRedMat - save a VisTools RedMat object vdm_LManSetObject - set pointers to attribute objects vdm_LManSetParami - set integer parameters vdm_LManTOC - print a library table of contents
The functions vdm_LManList and vdm_LManTOC may be used to print the contents of a dataset or print the table of contents of a library respectively. Currently the printing is to standard output.
An ASCII representation of the contents of a library may be exported using vdm_LManExport. This ASCII representation may then be imported using vdm_LManImport. Any library may be exported, however only native libraries may be used for import.
The LMan module also supports loading and saving the contents of VisTools objects. Two VisTools modules are supported, Model and State. The load function reads information from a library and enters it into the VisTools object. The save function extracts information from a VisTools object and writes it to a library. Use vdm_LManLoadModel and vdm_LManSaveModel to load and store Model objects. Use vdm_LManLoadState and vdm_LManSaveState to load and store State objects. Use vdm_LManLoadIdTranState to load a State object with a subset of entities. The following file types are supported for Model saving only.
SYS_ABAQUS_INPUT SYS_ANSYS_INPUT SYS_FLUENT_MESH SYS_NASTRAN_BULKDATA
The following file types are supported for Model and State saving.
SYS_ABAQUS_FIL SYS_ABAQUS_ODB SYS_CGNS SYS_ENSIGHT SYS_NATIVE SYS_NATIVE_HDF5 SYS_NASTRAN_OUTPUT2 SYS_PATRAN_NEUTRAL SYS_SDRC_UNIVERSAL SYS_TECPLOT
Use vdm_LManLoadRedMat and vdm_LManSaveRedMat to load and store RedMat objects. Currently, only SYS_NATIVE and SYS_NATIVE_HDF5 file types are supported for RedMat saving. Use vdm_LManLoadHistory and vdm_LManSaveHistory to load and store History objects.
The following code fragment illustrates the basic framework of using the LMan module to load model information into a Model object. It also illustrates a useful convention for using the file name extension to associate a file format. For example, .fil indicates an ABAQUS results file, .bdf indicates a NASTRAN input bulk data file, .op2 indicates a NASTRAN OUTPUT2 results file, etc.
/* file name and type */ Vchar file[256]; Vint filetype; /* VdmTools objects */ /* Interface objects */ vdm_NASFil *nasfil; vdm_NASLib *naslib; vdm_ANSLib *anslib; vdm_ABAFil *abafil; vdm_ABALib *abalib; vdm_SDRCLib *sdrclib; vdm_STLFil *stlfil; vdm_NatLib *natlib; /* Abstract interface and Library Manager */ vdm_DataFun *datafun; vdm_LMan *lman; /* VisTools Model object */ vis_Model *model; /* file name */ strcpy(file,"my_nastran_results.op2"); /* instance abstract DataFun interface object */ datafun = vdm_DataFunBegin (); /* determine file type from file extension */ /* establish abstract DataFun interface */ if(strstr(file,".bdf") != NULL || strstr(file,".dat") != NULL) { filetype = VDM_NASTRAN_BULKDATA; nasfil = vdm_NASFilBegin(); vdm_NASFilDataFun (nasfil,datafun); } else if(strstr(file,".op2") != NULL) { filetype = VDM_NASTRAN_OUTPUT2; naslib = vdm_NASLibBegin(); vdm_NASLibDataFun (naslib,datafun); } else if(strstr(file,".rst") != NULL) { filetype = VDM_ANSYS_RESULT; anslib = vdm_ANSLibBegin(); vdm_ANSLibDataFun (anslib,datafun); } else if(strstr(file,".inp") != NULL) { filetype = VDM_ABAQUS_INPUT; abafil = vdm_ABAFilBegin(); vdm_ABAFilDataFun (abafil,datafun); } else if(strstr(file,".fil") != NULL) { filetype = VDM_ABAQUS_FIL; abalib = vdm_ABALibBegin(); vdm_ABALibDataFun (abalib,datafun); } else if(strstr(file,".odb") != NULL) { filetype = VDM_ABAQUS_ODB; abalib = vdm_ABALibBegin(); vdm_ABALibDataFun (abalib,datafun); } else if(strstr(file,".unv") != NULL || strstr(file,".bun") != NULL) { filetype = VDM_SDRC_UNIVERSAL; sdrclib = vdm_SDRCLibBegin(); vdm_SDRCLibDataFun (sdrclib,datafun); } else if(strstr(file,".stl") != NULL) { filetype = VDM_STL; stlfil = vdm_STLFilBegin(); vdm_STLFilDataFun (stlfil,datafun); } else if(strstr(file,".STL") != NULL) { filetype = VDM_STLBIN; stlfil = vdm_STLFilBegin(); vdm_STLFilDataFun (stlfil,datafun); } else if(strstr(file,".vdm") != NULL) { filetype = VDM_NATIVE; natlib = vdm_NatLibBegin(); vdm_NatLibDataFun (natlib,datafun); } else { fprintf(stderr,"Error: Bad input file %s\n",file); exit(0); } /* open file */ vdm_DataFunSetConvention (datafun,VDM_CONVENTION_DOUBLE); vdm_DataFunOpen (datafun,"EXT",file,filetype); if(vdm_DataFunError(datafun)) { fprintf(stderr,"Error: Unable to open input data file\n"); exit(0); } /* create LMan object */ lman = vdm_LManBegin (); vdm_LManSetObject (lman,VDM_DATAFUN,datafun); /* load model */ model = vis_ModelBegin (); vdm_LManLoadModel (lman,model); if(vdm_LManError(lman)) { fprintf(stderr,"Error: Unable to load model information\n"); exit(0); } /* close library device and delete interface */ vdm_DataFunClose (datafun); vdm_DataFunEnd (datafun); if(filetype == VDM_NASTRAN_BULKDATA) { vdm_NASFilEnd (nasfil); } else if(filetype == VDM_NASTRAN_OUTPUT2) { vdm_NASLibEnd (naslib); } else if(filetype == VDM_ANSYS_RESULT) { vdm_ANSLibEnd (anslib); } else if(filetype == VDM_ABAQUS_INPUT) { vdm_ABAFilEnd (abafil); } else if(filetype == VDM_ABAQUS_FIL) { vdm_ABALibEnd (abalib); } else if(filetype == VDM_ABAQUS_ODB) { vdm_ABALibEnd (abalib); } else if(filetype == VDM_SDRC_UNIVERSAL) { vdm_SDRCLibEnd (sdrclib); } else if(filetype == VDM_STL || filetype == VDM_STLBIN) { vdm_STLFilEnd (stlfil); } else if(filetype == VDM_NATIVE) { vdm_NatLibEnd (natlib); } /* delete LMan object */ vdm_LManEnd (lman); /* access Model object */ ... /* delete Model object contents */ vis_ModelDelete (model); /* delete Model object */ vis_ModelEnd (model);Table of Contents
*vdm_LManBegin - create an instance of a LMan object
vdm_LMan *vdm_LManBegin ()
None
Destroy an instance of a LMan object using
void vdm_LManEnd (vdm_LMan *lman)
Return the current value of a LMan object error flag using
Vint vdm_LManError (vdm_LMan *lman)
vdm_LManExport - write ASCII representation of library
void vdm_LManExport (vdm_LMan *lman, Vchar *name, Vchar *path)
lman Pointer to LMan object. name Dataset name to export path File path
None
vdm_LManImport - read ASCII representation of library
void vdm_LManImport(vdm_LMan *lman, Vchar *path)
lman Pointer to LMan object. path File path
None
vdm_LManList - print the contents of a dataset
void vdm_LManList (vdm_LMan *lman, Vchar *name)
lman Pointer to LMan object. name Dataset name to list
None
vdm_LManTOC - print a library table of contents
void vdm_LManTOC (vdm_LMan *lman, Vchar *name)
lman Pointer to LMan object. name Dataset names to include in table of contents
None
vdm_LManLoadModel - load a VisTools Model object
void vdm_LManLoadModel (vdm_LMan *lman, vis_Model *model)
lman Pointer to LMan object. model Pointer to Model object.
None
vdm_LManSaveModel - save a VisTools Model object
void vdm_LManSaveModel (vdm_LMan *lman, vis_Model *model)
lman Pointer to LMan object. model Pointer to Model object.
None
The following file types are supported for Model saving.
SYS_ABAQUS_INPUT SYS_ABAQUS_FIL SYS_ABAQUS_ODB SYS_ANSYS_INPUT SYS_CGNS SYS_ENSIGHT SYS_FLUENT_MESH SYS_MECHANICA_FNF SYS_NATIVE SYS_NATIVE_HDF5 SYS_NASTRAN_BULKDATA SYS_NASTRAN_OUTPUT2 SYS_OBJ SYS_PATRAN_NEUTRAL SYS_SDRC_UNIVERSAL SYS_STL SYS_STLBIN SYS_TECPLOT
vdm_LManLoadState - load a VisTools State object
void vdm_LManLoadState (vdm_LMan *lman, vis_State *state, vis_RProp *rprop)
lman Pointer to LMan object. state Pointer to State object. rprop Pointer to RProp object.
None
If element node results data are to be loaded into State, a GridFun object must have been set using vis_StateSetObject. The State object will have the proper number of entities, parent and child entity types and data type set. Use vis_StateInq to query this information. The State object will also have the proper local or global system type set. Use vis_StateGetSystem to query the system type. If the State object contains strain results interpreted as engineering strain then the strain type will be flagged. Use vis_StateGetEngineeringStrain to query the strain type.
When loading data into State it is possible to specify the precision of the State object and the use of the "corner" node option for element node data. Set these options using vdm_LManSetParami.
vdm_LManLoadIdTranState - load a VisTools State object subset
void vdm_LManLoadIdTranState (vdm_LMan *lman, vis_IdTran *idtran, vis_State *state, vis_RProp *rprop)
lman Pointer to LMan object. idtran Pointer to IdTran object. state Pointer to State object. rprop Pointer to RProp object.
None
vdm_LManSaveState - save a VisTools State object
void vdm_LManSaveState (vdm_LMan *lman, vis_State *state, vis_RProp *rprop)
lman Pointer to LMan object. state Pointer to State object. rprop Pointer to RProp object.
None
It is also suggested that the DataType and Contents attributes be defined using vis_RPropSetValuec with RPROP_DATATYPE and RPROP_CONTENTS respectively.
The State object should have the proper local or global system type set using vis_StateSetSystem. If the State object contains strain results interpreted as engineering strain, then this should be flagged using vis_StateSetEngineeringStrain.
The following file types are supported for State saving.
SYS_ABAQUS_FIL SYS_ABAQUS_ODB SYS_CGNS SYS_ENSIGHT SYS_NATIVE SYS_NATIVE_HDF5 SYS_NASTRAN_OUTPUT2 SYS_SDRC_UNIVERSAL SYS_TECPLOT
vdm_LManLoadHistory - load a VisTools History object
void vdm_LManLoadHistory (vdm_LMan *lman, vis_History *history, vis_RProp *rprop)
lman Pointer to LMan object. history Pointer to History object. rprop Pointer to RProp object.
None
The History object will have the proper local or global system type set. Use vis_HistoryGetSystem to query the system type. If the History object contains strain results interpreted as engineering strain then the strain type will be flagged. Use vis_HistoryGetEngineeringStrain to query the strain type.
vdm_LManSaveHistory - save a VisTools History object
void vdm_LManSaveHistory (vdm_LMan *lman, vis_History *history, vis_RProp *rprop)
lman Pointer to LMan object. history Pointer to History object. rprop Pointer to RProp object.
None
It is also suggested that the DataType and Contents attributes be defined using vis_RPropSetValuec with RPROP_DATATYPE and RPROP_CONTENTS respectively.
The History object should have the proper local or global system type set using vis_HistorySetSystem. If the History object contains strain results interpreted as engineering strain, then this should be flagged using vis_HistorySetEngineeringStrain.
The following file types are supported for History saving.
SYS_NATIVE SYS_NATIVE_HDF5
vdm_LManLoadRedMat - load a VisTools RedMat object
void vdm_LManLoadRedMat (vdm_LMan *lman, vis_RedMat *redmat, vis_RProp *rprop)
lman Pointer to LMan object. redmat Pointer to RedMat object. rprop Pointer to RProp object.
None
When loading data into RedMat it is possible to specify the precision of the RedMat object using vis_RedMatPre.
vdm_LManSaveRedMat - save a VisTools RedMat object
void vdm_LManSaveRedMat (vdm_LMan *lman, vis_RedMat *redmat, vis_RProp *rprop)
lman Pointer to LMan object. redmat Pointer to RedMat object. rprop Pointer to RProp object.
None
It is also suggested that the DataType and Contents attributes be defined using vis_RPropSetValuec with RPROP_DATATYPE and RPROP_CONTENTS respectively.
The following file types are supported for RedMat saving.
SYS_NATIVE SYS_NATIVE_HDF5
vdm_LManSetObject - set pointers to attribute objects
void vdm_LManSetObject (vdm_LMan *lman, Vint objecttype, Vobject *object)
lman Pointer to LMan object. objecttype The name of the object type to be set. =VDM_DATAFUN DataFun object object Pointer to the object to be set.
None
Get pointer to attribute objects
void vdm_LManGetObject (vdm_LMan *lman, Vint objecttype, Vobject **object)
vdm_LManSetParami - set integer parameters
void vdm_LManSetParami (vdm_LMan *lman, Vint type, Vint iparam)
lman Pointer to LMan object. type Type of formulation parameter to set =LMAN_VERBOSE Verbose TOC listing =LMAN_FOCUSCONN Convert FOCUS element connectivity =LMAN_NODATAVAL Flag undefined result data =LMAN_LOADMODEL_LOAD Load model loads =LMAN_LOADMODEL_REST Load model restraints =LMAN_LOADMODEL_SET Load model sets =LMAN_LOADMODEL_ELEMGEOM Load model element geometry =LMAN_LOADSTATE_PRE Precision option =LMAN_RETAINCONNECT Retain and reuse Connect iparam Integer parameter value. =SYS_OFF Disable =SYS_ON Enable =SYS_DOUBLE Double precision =SYS_FLOAT Float precision
None
The table of contents listing will print out all dataset attributes if the LMAN_VERBOSE flag is enabled. By default LMAN_VERBOSE is set to SYS_OFF.
Element connectivity input using FOCUS conventions will be assumed if the LMAN_FOCUSCONN flag is enabled. By default LMAN_FOCUSCONN is set to SYS_OFF.
Flag undefined result data with the parameter LMAN_NODATAVAL. If LMAN_NODATAVAL is enabled the function vdm_LManLoadState will identify undefined result data. The resulting State object will then be able to be queried for the defined status of result data. By default LMAN_NODATAVAL is set to SYS_ON.
Use the parameters LMAN_LOADMODEL_LOAD, LMAN_LOADMODEL_REST, LMAN_LOADMODEL_ELEMGEOM and LMAN_LOADMODEL_SET to control loading certain model data using vdm_LManLoadModel. LMAN_LOADMODEL_LOAD refers to all loads. LMAN_LOADMODEL_REST refers to all restraints and multipoint constraints. LMAN_LOADMODEL_SET refers to all node, element and element entity sets. LMAN_LOADMODEL_ELEMGEOM refers to shell and beam element geometry properties such as thickness, offset and fiber locations. By default all load model parameters are set to SYS_ON.
Use the parameter LMAN_LOADSTATE_PRE to specify the State precision used when loading data using vdm_LManLoadState. The proper data extent will be computed and set for quantized precisions. By default LMAN_LOADSTATE_PRE is set to SYS_FLOAT.
Use the parameter LMAN_RETAINCONNECT to specify that the underlying Connect object used by the file reader object (eg. NASLib) is retained and is used as the Connect object component of the Model object when loading data using vdm_LManLoadModel. This Connect object is then owned by the Model object but still retained and used by the underlying file reader object. It should not be destroyed before the underlying file reader is destroyed. The use of this option will avoid generating a copy of the Connect object. The Connect object returned from Model should be used for querying data only except for the function vis_ConnectKernel. By default LMAN_RETAINCONNECT is set to SYS_OFF.