1. Introduction

The CEETRON Solve Vfx library - also known as VfxTools - is designed to provide a set of “application” level modules. These modules draw upon technology from all other CEETRON SAM libraries to encapsulate important high level engineering analysis functions in an object oriented software model. Due to the application level nature of these modules, certain module functions may require considerable computer resources. These module functions have been implemented with a function prototype which is compatible with standard POSIX and Windows threading interfaces.

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.

  • Automatic generation of load and multipoint constraint cases.

  • Finite element solvers for design analysis.

  • Report generation facilities.

One goal of VfxTools modules is to provide a framework for building integrated, interactive design analysis tools embedded in CAD and CAE modeling systems.

The include file, userdefs.h, installed in the CeetronSAM/src/sam/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

1.1. Module Summary

Current VfxTools modules may be divided into 3 categories: 1) automatic case generation, 2) solvers, 3) report writing facilities.

  • Automatic Case Generation

    • GenLCase - Load case generation

    • GenMCase - Multi point constraint case generation

  • Finite Element Solvers

    • ProSolve - Design analysis solver

  • Report Writing

    • Render - Software generation of graphics images and objects

    • LogFile - Log file content

1.2. A First Program

As an example of a simple VfxTools application the following program reads a NASTRAN bulk data file and populates a Model object. The Model object encapsulates the finite element model, solution procedures and output requests in the NASTRAN input file. A ProSolve object is instanced and a finite element solution is performed as specified in the Model object. Various log files and output files are created with summaries of the solution phases and the solution results.

#include <stdlib.h>
#include "sam/base/base.h"
#include "sam/vdm/vdm.h"
#include "sam/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;
}