Program Listing for File PhysicalHinge.h

Program Listing for File PhysicalHinge.h#

Return to documentation for file (include/Karana/SOADyn/PhysicalHinge.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/FramePairHinge.h"
#include<vector>

namespaceKarana::Dynamics{

namespacekc=Karana::Core;

classHingeOnode;
classHingePnode;
classPinSubhinge;
classPhysicalBody;

classPhysicalHinge:publicFramePairHinge{

/*foraccessto_oneTimeTeardownand_oneTimeSetupmethods*/
friendclassPhysicalBody;

/*foraccessto_setupATBIDataCaches*/
friendclassMultibody;

/*foraccessto_invdyn_cache*/
friendclassHingePnode;

/*foraccesstoacorPrime*/
friendclassCompoundSubhinge;

public:
staticconstkc::ks_ptr<PhysicalHinge>
create(PhysicalBody&parent,
PhysicalBody&child,
HingeBase::HingeTypehtype,
conststd::vector<SubhingeBase::SubhingeType>&subhinge_types=
std::vector<SubhingeBase::SubhingeType>());

virtual~PhysicalHinge();

PhysicalHinge(PhysicalBody&parent_body,
PhysicalBody&child_body,
std::string_viewname,
HingeBase::HingeTypehtype,
conststd::vector<SubhingeBase::SubhingeType>&subhinge_types=
std::vector<SubhingeBase::SubhingeType>());

std::string_viewtypeString()constnoexceptoverride{
staticstd::stringtype_string="Karana::Dynamics::PhysicalHinge";
returntype_string;
}

public:
constkc::ks_ptr<HingePnode>&pnode()const;

constkc::ks_ptr<HingeOnode>&onode()const;

std::stringdumpString(std::string_viewprefix,
constKarana::Core::Base::DumpOptions*options)constoverride;

protected:
#if0
structInterBodyForce{
/*per
*https://stackoverflow.com/questions/41552966/getting-new-delete-type-mismatch-from-asan
*/
virtual~InterBodyForce()=default;

public:
boolenable_interbody_force=false;

km::SpatialVectorinterbody_spforce;
};
#endif

protected:
void_discard(kc::ks_ptr<Base>&base)override;

void_setupATBIDataCaches();
void_teardownATBIDataCaches();

void_setupInvDynDataCaches();
void_teardownInvDynDataCaches();

//Addingsuppression,asCodeCheckercomplainsthismethodhasthesamenameasamethodin
//thebaseversion.ThisisjustaCodeCheckerfalsepositive.
//codechecker_suppress[cppcheck-duplInheritedMember]
void_oneTimeTeardown();

/*carryoutsideeffectofthethegeneralizedforcechangingfor
thesubhinge.AnexamplesideeffectistomarktheATBIfilter
datacacheforthehingeonodeasstaleforaphysicalhinge.*/
void_changeActionT()override;

km::SpatialVector_acorPrime(constkm::Vec&x_dot_u)const;

private:
kc::ks_ptr<HingeOnode>_onode;
kc::ks_ptr<HingePnode>_pnode;
};

}//namespaceKarana::Dynamics