1 // ============================================================================= 2 // PROJECT CHRONO - http://projectchrono.org 3 // 4 // Copyright (c) 2014 projectchrono.org 5 // All rights reserved. 6 // 7 // Use of this source code is governed by a BSD-style license that can be found 8 // in the LICENSE file at the top level of the distribution and at 9 // http://projectchrono.org/license-chrono.txt. 10 // 11 // ============================================================================= 12 // Authors: Alessandro Tasora, Radu Serban 13 // ============================================================================= 14 // 15 // Physical system in which contact is modeled using a non-smooth 16 // (complementarity-based) method. 17 // 18 // ============================================================================= 19 20 #ifndef CH_SYSTEM_NSC_H 21 #define CH_SYSTEM_NSC_H 22 23 #include "chrono/physics/ChSystem.h" 24 25 namespace chrono { 26 27 /// Class for a physical system in which contact is modeled using a non-smooth 28 /// (complementarity-based) method. 29 class ChApi ChSystemNSC : public ChSystem { 30 31 public: 32 /// Create a physical system. 33 /// If init_sys is false, the collision system oand solver are not initialized. 34 ChSystemNSC(bool init_sys = true); 35 36 /// Copy constructor 37 ChSystemNSC(const ChSystemNSC& other); 38 39 /// Destructor ~ChSystemNSC()40 virtual ~ChSystemNSC() {} 41 42 /// "Virtual" copy constructor (covariant return type). Clone()43 virtual ChSystemNSC* Clone() const override { return new ChSystemNSC(*this); } 44 45 /// Return the contact method supported by this system. GetContactMethod()46 virtual ChContactMethod GetContactMethod() const override final { return ChContactMethod::NSC; } 47 48 /// Replace the contact container. 49 virtual void SetContactContainer(std::shared_ptr<ChContactContainer> container) override; 50 51 // SERIALIZATION 52 53 /// Method to allow serialization of transient data to archives. 54 virtual void ArchiveOUT(ChArchiveOut& marchive) override; 55 56 /// Method to allow deserialization of transient data from archives. 57 virtual void ArchiveIN(ChArchiveIn& marchive) override; 58 }; 59 60 CH_CLASS_VERSION(ChSystemNSC, 0) 61 62 } // end namespace chrono 63 64 #endif 65