chrono::utils::ChValidation Class Reference

## Description

This class provides functionality for validation of simulation results.

It provides functions for processing either two data files (simulation and reference) and calculating the norms of the column differences, or for processing a single simulation data file and calculating the norms of its columns. In either case, it is assumed that the first column in a data file contains time values. This column is never processed.

#include <ChUtilsValidation.h>

## Public Member Functions

bool Process (const std::string &sim_filename, const std::string &ref_filename, char delim='\t')
Read the data from the specified files and process it. More...

bool Process (const Data &sim_data, const Data &ref_data)
Process the data in the two specified structures. More...

bool Process (const std::string &sim_filename, char delim='\t')
Read the data in the specified file and process it. More...

bool Process (const Data &sim_data)
Process the data in the specified structure. More...

size_t GetNumColumns () const
Return the number of data columns.

size_t GetNumRows () const
Return the number of rows.

const HeadersGetHeadersSimData () const
Return the headers in the simulation data file.

const DataGetSimData () const
Return the simulation data.

const HeadersGetHeadersRefData () const
Return the headers in the reference data file.

const DataGetRefData () const
Return the reference data.

double GetL2norm (size_t col) const
Return the L2 norm for the specified column.

double GetRMSnorm (size_t col) const
Return the RMS norm for the specified column.

double GetINFnorm (size_t col) const
Return the infinity norm for the specified column.

const DataVectorGetL2norms () const
Return the L2 norms for all columns.

const DataVectorGetRMSnorms () const
Return the RMS norm for all columns.

const DataVectorGetINFnorms () const
Return the infinity norms for all columns.

## Static Public Member Functions

static size_t ReadDataFile (const std::string &filename, char delim, Headers &headers, Data &data)
Read the specified data file. More...

## ◆ Process() [1/4]

 bool chrono::utils::ChValidation::Process ( const Data & sim_data )

Process the data in the specified structure.

We calculate the vector norms of all columns except the first one.

Parameters
 sim_data simulation data structure

## ◆ Process() [2/4]

 bool chrono::utils::ChValidation::Process ( const Data & sim_data, const Data & ref_data )

Process the data in the two specified structures.

Excluding the first column (which must contain identical values in the two input structures), we subtract the data in corresponding columns in the two structures are and calculate the norms of the difference vectors.

Parameters
 sim_data simulation data strcture ref_data reference data structure

## ◆ Process() [3/4]

 bool chrono::utils::ChValidation::Process ( const std::string & sim_filename, char delim = '\t' )

Read the data in the specified file and process it.

We calculate the vector norms of all columns except the first one.

Parameters
 sim_filename name of the file with simulation results delim delimiter (default TAB)

## ◆ Process() [4/4]

 bool chrono::utils::ChValidation::Process ( const std::string & sim_filename, const std::string & ref_filename, char delim = '\t' )

Read the data from the specified files and process it.

Excluding the first column (which must contain identical values in the two input files), we subtract the data in corresponding columns in the two files are and calculate the norms of the difference vectors.

Parameters
 sim_filename name of the file with simulation results ref_filename name of the file with reference data delim delimiter (default TAB)

## ◆ ReadDataFile()

 size_t chrono::utils::ChValidation::ReadDataFile ( const std::string & filename, char delim, Headers & headers, Data & data )
static

Read the specified data file.

The file is assumed to be delimited by the specified character. The return value is the actual number of data points read from the file.

Parameters
 [in] filename name of the data file [in] delim delimiter [out] headers vector of column header strings [out] data table of data values

The documentation for this class was generated from the following files:
• /builds/uwsbel/chrono/src/chrono/utils/ChUtilsValidation.h
• /builds/uwsbel/chrono/src/chrono/utils/ChUtilsValidation.cpp