1 /* Siconos is a program dedicated to modeling, simulation and control 2 * of non smooth dynamical systems. 3 * 4 * Copyright 2021 INRIA. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 /*! \file SphereLDSSphereLDSR.hpp 20 \brief Two spheres relation - Inherits from LagrangianScleronomousR 21 */ 22 23 #ifndef SphereLDSSphereLDSR_h 24 #define SphereLDSSphereLDSR_h 25 26 #include "MechanicsFwd.hpp" 27 #include "LagrangianScleronomousR.hpp" 28 29 class SphereLDSSphereLDSR : public LagrangianScleronomousR, public std::enable_shared_from_this<SphereLDSSphereLDSR> 30 { 31 private: 32 /** serialization hooks 33 */ 34 ACCEPT_SERIALIZATION(SphereLDSSphereLDSR); 35 36 double r1, r2, r1pr2; 37 SphereLDSSphereLDSR()38 SphereLDSSphereLDSR() {}; 39 40 public: 41 42 /** Constructor 43 44 \param r1 disk1 radius 45 \param r2 disk2 radius 46 */ 47 SphereLDSSphereLDSR(double r1, double r2); 48 49 double distance(double, double, double, double, double, double, double, double); 50 51 using LagrangianScleronomousR::computeh; 52 /** to compute the output y = h(t,q,z) of the Relation 53 \param q coordinates of the dynamical systems involved in the relation 54 \param z user defined parameters (optional) 55 \param y the resulting vector 56 */ 57 void computeh(const BlockVector& q, BlockVector& z, SiconosVector& y); 58 59 /** to compute the jacobian of h(...). Set attribute _jachq (access: jacqhq()) 60 \param q coordinates of the dynamical systems involved in the relation 61 \param z user defined parameters (optional) 62 */ 63 void computeJachq(const BlockVector& q, BlockVector& z); 64 65 /** visitors hook 66 */ 67 ACCEPT_VISITORS(); 68 69 }; 70 #endif /* SphereLDSSphereLDSR_h */ 71