MBDyn-1.7.3
|
#include "mbconfig.h"
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <functional>
#include <typeinfo>
#include <cmath>
#include "clock_time.h"
#include "gradient.h"
Go to the source code of this file.
Macros | |
#define | M_PI 3.14159265358979 |
#define | GRADIENT_DEBUG 1 |
Functions | |
void | tic () |
void | tic (doublereal &dTime) |
doublereal | toc () |
doublereal | random1 () |
template<typename T > | |
bool | bCompare (const T &a, const T &b, doublereal dTolRel=0.) |
template<index_type N_SIZE> | |
bool | bCompare (const Gradient< N_SIZE > &a, const Gradient< N_SIZE > &b, doublereal dTolRel=0.) |
template<int N_SIZE> | |
void | testRangeVector () |
template<int N_SIZE> | |
void | testMapVector () |
template<typename T > | |
void | func (const T &u, const T &v, const T &w, doublereal e, T &f) |
template<typename T > | |
void | func_tmp (const T &u, const T &v, const T &w, doublereal e, T &f) |
doublereal | sec (doublereal x) |
void | funcDeriv (index_type N, doublereal u, const doublereal ud[], doublereal v, const doublereal vd[], doublereal w, const doublereal wd[], doublereal e, doublereal &f, doublereal fd[]) |
template<int N_SIZE> | |
void | testGradient (index_type N) |
template<index_type N_SIZE> | |
void | testGradient2 () |
void | testGradientCopy (int N) |
template<index_type N_SIZE> | |
void | testDifferentDofMaps (index_type N) |
template<index_type N_SIZE> | |
void | testGradientLin (int N) |
int | main (int argc, char *argv[]) |
Variables | |
int | NLoops = 1 |
int | NLoopsAss = 1 |
doublereal | dStartTime |
#define GRADIENT_DEBUG 1 |
Definition at line 71 of file gradienttest.cc.
Referenced by main().
#define M_PI 3.14159265358979 |
Definition at line 67 of file gradienttest.cc.
Referenced by PlaneHingeJoint::AfterConvergence(), PlaneRotationJoint::AfterConvergence(), Wheel4::AfterConvergence(), AxialRotationJoint::AfterConvergence(), PlanePinJoint::AfterConvergence(), CyclocopterPolimi::AfterConvergence(), ModLugreFriction::alpha(), ModLugreFriction::alphad_v(), ModLugreFriction::alphad_z(), TheodorsenAeroData::AssJac(), RotorTrimBase::AssRes(), DynamicInflowRotor::AssRes(), PetersHeRotor::AssRes(), CyclocopterPolimi::AssRes(), c81_aerod2(), c81_aerod2_u(), ScrewJointSh_c::ComputePitchAngle(), Control_valve::Control_valve(), CosineDriveCaller::CosineDriveCaller(), Motor::dGetPhiElectric(), PlaneHingeJoint::dGetPrivData(), PlaneRotationJoint::dGetPrivData(), AxialRotationJoint::dGetPrivData(), PlanePinJoint::dGetPrivData(), do_eig(), Dynamic_control_valve::Dynamic_control_valve(), Mat3x3::EigSym(), FourierSeriesDriveCaller::FourierSeriesDriveCaller(), getbladeparams(), GlauertRotor::GetInducedVelocity(), ManglerRotor::GetInducedVelocity(), CyclocopterPolimi::GetInducedVelocity(), MBDynParser::GetMatR2vec(), getrotorparams(), UniformRotor::Init(), GlauertRotor::Init(), ManglerRotor::Init(), DynamicInflowRotor::Init(), PetersHeRotor::Init(), main(), MatManip_test(), mp_ctg_t(), mp_tan_t(), Wheel2::Output(), GenericAerodynamicForce::Output(), Wheel4::Output(), Pressure_flow_control_valve::Pressure_flow_control_valve(), ReadGenericAerodynamicForce(), AerodynamicOutput::SetData(), SineDriveCaller::SineDriveCaller(), Unwrap(), and Wheel2::Wheel2().
bool bCompare | ( | const T & | a, |
const T & | b, | ||
doublereal | dTolRel = 0. |
||
) |
Definition at line 91 of file gradienttest.cc.
Referenced by func_tmp(), testGradient(), and testGradient2().
bool bCompare | ( | const Gradient< N_SIZE > & | a, |
const Gradient< N_SIZE > & | b, | ||
doublereal | dTolRel = 0. |
||
) |
Definition at line 103 of file gradienttest.cc.
References grad::Gradient< N_SIZE >::dGetDerivativeLocal(), grad::Gradient< N_SIZE >::dGetValue(), grad::Gradient< N_SIZE >::iGetEndIndexLocal(), and grad::Gradient< N_SIZE >::iGetStartIndexLocal().
void func | ( | const T & | u, |
const T & | v, | ||
const T & | w, | ||
doublereal | e, | ||
T & | f | ||
) |
Definition at line 309 of file gradienttest.cc.
References grad::cos(), grad::pow(), grad::sin(), and grad::tan().
Referenced by MathParser::StaticNameSpace::GetFunc(), MathParser::StaticNameSpace::IsFunc(), MBDynErrBase::MBDynErrBase(), ParseScalarFunction(), ReadCL1D(), ReadCL3D(), ReadCL6D(), ReadDC1D(), ReadDC3D(), ReadDC3x3D(), ReadDC6D(), ReadDC6x6D(), ReadDescription(), ReadDriveCallerData(), ReadDriveData(), ReadGustData(), ReadTimeStepData(), grad::LocalDofMap::Reset(), testGradient(), testGradient2(), ErrIndexOutOfRange::WriteMsg(), and MathParser::StaticNameSpace::~StaticNameSpace().
void func_tmp | ( | const T & | u, |
const T & | v, | ||
const T & | w, | ||
doublereal | e, | ||
T & | f | ||
) |
Definition at line 314 of file gradienttest.cc.
References bCompare(), grad::cos(), GRADIENT_ASSERT, grad::pow(), grad::sin(), and grad::tan().
void funcDeriv | ( | index_type | N, |
doublereal | u, | ||
const doublereal | ud[], | ||
doublereal | v, | ||
const doublereal | vd[], | ||
doublereal | w, | ||
const doublereal | wd[], | ||
doublereal | e, | ||
doublereal & | f, | ||
doublereal | fd[] | ||
) |
Definition at line 364 of file gradienttest.cc.
References grad::cos(), grad::log(), grad::pow(), sec(), grad::sin(), and grad::tan().
Referenced by testGradient(), and testGradient2().
Definition at line 1817 of file gradienttest.cc.
References GRADIENT_DEBUG, NLoops, and testGradientCopy().
doublereal random1 | ( | ) |
doublereal sec | ( | doublereal | x | ) |
Definition at line 360 of file gradienttest.cc.
References grad::cos().
Referenced by funcDeriv().
void testDifferentDofMaps | ( | index_type | N | ) |
Definition at line 730 of file gradienttest.cc.
References grad::Gradient< N_SIZE >::dGetDerivativeGlobal(), grad::Gradient< N_SIZE >::dGetValue(), and grad::MapVectorBase::GLOBAL.
void testGradient | ( | index_type | N | ) |
Definition at line 403 of file gradienttest.cc.
References bCompare(), grad::Gradient< N_SIZE >::DerivativeResizeReset(), grad::Gradient< N_SIZE >::dGetDerivativeGlobal(), grad::Gradient< N_SIZE >::dGetValue(), dof, grad::fabs(), func(), funcDeriv(), grad::MapVectorBase::GLOBAL, NLoops, random1(), grad::Gradient< N_SIZE >::SetDerivativeGlobal(), grad::Gradient< N_SIZE >::SetValuePreserve(), grad::sqrt(), and tic().
Referenced by testMatVecProductGradient().
void testGradient2 | ( | ) |
Definition at line 519 of file gradienttest.cc.
References grad::Alias(), bCompare(), grad::Gradient< N_SIZE >::DerivativeResizeReset(), grad::Gradient< N_SIZE >::dGetDerivativeGlobal(), grad::Gradient< N_SIZE >::dGetValue(), dof, grad::fabs(), func(), funcDeriv(), grad::MapVectorBase::GLOBAL, GRADIENT_ASSERT, NLoops, random1(), grad::Gradient< N_SIZE >::SetValuePreserve(), grad::sqrt(), and tic().
void testGradientCopy | ( | int | N | ) |
Definition at line 646 of file gradienttest.cc.
References grad::MapVectorBase::GLOBAL, NLoops, tic(), and toc().
Referenced by main().
void testGradientLin | ( | int | N | ) |
Definition at line 793 of file gradienttest.cc.
References grad::Gradient< N_SIZE >::bIsEqual(), grad::Gradient< N_SIZE >::DerivativeResizeReset(), grad::Gradient< N_SIZE >::dGetDerivativeGlobal(), grad::Gradient< N_SIZE >::dGetValue(), grad::MapVectorBase::GLOBAL, and grad::Gradient< N_SIZE >::SetValuePreserve().
void testMapVector | ( | ) |
Definition at line 267 of file gradienttest.cc.
References grad::MapVector< N_SIZE >::dGetLocalVector(), dof, grad::MapVector< N_SIZE >::iGetEndIndexLocal(), grad::LocalDofMap::iGetGlobalDof(), grad::MapVector< N_SIZE >::iGetStartIndexLocal(), and grad::LocalDofMap::Size().
void testRangeVector | ( | ) |
Definition at line 127 of file gradienttest.cc.
References grad::RangeVector< T, N_SIZE >::GetValue(), grad::RangeVector< T, N_SIZE >::GetVectorValue(), grad::RangeVector< T, N_SIZE >::iGetEndIndex(), grad::RangeVector< T, N_SIZE >::iGetEndIndexVector(), grad::RangeVector< T, N_SIZE >::iGetStartIndex(), grad::RangeVector< T, N_SIZE >::iGetStartIndexVector(), grad::RangeVector< T, N_SIZE >::Reserve(), grad::RangeVector< T, N_SIZE >::Reset(), grad::RangeVector< T, N_SIZE >::ResizePreserve(), grad::RangeVector< T, N_SIZE >::ResizeReset(), grad::RangeVector< T, N_SIZE >::SetValue(), and grad::RangeVector< T, N_SIZE >::SetVectorValue().
void tic | ( | ) |
Definition at line 866 of file gradienttest.cc.
References dStartTime, and mbdyn_clock_time().
Referenced by testGradient(), testGradient2(), and testGradientCopy().
void tic | ( | doublereal & | dTime | ) |
Definition at line 862 of file gradienttest.cc.
References mbdyn_clock_time().
doublereal toc | ( | ) |
Definition at line 870 of file gradienttest.cc.
References dStartTime, and mbdyn_clock_time().
Referenced by testGradientCopy().
doublereal dStartTime |
Definition at line 860 of file gradienttest.cc.
int NLoops = 1 |
Definition at line 79 of file gradienttest.cc.
Referenced by main(), testGradient(), testGradient2(), and testGradientCopy().
int NLoopsAss = 1 |
Definition at line 80 of file gradienttest.cc.