mbsim  4.0.0
MBSim Kernel
implicit_integrator.h
1/* Copyright (C) 2004-2025 Martin Förg
2
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17 *
18 * Contact:
19 * martin.o.foerg@googlemail.com
20 *
21 */
22
23#ifndef _IMPLICIT_INTEGRATOR_H_
24#define _IMPLICIT_INTEGRATOR_H_
25
26#include "root_finding_integrator.h"
27
28namespace MBSim {
29
30 void setZero(fmatvec::Mat &A, const fmatvec::RangeV &rows, const fmatvec::RangeV &cols);
31
35
36 protected:
37 virtual double delta(int i, double z) const;
38 void par_ud_xd_par_q(fmatvec::Mat &J);
39 void par_zd_par_q(fmatvec::Mat &J);
40 void par_ud_xd_par_u_x(fmatvec::Mat &J, bool updla);
41 void par_zd_par_z(fmatvec::Mat &J, bool updla);
42
43 virtual void calcSize();
44 virtual void init();
45
47 bool reduced{false};
50
51 int neq, qMove;
52 fmatvec::Vec zd0; // saved derivatives of the solution components
53 fmatvec::RangeV Rq, Ru, Rx, Rz; // ranges for q, u, x and z
54 fmatvec::RangeV RuMove, RxMove; // ranges for u and x reduced by q
55
56 public:
57 ~ImplicitIntegrator() override = default;
58
59 void setReducedForm(bool reduced_) { reduced = reduced_; }
60 void setPartiallyAnalyticalJacobian(bool partiallyAnalyticalJacobian_) { partiallyAnalyticalJacobian = partiallyAnalyticalJacobian_; }
61 };
62
63}
64
65#endif
Base class for all implicit integrators.
Definition: implicit_integrator.h:34
bool partiallyAnalyticalJacobian
Definition: implicit_integrator.h:49
bool reduced
Definition: implicit_integrator.h:47
Integrator with root-finding.
Definition: root_finding_integrator.h:32
namespace MBSim
Definition: bilateral_constraint.cc:30