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

Unit tests for the dynamics solver. More...

#include <string>
#include <vector>
#include "../solverInterface.h"
#include "gtest.h"
Include dependency graph for test_solver.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 main (int argc, char **argv)
 Main program for the dynamics 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, SystemModel)
 Creates a parameterized solver unit test. More...
 
 INSTANTIATE_TEST_CASE_P (TestSystemBeam, Solve, testing::Values(Case{ "cantilever-pipe", 17, { 0.344609, 0.0, 9.992951, 0.344609, 0.0, 9.992951, 0.344609, 0.0, 9.992951 }, false }, Case{ "cantilever-pipe", 17, { 0.345020, 0.0, 10.00000 }, true }, Case{ "cantilever-noshear", 17, { 0.343424, 0.0, 10.00000 }, true }))
 Instantiates the unit tests Solve.SystemModel. More...
 
 TEST (Solve, Prescribed)
 Creates a solver unit test for linear static analysis. More...
 

Variables

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

Detailed Description

Unit tests for the dynamics solver.

The purpose of this file is to provide basic unit-tests for some simple models, as an alternative to the regression tests in solverTests. We here focus more on basic functionality of the vpmSolver module, which is accessed via the solverInterface API, and uses google test for checking the behaviour and also for comparing response variables against reference values.

Author
Knut Morten Okstad, SAP SE
Date
20 Mar 2020

Function Documentation

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( TestSystemBeam  ,
Solve  ,
testing::Values(Case{ "cantilever-pipe", 17, { 0.344609, 0.0, 9.992951, 0.344609, 0.0, 9.992951, 0.344609, 0.0, 9.992951 }, false }, Case{ "cantilever-pipe", 17, { 0.345020, 0.0, 10.00000 }, true }, Case{ "cantilever-noshear", 17, { 0.343424, 0.0, 10.00000 }, true })   
)

Instantiates the unit tests Solve.SystemModel.

◆ main()

int main ( int  argc,
char **  argv 
)

Main program for the dynamics solver unit test executable.

◆ operator<<()

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

Global stream operator to print out a Case instance.

◆ TEST()

TEST ( Solve  ,
Prescribed   
)

Creates a solver unit test for linear static analysis.

This reads the solver input file, solves each time step and compares the control response variables against the reference values. Finally it closes down the solver to clean up memory.

◆ TEST_P()

TEST_P ( Solve  ,
SystemModel   
)

Creates a parameterized solver unit test.

This reads the solver input file, solves the initial equilibrium configuration and compares the control response variables against the reference values, then (unless it is a linear static analysis only) it invokes the time step loop comparing the response after each time step. Finally it closes down the solver to clean up memory.

GetParam() will return a Case instance, with the actual file name, baseID of the triad to compare the response at, and its reference values.

Variable Documentation

◆ srcdir

std::string srcdir
static

Full path of the source directory of this test.