Program Listing for File SubhingeSpringDamper.h

Program Listing for File SubhingeSpringDamper.h#

Return to documentation for file (include/Karana/GeneralKModels/SubhingeSpringDamper.h)

/*
*Copyright(c)2024-2025KaranaDynamicsPtyLtd.Allrightsreserved.
*
*NOTICETOUSER:
*
*Thissourcecodeand/ordocumentation(the"LicensedMaterials")is
*theconfidentialandproprietaryinformationofKaranaDynamicsInc.
*UseoftheseLicensedMaterialsisgovernedbythetermsandconditions
*ofaseparatesoftwarelicenseagreementbetweenKaranaDynamicsandthe
*Licensee("LicenseAgreement").Unlessexpresslypermittedunderthat
*agreement,anyreproduction,modification,distribution,ordisclosure
*oftheLicensedMaterials,inwholeorinpart,toanythirdparty
*withoutthepriorwrittenconsentofKaranaDynamicsisstrictlyprohibited.
*
*THELICENSEDMATERIALSAREPROVIDED"ASIS"WITHOUTWARRANTYOFANYKIND.
*KARANADYNAMICSDISCLAIMSALLWARRANTIES,EXPRESSORIMPLIED,INCLUDING
*BUTNOTLIMITEDTOWARRANTIESOFMERCHANTABILITY,NON-INFRINGEMENT,AND
*FITNESSFORAPARTICULARPURPOSE.
*
*INNOEVENTSHALLKARANADYNAMICSBELIABLEFORANYDAMAGESWHATSOEVER,
*INCLUDINGBUTNOTLIMITEDTOLOSSOFPROFITS,DATA,ORUSE,EVENIF
*ADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES,WHETHERINCONTRACT,TORT,
*OROTHERWISEARISINGOUTOFORINCONNECTIONWITHTHELICENSEDMATERIALS.
*
*U.S.GovernmentEndUsers:TheLicensedMaterialsarea"commercialitem"
*asdefinedat48C.F.R.2.101,andareprovidedtotheU.S.Government
*onlyasacommercialenditemunderthetermsofthislicense.
*
*AnyuseoftheLicensedMaterialsinindividualorcommercialsoftwaremust
*include,intheuserdocumentationandinternalsourcecodecomments,
*thisNotice,Disclaimer,andU.S.GovernmentUseProvision.
*/


#pragmaonce
#include"Karana/SOADyn/KModel.h"
#include"Karana/SOADyn/Node.h"
#include"Karana/SOADyn/PhysicalSubhinge.h"

namespaceKarana::Models{

namespacekm=Karana::Math;
namespacekd=Karana::Dynamics;

classSubhingeSpringDamperParams:publicKModelParams{
public:
SubhingeSpringDamperParams(std::string_viewname);

boolisFinalized()constfinal;

km::Vecsetpoint;

doublek;

doubled;
};

classSubhingeSpringDamper:publicKModel<SubhingeSpringDamper,SubhingeSpringDamperParams>{
public:
SubhingeSpringDamper(std::string_viewname,
constkc::ks_ptr<kd::StatePropagator>&sp,
constkc::ks_ptr<kd::PhysicalSubhinge>&sh);

~SubhingeSpringDamper();

statickc::ks_ptr<SubhingeSpringDamper>create(std::string_viewname,
constkc::ks_ptr<kd::StatePropagator>&sp,
constkc::ks_ptr<kd::PhysicalSubhinge>&sh);

voidpreDeriv(constkm::Ktime&t,constkm::Vec&x);

boolisFinalized()constfinal;

private:
kc::ks_ptr<kd::PhysicalSubhinge>_sh;
};
}//namespaceKarana::Models