VfxTools modules are intended to be used as extended examples in that application developers have access to the development source code and may change and modify them for specific uses. The basic features of VfxTools are summarized below.
The include file, userdefs.h, installed in the devtools/src/base directory should be customized to reflect compiling features in VfxTools which are dependent upon underlying toolkits. The following #define's should be added to userdefs.h indicating toolkits which are not licensed.
#define VKI_NOVGLTOOLS #define VKI_NOVISTOOLS #define VKI_NOVISTOOLSMESH #define VKI_NOVDMTOOLS
GenLCase Load case generation GenMCase Multi point constraint case generation
ProSolve Design analysis solver
Render Software generation of graphics images and objects LogFile Log file content
#include <stdlib.h> #include "base/base.h" #include "vdm/vdm.h" #include "vfx/vfx.h" /*---------------------------------------------------------------------- Solving a NASTRAN or ABAQUS model ----------------------------------------------------------------------*/ int main(int argc, char *argv[]) { Vint filetype; Vchar inputfile[256]; vdm_LMan *lman; vdm_NASFil *nasfil; vdm_ABAFil *abafil; vdm_DataFun *datafun; vis_Model *model; vfx_ProSolve *prosolve; vsy_TextFun *textfun; vsy_PlainText *plaintext; if(argc < 2) { fprintf(stderr,"Usage: %s inputfile\n",argv[0]); fprintf(stderr," chexa.dat is assumed\n"); strcpy(inputfile,"chexa.dat"); } else { strcpy(inputfile,argv[1]); } /* Access input file */ datafun = vdm_DataFunBegin (); /* determine input file type from file extension */ if(strstr(inputfile,".bdf") != NULL || strstr(inputfile,".dat") != NULL) { filetype = VDM_NASTRAN_BULKDATA; nasfil = vdm_NASFilBegin(); vdm_NASFilDataFun (nasfil,datafun); } else if(strstr(inputfile,".inp") != NULL) { filetype = VDM_ABAQUS_INPUT; abafil = vdm_ABAFilBegin(); vdm_ABAFilDataFun (abafil,datafun); } else { fprintf(stderr,"Error: unsupported input file type\n"); return 1; } vdm_DataFunSetConvention (datafun,VDM_CONVENTION_DOUBLE); vdm_DataFunOpen (datafun,0,inputfile,filetype); if(vdm_DataFunError (datafun)) { fprintf(stderr,"Error: opening file %s\n",inputfile); return 1; } /* create lman as helper 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"); return 1; } /* close input file */ vdm_LManEnd (lman); vdm_DataFunClose (datafun); vdm_DataFunEnd (datafun); if(filetype == VDM_NASTRAN_BULKDATA) { vdm_NASFilEnd (nasfil); } else if(filetype == VDM_ABAQUS_INPUT) { vdm_ABAFilEnd (abafil); } /* instance and initialize ProSolve */ prosolve = vfx_ProSolveBegin (); /* set parameters, no printout file */ vfx_ProSolveSetParami (prosolve,PROSOLVE_PRINTLEVEL,0); /* ask for results file in native .vdm format */ vfx_ProSolveSetParami (prosolve,PROSOLVE_RESTYPE,VDM_NATIVE); vfx_ProSolveSetParamc (prosolve,PROSOLVE_RESFILE,"intro1.vdm"); /* request model information on results file */ vfx_ProSolveSetParami (prosolve,PROSOLVE_SAVEMODEL,SYS_ON); /* set Model object */ vfx_ProSolveSetObject (prosolve,VIS_MODEL,model); /* set solution progress output to console */ plaintext = vsy_PlainTextBegin (); textfun = vsy_TextFunBegin (); vsy_PlainTextTextFun (plaintext,textfun); vsy_TextFunConnectFile (textfun,stdout); vfx_ProSolveSetObject (prosolve,VSY_TEXTFUN,textfun); /* execute */ vfx_ProSolveExec (prosolve); if(vfx_ProSolveError(prosolve)) { fprintf(stderr,"Error: unable to solve model information\n"); return 1; } /* delete output objects */ vsy_PlainTextEnd (plaintext); vsy_TextFunEnd (textfun); /* delete Model object contents and object */ vis_ModelDelete (model); vis_ModelEnd (model); /* delete ProSolve object */ vfx_ProSolveEnd (prosolve); return 0; }