FEDEM Solver  R8.0
Source code of the dynamics solver
Macros | Functions | Variables
solverInterface.C File Reference

This file contains the C++ wrappers of the FEDEM dynamics solver API. More...

#include "vpmCommon/FFCmdLineArgInterface.H"
#include "FiDeviceFunctions/FiDeviceFunctionFactory.H"
#include "FFrLib/FFrReadOpInit.H"
#include "FFaMathExpr/FFaMathExprFactory.H"
#include "FFaLib/FFaDefinitions/FFaMsg.H"
#include "FFaLib/FFaOS/FFaFortran.H"
#include <cstring>
Include dependency graph for solverInterface.C:

Macros

#define DLLexport(ret)   extern "C" ret
 Macro for C++ binding to function in shared library on Linux. More...
 

Functions

static int checkState (const char *prg, bool startStep=false)
 Helper function to check correct execution order. More...
 
static void releaseGlobalHeapObjects (bool removeFFlSingeltons=true)
 Helper function to release all global heap-allocated objects on exit. More...
 

Variables

static int iop = -100
 Internal operation status variable. More...
 

Detailed Description

This file contains the C++ wrappers of the FEDEM dynamics solver API.

Each Fortran subroutine or function of the dynamics solver shared library that is supposed to be accessible for outside applications need to have their C++ wrapper implemented in this file. The subroutines/functions to be wrapped need to be declared using the SUBROUTINE, INTEGER_FUNCTION and DOUBLE_FUNCTION macros, which all are defined in the FFaFortran.H file. They can then be invoked using the F90_NAME macro defined in the same file.

Author
Knut Morten Okstad, Fedem Technology AS
Date
2 Dec 2016

Macro Definition Documentation

◆ DLLexport

#define DLLexport (   ret)    extern "C" ret

Macro for C++ binding to function in shared library on Linux.

Function Documentation

◆ checkState()

static int checkState ( const char *  prg,
bool  startStep = false 
)
static

Helper function to check correct execution order.

Parameters
[in]prgName of the calling function
[in]startStepIf true, we are starting on a new time/load increment

◆ releaseGlobalHeapObjects()

static void releaseGlobalHeapObjects ( bool  removeFFlSingeltons = true)
static

Helper function to release all global heap-allocated objects on exit.

Parameters
[in]removeFFlSingeltonsIf true, also release FE part objects if any

This function is invoked as the final task of the simulation, and in case of error exit, in order to clean up heap memory in case a new solver run is invoked later by the same process.

Variable Documentation

◆ iop

int iop = -100
static

Internal operation status variable.

This variable is used to record the current operation state by the various functions of the solver interface. It is updated inside those functions only and is used to ensure that they are invoked in a valid order.