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

Unit testing for the linear FE solver. More...

#include "gtest.h"
#include "vpmCommon/FFCmdLineArgInterface.H"
#include <cstdlib>
Include dependency graph for test_FEsolve.C:

Classes

struct  Case
 Struct with parameters to instantiate particular units tests over. More...
 
class  Solve
 Class describing a unit test instance. More...
 

Functions

int ffl_loadPart (const std::string &)
 From FFlLinkHandler_F.C. More...
 
int solvePartDis (int, const int *, double *)
 From reducerInterface.C. More...
 
void initSolverArgs (int, char **, bool, bool)
 From reducerInterface.C. More...
 
void freeSingeltons ()
 From reducerInterface.C. More...
 
int main (int argc, char **argv)
 Main program for the FE solver unit test executable. More...
 
std::ostream & operator<< (std::ostream &os, const Case &c)
 Global stream operator to print out a Case instance. More...
 
 TEST_P (Solve, FEmodel)
 
 INSTANTIATE_TEST_CASE_P (TestBeams, Solve, testing::Values(Case{ "01_1D_BeamElements.nas", 1251, 0.0, 0.0128, 0.0 }, Case{ "02_1D2D_Hybrid.nas", 1259, 0.0, 0.0129, 0.0 }, Case{ "03_2D_ShellElements.nas", 29358, 0.0, 0.0123, 0.0 }, Case{ "04_3D_VolumeElements.nas", 1257, 0.0, 0.0128, 0.0 }, Case{ "L-beam.nas", 3, 0.00806403, 0.330873, -0.0302335 }, Case{ "CylinderBeam.nas", 6, 0.0, 0.3450, 0.0 }, Case{ "CylinderBeam-generic.nas", 6, 0.0, 0.3450, 0.0 }, Case{ "CylinderBeam-shearY.nas", 6, 0.3434, 0.3450, 0.0 }, Case{ "CylinderBeam-noshear.nas", 6, 0.0, 0.3434, 0.0 }))
 

Variables

static std::string srcdir
 Full path of the source directory of this test. More...
 

Detailed Description

Unit testing for the linear FE solver.

The purpose of this file is to provide some unit/regression tests for various FE models, on a low level. It also covers parsing of Nastran bulk data files containing the FE model definition. For each model, the linear- elastic stiffness matrix is assembled, and solved for some external load (defined in the FE data file). Then the response at one node is compared against the reference values (u_x, u_y, u_z).

Function Documentation

◆ ffl_loadPart()

int ffl_loadPart ( const std::string &  )

From FFlLinkHandler_F.C.

◆ freeSingeltons()

void freeSingeltons ( )

◆ initSolverArgs()

void initSolverArgs ( int  ,
char **  ,
bool  ,
bool   
)

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( TestBeams  ,
Solve  ,
testing::Values(Case{ "01_1D_BeamElements.nas", 1251, 0.0, 0.0128, 0.0 }, Case{ "02_1D2D_Hybrid.nas", 1259, 0.0, 0.0129, 0.0 }, Case{ "03_2D_ShellElements.nas", 29358, 0.0, 0.0123, 0.0 }, Case{ "04_3D_VolumeElements.nas", 1257, 0.0, 0.0128, 0.0 }, Case{ "L-beam.nas", 3, 0.00806403, 0.330873, -0.0302335 }, Case{ "CylinderBeam.nas", 6, 0.0, 0.3450, 0.0 }, Case{ "CylinderBeam-generic.nas", 6, 0.0, 0.3450, 0.0 }, Case{ "CylinderBeam-shearY.nas", 6, 0.3434, 0.3450, 0.0 }, Case{ "CylinderBeam-noshear.nas", 6, 0.0, 0.3434, 0.0 })   
)

Instantiate the test over a list of file names, node for which to extract displacements, and associated reference values to compare with.

◆ main()

int main ( int  argc,
char **  argv 
)

Main program for the FE solver unit test executable.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const Case c 
)

Global stream operator to print out a Case instance.

◆ solvePartDis()

int solvePartDis ( int  ,
const int *  ,
double *   
)

◆ TEST_P()

TEST_P ( Solve  ,
FEmodel   
)

Creates a parameterized test reading a FE data file, solving it, and comparing the nodal response with given reference values. GetParam() will return a Case instance, with the actual file name, node number and displacement values at that node to compare the response against.

Variable Documentation

◆ srcdir

std::string srcdir
static

Full path of the source directory of this test.