Source code for siconos.kernel

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

"""
A collection of low-level algorithms for solving basic algebra and optimization problem arising in the simulation of nonsmooth dynamical systems.

Example of usage:

>>> import siconos.kernel as sk
>>> help(sk.LagrangianDS)

"""

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _sicpykernel
else:
    import _sicpykernel

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import weakref

class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _sicpykernel.delete_SwigPyIterator

    def value(self) -> "PyObject *":
        return _sicpykernel.SwigPyIterator_value(self)

    def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _sicpykernel.SwigPyIterator_incr(self, n)

    def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _sicpykernel.SwigPyIterator_decr(self, n)

    def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
        return _sicpykernel.SwigPyIterator_distance(self, x)

    def equal(self, x: "SwigPyIterator") -> "bool":
        return _sicpykernel.SwigPyIterator_equal(self, x)

    def copy(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.SwigPyIterator_copy(self)

    def next(self) -> "PyObject *":
        return _sicpykernel.SwigPyIterator_next(self)

    def __next__(self) -> "PyObject *":
        return _sicpykernel.SwigPyIterator___next__(self)

    def previous(self) -> "PyObject *":
        return _sicpykernel.SwigPyIterator_previous(self)

    def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _sicpykernel.SwigPyIterator_advance(self, n)

    def __eq__(self, x: "SwigPyIterator") -> "bool":
        return _sicpykernel.SwigPyIterator___eq__(self, x)

    def __ne__(self, x: "SwigPyIterator") -> "bool":
        return _sicpykernel.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _sicpykernel.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _sicpykernel.SwigPyIterator___isub__(self, n)

    def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _sicpykernel.SwigPyIterator___add__(self, n)

    def __sub__(self, *args) -> "ptrdiff_t":
        return _sicpykernel.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _sicpykernel:
_sicpykernel.SwigPyIterator_swigregister(SwigPyIterator)

SHARED_PTR_DISOWN = _sicpykernel.SHARED_PTR_DISOWN
class VectorOfVectors(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.VectorOfVectors_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.VectorOfVectors___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.VectorOfVectors___bool__(self)

    def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
        return _sicpykernel.VectorOfVectors___len__(self)

    def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "std::vector< std::shared_ptr< SiconosVector >,std::allocator< std::shared_ptr< SiconosVector > > > *":
        return _sicpykernel.VectorOfVectors___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.VectorOfVectors___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "void":
        return _sicpykernel.VectorOfVectors___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfVectors___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
        return _sicpykernel.VectorOfVectors___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfVectors___setitem__(self, *args)

    def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type":
        return _sicpykernel.VectorOfVectors_pop(self)

    def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfVectors_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.VectorOfVectors_empty(self)

    def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
        return _sicpykernel.VectorOfVectors_size(self)

    def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
        return _sicpykernel.VectorOfVectors_begin(self)

    def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
        return _sicpykernel.VectorOfVectors_end(self)

    def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator":
        return _sicpykernel.VectorOfVectors_rbegin(self)

    def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator":
        return _sicpykernel.VectorOfVectors_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.VectorOfVectors_clear(self)

    def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type":
        return _sicpykernel.VectorOfVectors_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.VectorOfVectors_pop_back(self)

    def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
        return _sicpykernel.VectorOfVectors_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.VectorOfVectors_swiginit(self, _sicpykernel.new_VectorOfVectors(*args))

    def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfVectors_push_back(self, x)

    def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
        return _sicpykernel.VectorOfVectors_front(self)

    def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
        return _sicpykernel.VectorOfVectors_back(self)

    def assign(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type", x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfVectors_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.VectorOfVectors_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.VectorOfVectors_insert(self, *args)

    def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void":
        return _sicpykernel.VectorOfVectors_reserve(self, n)

    def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
        return _sicpykernel.VectorOfVectors_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_VectorOfVectors

# Register VectorOfVectors in _sicpykernel:
_sicpykernel.VectorOfVectors_swigregister(VectorOfVectors)

class VectorOfBlockVectors(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.VectorOfBlockVectors_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.VectorOfBlockVectors___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.VectorOfBlockVectors___bool__(self)

    def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
        return _sicpykernel.VectorOfBlockVectors___len__(self)

    def __getslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "std::vector< std::shared_ptr< BlockVector >,std::allocator< std::shared_ptr< BlockVector > > > *":
        return _sicpykernel.VectorOfBlockVectors___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.VectorOfBlockVectors___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "void":
        return _sicpykernel.VectorOfBlockVectors___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfBlockVectors___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
        return _sicpykernel.VectorOfBlockVectors___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfBlockVectors___setitem__(self, *args)

    def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type":
        return _sicpykernel.VectorOfBlockVectors_pop(self)

    def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfBlockVectors_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.VectorOfBlockVectors_empty(self)

    def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
        return _sicpykernel.VectorOfBlockVectors_size(self)

    def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
        return _sicpykernel.VectorOfBlockVectors_begin(self)

    def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
        return _sicpykernel.VectorOfBlockVectors_end(self)

    def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator":
        return _sicpykernel.VectorOfBlockVectors_rbegin(self)

    def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator":
        return _sicpykernel.VectorOfBlockVectors_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.VectorOfBlockVectors_clear(self)

    def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type":
        return _sicpykernel.VectorOfBlockVectors_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.VectorOfBlockVectors_pop_back(self)

    def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
        return _sicpykernel.VectorOfBlockVectors_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.VectorOfBlockVectors_swiginit(self, _sicpykernel.new_VectorOfBlockVectors(*args))

    def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfBlockVectors_push_back(self, x)

    def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
        return _sicpykernel.VectorOfBlockVectors_front(self)

    def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
        return _sicpykernel.VectorOfBlockVectors_back(self)

    def assign(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type", x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfBlockVectors_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.VectorOfBlockVectors_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.VectorOfBlockVectors_insert(self, *args)

    def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void":
        return _sicpykernel.VectorOfBlockVectors_reserve(self, n)

    def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
        return _sicpykernel.VectorOfBlockVectors_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_VectorOfBlockVectors

# Register VectorOfBlockVectors in _sicpykernel:
_sicpykernel.VectorOfBlockVectors_swigregister(VectorOfBlockVectors)

class VectorOfMatrices(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.VectorOfMatrices_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.VectorOfMatrices___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.VectorOfMatrices___bool__(self)

    def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
        return _sicpykernel.VectorOfMatrices___len__(self)

    def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SiconosMatrix >,std::allocator< std::shared_ptr< SiconosMatrix > > > *":
        return _sicpykernel.VectorOfMatrices___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.VectorOfMatrices___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "void":
        return _sicpykernel.VectorOfMatrices___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfMatrices___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
        return _sicpykernel.VectorOfMatrices___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfMatrices___setitem__(self, *args)

    def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type":
        return _sicpykernel.VectorOfMatrices_pop(self)

    def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfMatrices_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.VectorOfMatrices_empty(self)

    def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
        return _sicpykernel.VectorOfMatrices_size(self)

    def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
        return _sicpykernel.VectorOfMatrices_begin(self)

    def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
        return _sicpykernel.VectorOfMatrices_end(self)

    def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator":
        return _sicpykernel.VectorOfMatrices_rbegin(self)

    def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator":
        return _sicpykernel.VectorOfMatrices_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.VectorOfMatrices_clear(self)

    def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type":
        return _sicpykernel.VectorOfMatrices_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.VectorOfMatrices_pop_back(self)

    def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
        return _sicpykernel.VectorOfMatrices_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.VectorOfMatrices_swiginit(self, _sicpykernel.new_VectorOfMatrices(*args))

    def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfMatrices_push_back(self, x)

    def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
        return _sicpykernel.VectorOfMatrices_front(self)

    def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
        return _sicpykernel.VectorOfMatrices_back(self)

    def assign(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type", x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfMatrices_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.VectorOfMatrices_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.VectorOfMatrices_insert(self, *args)

    def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void":
        return _sicpykernel.VectorOfMatrices_reserve(self, n)

    def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
        return _sicpykernel.VectorOfMatrices_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_VectorOfMatrices

# Register VectorOfMatrices in _sicpykernel:
_sicpykernel.VectorOfMatrices_swigregister(VectorOfMatrices)

class VectorOfSMatrices(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.VectorOfSMatrices_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.VectorOfSMatrices___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.VectorOfSMatrices___bool__(self)

    def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
        return _sicpykernel.VectorOfSMatrices___len__(self)

    def __getslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SimpleMatrix >,std::allocator< std::shared_ptr< SimpleMatrix > > > *":
        return _sicpykernel.VectorOfSMatrices___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.VectorOfSMatrices___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "void":
        return _sicpykernel.VectorOfSMatrices___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfSMatrices___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
        return _sicpykernel.VectorOfSMatrices___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfSMatrices___setitem__(self, *args)

    def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type":
        return _sicpykernel.VectorOfSMatrices_pop(self)

    def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfSMatrices_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.VectorOfSMatrices_empty(self)

    def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
        return _sicpykernel.VectorOfSMatrices_size(self)

    def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
        return _sicpykernel.VectorOfSMatrices_begin(self)

    def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
        return _sicpykernel.VectorOfSMatrices_end(self)

    def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator":
        return _sicpykernel.VectorOfSMatrices_rbegin(self)

    def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator":
        return _sicpykernel.VectorOfSMatrices_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.VectorOfSMatrices_clear(self)

    def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type":
        return _sicpykernel.VectorOfSMatrices_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.VectorOfSMatrices_pop_back(self)

    def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
        return _sicpykernel.VectorOfSMatrices_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.VectorOfSMatrices_swiginit(self, _sicpykernel.new_VectorOfSMatrices(*args))

    def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfSMatrices_push_back(self, x)

    def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
        return _sicpykernel.VectorOfSMatrices_front(self)

    def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
        return _sicpykernel.VectorOfSMatrices_back(self)

    def assign(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type", x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
        return _sicpykernel.VectorOfSMatrices_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.VectorOfSMatrices_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.VectorOfSMatrices_insert(self, *args)

    def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void":
        return _sicpykernel.VectorOfSMatrices_reserve(self, n)

    def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
        return _sicpykernel.VectorOfSMatrices_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_VectorOfSMatrices

# Register VectorOfSMatrices in _sicpykernel:
_sicpykernel.VectorOfSMatrices_swigregister(VectorOfSMatrices)

class VectorOfMemories(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.VectorOfMemories_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.VectorOfMemories___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.VectorOfMemories___bool__(self)

    def __len__(self) -> "std::vector< SiconosMemory >::size_type":
        return _sicpykernel.VectorOfMemories___len__(self)

    def __getslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "std::vector< SiconosMemory,std::allocator< SiconosMemory > > *":
        return _sicpykernel.VectorOfMemories___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.VectorOfMemories___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void":
        return _sicpykernel.VectorOfMemories___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfMemories___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &":
        return _sicpykernel.VectorOfMemories___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.VectorOfMemories___setitem__(self, *args)

    def pop(self) -> "std::vector< SiconosMemory >::value_type":
        return _sicpykernel.VectorOfMemories_pop(self)

    def append(self, x: "SiconosMemory") -> "void":
        return _sicpykernel.VectorOfMemories_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.VectorOfMemories_empty(self)

    def size(self) -> "std::vector< SiconosMemory >::size_type":
        return _sicpykernel.VectorOfMemories_size(self)

    def begin(self) -> "std::vector< SiconosMemory >::iterator":
        return _sicpykernel.VectorOfMemories_begin(self)

    def end(self) -> "std::vector< SiconosMemory >::iterator":
        return _sicpykernel.VectorOfMemories_end(self)

    def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator":
        return _sicpykernel.VectorOfMemories_rbegin(self)

    def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator":
        return _sicpykernel.VectorOfMemories_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.VectorOfMemories_clear(self)

    def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type":
        return _sicpykernel.VectorOfMemories_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.VectorOfMemories_pop_back(self)

    def erase(self, *args) -> "std::vector< SiconosMemory >::iterator":
        return _sicpykernel.VectorOfMemories_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.VectorOfMemories_swiginit(self, _sicpykernel.new_VectorOfMemories(*args))

    def push_back(self, x: "SiconosMemory") -> "void":
        return _sicpykernel.VectorOfMemories_push_back(self, x)

    def front(self) -> "std::vector< SiconosMemory >::value_type const &":
        return _sicpykernel.VectorOfMemories_front(self)

    def back(self) -> "std::vector< SiconosMemory >::value_type const &":
        return _sicpykernel.VectorOfMemories_back(self)

    def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void":
        return _sicpykernel.VectorOfMemories_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.VectorOfMemories_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.VectorOfMemories_insert(self, *args)

    def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void":
        return _sicpykernel.VectorOfMemories_reserve(self, n)

    def capacity(self) -> "std::vector< SiconosMemory >::size_type":
        return _sicpykernel.VectorOfMemories_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_VectorOfMemories

# Register VectorOfMemories in _sicpykernel:
_sicpykernel.VectorOfMemories_swigregister(VectorOfMemories)

class UnsignedIntVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self) -> "swig::SwigPyIterator *":
        return _sicpykernel.UnsignedIntVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self) -> "bool":
        return _sicpykernel.UnsignedIntVector___nonzero__(self)

    def __bool__(self) -> "bool":
        return _sicpykernel.UnsignedIntVector___bool__(self)

    def __len__(self) -> "std::vector< unsigned int >::size_type":
        return _sicpykernel.UnsignedIntVector___len__(self)

    def __getslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "std::vector< unsigned int,std::allocator< unsigned int > > *":
        return _sicpykernel.UnsignedIntVector___getslice__(self, i, j)

    def __setslice__(self, *args) -> "void":
        return _sicpykernel.UnsignedIntVector___setslice__(self, *args)

    def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void":
        return _sicpykernel.UnsignedIntVector___delslice__(self, i, j)

    def __delitem__(self, *args) -> "void":
        return _sicpykernel.UnsignedIntVector___delitem__(self, *args)

    def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &":
        return _sicpykernel.UnsignedIntVector___getitem__(self, *args)

    def __setitem__(self, *args) -> "void":
        return _sicpykernel.UnsignedIntVector___setitem__(self, *args)

    def pop(self) -> "std::vector< unsigned int >::value_type":
        return _sicpykernel.UnsignedIntVector_pop(self)

    def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void":
        return _sicpykernel.UnsignedIntVector_append(self, x)

    def empty(self) -> "bool":
        return _sicpykernel.UnsignedIntVector_empty(self)

    def size(self) -> "std::vector< unsigned int >::size_type":
        return _sicpykernel.UnsignedIntVector_size(self)

    def begin(self) -> "std::vector< unsigned int >::iterator":
        return _sicpykernel.UnsignedIntVector_begin(self)

    def end(self) -> "std::vector< unsigned int >::iterator":
        return _sicpykernel.UnsignedIntVector_end(self)

    def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator":
        return _sicpykernel.UnsignedIntVector_rbegin(self)

    def rend(self) -> "std::vector< unsigned int >::reverse_iterator":
        return _sicpykernel.UnsignedIntVector_rend(self)

    def clear(self) -> "void":
        return _sicpykernel.UnsignedIntVector_clear(self)

    def get_allocator(self) -> "std::vector< unsigned int >::allocator_type":
        return _sicpykernel.UnsignedIntVector_get_allocator(self)

    def pop_back(self) -> "void":
        return _sicpykernel.UnsignedIntVector_pop_back(self)

    def erase(self, *args) -> "std::vector< unsigned int >::iterator":
        return _sicpykernel.UnsignedIntVector_erase(self, *args)

    def __init__(self, *args):
        _sicpykernel.UnsignedIntVector_swiginit(self, _sicpykernel.new_UnsignedIntVector(*args))

    def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void":
        return _sicpykernel.UnsignedIntVector_push_back(self, x)

    def front(self) -> "std::vector< unsigned int >::value_type const &":
        return _sicpykernel.UnsignedIntVector_front(self)

    def back(self) -> "std::vector< unsigned int >::value_type const &":
        return _sicpykernel.UnsignedIntVector_back(self)

    def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void":
        return _sicpykernel.UnsignedIntVector_assign(self, n, x)

    def resize(self, *args) -> "void":
        return _sicpykernel.UnsignedIntVector_resize(self, *args)

    def insert(self, *args) -> "void":
        return _sicpykernel.UnsignedIntVector_insert(self, *args)

    def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void":
        return _sicpykernel.UnsignedIntVector_reserve(self, n)

    def capacity(self) -> "std::vector< unsigned int >::size_type":
        return _sicpykernel.UnsignedIntVector_capacity(self)
    __swig_destroy__ = _sicpykernel.delete_UnsignedIntVector

# Register UnsignedIntVector in _sicpykernel:
_sicpykernel.UnsignedIntVector_swigregister(UnsignedIntVector)

[docs] class MATRIX_UBLAS_TYPE(object): r""" Union of DenseMat pointer, TriangMat pointer BandedMat, SparseMat, SymMat, Zero and Identity mat pointers.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr Dense = property(_sicpykernel.MATRIX_UBLAS_TYPE_Dense_get, _sicpykernel.MATRIX_UBLAS_TYPE_Dense_set) Triang = property(_sicpykernel.MATRIX_UBLAS_TYPE_Triang_get, _sicpykernel.MATRIX_UBLAS_TYPE_Triang_set) Sym = property(_sicpykernel.MATRIX_UBLAS_TYPE_Sym_get, _sicpykernel.MATRIX_UBLAS_TYPE_Sym_set) Sparse = property(_sicpykernel.MATRIX_UBLAS_TYPE_Sparse_get, _sicpykernel.MATRIX_UBLAS_TYPE_Sparse_set) Banded = property(_sicpykernel.MATRIX_UBLAS_TYPE_Banded_get, _sicpykernel.MATRIX_UBLAS_TYPE_Banded_set) Zero = property(_sicpykernel.MATRIX_UBLAS_TYPE_Zero_get, _sicpykernel.MATRIX_UBLAS_TYPE_Zero_set) Identity = property(_sicpykernel.MATRIX_UBLAS_TYPE_Identity_get, _sicpykernel.MATRIX_UBLAS_TYPE_Identity_set) SparseCoordinate = property(_sicpykernel.MATRIX_UBLAS_TYPE_SparseCoordinate_get, _sicpykernel.MATRIX_UBLAS_TYPE_SparseCoordinate_set) def __init__(self): _sicpykernel.MATRIX_UBLAS_TYPE_swiginit(self, _sicpykernel.new_MATRIX_UBLAS_TYPE()) __swig_destroy__ = _sicpykernel.delete_MATRIX_UBLAS_TYPE
# Register MATRIX_UBLAS_TYPE in _sicpykernel: _sicpykernel.MATRIX_UBLAS_TYPE_swigregister(MATRIX_UBLAS_TYPE)
[docs] class SiconosMatrix(object): r""" Abstract class to provide interface for matrices handling Matrices can be either block or Simple. See Derived classes for details. In Siconos, a "matrix" can be either a SimpleMatrix or a BlockMatrix, ie a container of several pointers to SiconosMatrix You can find an overview on how to build and use vectors and matrices in siconos users guide . """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr __swig_destroy__ = _sicpykernel.delete_SiconosMatrix
[docs] def isBlock(self) -> "bool": r""" true if the matrix is block else false. :rtype: boolean :return: a bool """ return _sicpykernel.SiconosMatrix_isBlock(self)
[docs] def isPLUInversed(self) -> "bool": r""" determines if the matrix has been inversed in place :rtype: boolean :return: true if the matrix is inversed """ return _sicpykernel.SiconosMatrix_isPLUInversed(self)
[docs] def isSymmetric(self) -> "bool": r""" true if the matrix is symmetric (the flag is just returned) :rtype: boolean :return: true if the matrix is symmetric """ return _sicpykernel.SiconosMatrix_isSymmetric(self)
[docs] def setIsSymmetric(self, b: "bool") -> "void": r""" set the flag _isSymmetric""" return _sicpykernel.SiconosMatrix_setIsSymmetric(self, b)
[docs] def isPositiveDefinite(self) -> "bool": r""" true if the matrix is definite positive (the flag is just returned) :rtype: boolean :return: true if the matrix is """ return _sicpykernel.SiconosMatrix_isPositiveDefinite(self)
[docs] def setIsPositiveDefinite(self, b: "bool") -> "void": r""" set the flag _isPositiveDefinite""" return _sicpykernel.SiconosMatrix_setIsPositiveDefinite(self, b)
[docs] def checkSymmetry(self, tol: "double") -> "bool": r""" determines if the matrix is symmetric up to a given tolerance :rtype: boolean :return: true if the matrix is inversed """ return _sicpykernel.SiconosMatrix_checkSymmetry(self, tol)
[docs] def isPLUFactorized(self) -> "bool": r""" determines if the matrix has been PLU factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SiconosMatrix_isPLUFactorized(self)
[docs] def isPLUFactorizedInPlace(self) -> "bool": r""" determines if the matrix has been PLU factorized in place :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SiconosMatrix_isPLUFactorizedInPlace(self)
[docs] def isCholeskyFactorized(self) -> "bool": r""" determines if the matrix has been Cholesky factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SiconosMatrix_isCholeskyFactorized(self)
[docs] def isQRFactorized(self) -> "bool": r""" determines if the matrix has been QR factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SiconosMatrix_isQRFactorized(self)
def ipiv(self) -> "SP::VInt": return _sicpykernel.SiconosMatrix_ipiv(self)
[docs] def isFactorized(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SiconosMatrix_isFactorized(self)
[docs] def size(self, index: "unsigned int") -> "unsigned int": r""" get the number of rows or columns of the matrix :type index: int :param index: 0 for rows, 1 for columns :rtype: int :return: an int """ return _sicpykernel.SiconosMatrix_size(self, index)
[docs] def num(self) -> "Siconos::UBLAS_TYPE": r""" get the attribute num of current matrix :rtype: int :return: an unsigned int. """ return _sicpykernel.SiconosMatrix_num(self)
[docs] def numberOfBlocks(self, i: "unsigned int") -> "unsigned int": r""" get the number of block (i=0, row, i=1 col) :type i: int :param i: unsigned int(i=0, row, i=1 col) :rtype: int :return: an unsigned int. 1 as default for SimpleMatrix. """ return _sicpykernel.SiconosMatrix_numberOfBlocks(self, i)
[docs] def tabRow(self) -> "SP::Index const": r""" reserved to BlockMatrix - get the index tab for rows :rtype: SP::Index :return: a pointer to a standard vector of int """ return _sicpykernel.SiconosMatrix_tabRow(self)
[docs] def tabCol(self) -> "SP::Index const": r""" reserved to BlockMatrix - get the index tab of columns :rtype: SP::Index :return: a pointer to a standard vector of int """ return _sicpykernel.SiconosMatrix_tabCol(self)
[docs] def getDense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat const": r""" get DenseMat matrix :type row: int, optional :param row: an unsigned int position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int position of the block (column) - Useless for SimpleMatrix :rtype: DenseMat :return: a DenseMat """ return _sicpykernel.SiconosMatrix_getDense(self, row, col)
[docs] def getTriang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat const": r""" get TriangMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: TriangMat :return: a TriangMat """ return _sicpykernel.SiconosMatrix_getTriang(self, row, col)
[docs] def getSym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat const": r""" get SymMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SymMat :return: a SymMat """ return _sicpykernel.SiconosMatrix_getSym(self, row, col)
[docs] def getBanded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat const": r""" get BandedMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: BandedMat :return: a BandedMat """ return _sicpykernel.SiconosMatrix_getBanded(self, row, col)
[docs] def getSparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat const": r""" get SparseMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SparseMat :return: a SparseMat """ return _sicpykernel.SiconosMatrix_getSparse(self, row, col)
[docs] def getSparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat const": r""" get SparseCoordinateMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SparseCoordinateMat :return: a SparseCoordinateMat """ return _sicpykernel.SiconosMatrix_getSparseCoordinate(self, row, col)
[docs] def getZero(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat const": r""" get ZeroMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: ZeroMat :return: a ZeroMat """ return _sicpykernel.SiconosMatrix_getZero(self, row, col)
[docs] def getIdentity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat const": r""" get getIdentity matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: IdentityMat :return: an IdentityMat """ return _sicpykernel.SiconosMatrix_getIdentity(self, row, col)
[docs] def dense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat *": r""" get a pointer on DenseMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: DenseMat :return: a DenseMat* """ return _sicpykernel.SiconosMatrix_dense(self, row, col)
[docs] def triang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat *": r""" get a pointer on TriangMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: TriangMat :return: a TriangMat* """ return _sicpykernel.SiconosMatrix_triang(self, row, col)
[docs] def sym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat *": r""" get a pointer on SymMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SymMat :return: a SymMat* """ return _sicpykernel.SiconosMatrix_sym(self, row, col)
[docs] def banded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat *": r""" get a pointer on BandedMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: BandedMat :return: a BandedMat* """ return _sicpykernel.SiconosMatrix_banded(self, row, col)
[docs] def sparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat *": r""" get a pointer on SparseMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SparseMat :return: a SparseMat* """ return _sicpykernel.SiconosMatrix_sparse(self, row, col)
[docs] def sparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat *": r""" get a pointer on SparseCoordinateMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: SparseCoordinateMat :return: a SparseCoordinateMat* """ return _sicpykernel.SiconosMatrix_sparseCoordinate(self, row, col)
[docs] def zero_mat(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat *": r""" get a pointer on ZeroMat matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: ZeroMat :return: a ZeroMat* """ return _sicpykernel.SiconosMatrix_zero_mat(self, row, col)
[docs] def identity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat *": r""" get a pointer on Identity matrix :type row: int, optional :param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix :rtype: IdentityMat :return: an IdentityMat* """ return _sicpykernel.SiconosMatrix_identity(self, row, col)
[docs] def getArray(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "double *": r""" return the address of the array of double values of the matrix ( for block(i,j) if this is a block matrix) :type row: int, optional :param row: position for the required block :type col: int, optional :param col: position for the required block :rtype: float :return: double* : the pointer on the double array """ return _sicpykernel.SiconosMatrix_getArray(self, row, col)
[docs] def zero(self) -> "void": r""" sets all the values of the matrix to 0.0""" return _sicpykernel.SiconosMatrix_zero(self)
[docs] def randomize(self) -> "void": r""" Initialize the matrix with random values""" return _sicpykernel.SiconosMatrix_randomize(self)
[docs] def randomize_sym(self) -> "void": r""" Initialize a symmetric matrix with random values""" return _sicpykernel.SiconosMatrix_randomize_sym(self)
[docs] def eye(self) -> "void": r""" set an identity matrix""" return _sicpykernel.SiconosMatrix_eye(self)
[docs] def resize(self, nbrow: "unsigned int", nbcol: "unsigned int", lower: "unsigned int"=0, upper: "unsigned int"=0, preserve: "bool"=True) -> "void": r""" resize the matrix with nbrow rows and nbcol columns, upper and lower are only useful for BandedMatrix . The existing elements of the matrix are preseved when specified. :type nbrow: int :param nbrow: :type nbcol: int :param nbcol: :param lower,upper: for banded matrices :type preserve: boolean, optional :param preserve: """ return _sicpykernel.SiconosMatrix_resize(self, nbrow, nbcol, lower, upper, preserve)
[docs] def normInf(self) -> "double": r""" compute the infinite norm of the matrix :rtype: float :return: a double """ return _sicpykernel.SiconosMatrix_normInf(self)
[docs] def display(self) -> "void": r""" display data on standard output""" return _sicpykernel.SiconosMatrix_display(self)
[docs] def displayExpert(self, brief: "bool"=True) -> "void": r""" display data on standard output""" return _sicpykernel.SiconosMatrix_displayExpert(self, brief)
[docs] def toString(self) -> "std::string": r""" put data of the matrix into a std::string :rtype: string :return: std::string """ return _sicpykernel.SiconosMatrix_toString(self)
[docs] def getValue(self, i: "unsigned int", j: "unsigned int") -> "double": r""" return the element matrix[i,j] :type i: int :param i: an unsigned int i :type j: int :param j: an unsigned int j :rtype: float :return: a double """ return _sicpykernel.SiconosMatrix_getValue(self, i, j)
[docs] def setValue(self, i: "unsigned int", j: "unsigned int", value: "double") -> "void": r""" set the element matrix[i,j] :type i: int :param i: an unsigned int i :type j: int :param j: an unsigned int j :type value: float :param value: """ return _sicpykernel.SiconosMatrix_setValue(self, i, j, value)
[docs] def block(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SP::SiconosMatrix": r""" get block at position row-col if BlockMatrix, else if SimpleMatrix return this :type row: int, optional :param row: unsigned int row :type col: int, optional :param col: unsigned int col :rtype: :py:class:`SiconosMatrix` :return: SP::SiconosMatrix """ return _sicpykernel.SiconosMatrix_block(self, row, col)
[docs] def getRow(self, index: "unsigned int", vOut: "SiconosVector") -> "void": r""" get row index of current matrix and save it into vOut :type index: int :param index: row we want to get :type vOut: :py:class:`SiconosVector`, out :param vOut: SiconosVector that will contain the desired row """ return _sicpykernel.SiconosMatrix_getRow(self, index, vOut)
[docs] def getCol(self, index: "unsigned int", vOut: "SiconosVector") -> "void": r""" get column index of current matrix and save it into vOut :type index: int :param index: column we want to get :type vOut: :py:class:`SiconosVector`, out :param vOut: SiconosVector that will contain the desired column """ return _sicpykernel.SiconosMatrix_getCol(self, index, vOut)
[docs] def setRow(self, index: "unsigned int", vIn: "SiconosVector") -> "void": r""" set line row of the current matrix with vector v :type index: int :param index: row we want to set :type vIn: :py:class:`SiconosVector` :param vIn: SiconosVector containing the new row """ return _sicpykernel.SiconosMatrix_setRow(self, index, vIn)
[docs] def setCol(self, index: "unsigned int", vIn: "SiconosVector") -> "void": r""" set column col of the current matrix with vector v :type index: int :param index: column we want to set :type vIn: :py:class:`SiconosVector` :param vIn: a SiconosVector containing the new column """ return _sicpykernel.SiconosMatrix_setCol(self, index, vIn)
[docs] def trans(self, *args) -> "void": r""" *Overload 1:* transpose in place: x->trans() is x = transpose of x. | *Overload 2:* transpose a matrix: x->trans(m) is x = transpose of m. :type m: :py:class:`SiconosMatrix` :param m: the matrix to be transposed. """ return _sicpykernel.SiconosMatrix_trans(self, *args)
def __copy__(self, *args) -> "SiconosMatrix &": r""" *Overload 1:* operator = :type m: :py:class:`SiconosMatrix` :param m: the matrix to be copied :rtype: :py:class:`SiconosMatrix` :return: SiconosMatrix | *Overload 2:* operator = to a DenseMat :type m: DenseMat :param m: the DenseMat to be copied :rtype: :py:class:`SiconosMatrix` :return: SiconosMatrix """ return _sicpykernel.SiconosMatrix___copy__(self, *args) def __iadd__(self, m: "SiconosMatrix") -> "SiconosMatrix &": r""" operator += :type m: :py:class:`SiconosMatrix` :param m: a matrix to add :rtype: :py:class:`SiconosMatrix` :return: SiconosMatrix """ return _sicpykernel.SiconosMatrix___iadd__(self, m) def __isub__(self, m: "SiconosMatrix") -> "SiconosMatrix &": r""" operator -= :type m: :py:class:`SiconosMatrix` :param m: a matrix to subtract :rtype: :py:class:`SiconosMatrix` :return: SiconosMatrix """ return _sicpykernel.SiconosMatrix___isub__(self, m) def updateNumericsMatrix(self) -> "void": return _sicpykernel.SiconosMatrix_updateNumericsMatrix(self) def numericsMatrix(self) -> "NumericsMatrix *": return _sicpykernel.SiconosMatrix_numericsMatrix(self)
[docs] def PLUFactorizationInPlace(self) -> "void": r""" computes a LU factorization of a general M-by-N matrix with partial pivoting and row interchanges. The result is returned in this (InPlace). Based on Blas dgetrf function for dense matrix and ublas cholesky decomposition for sparse matrix (work only for a symmetric matrix and very slow because it uses matric accessor) use preferably PLUFactorize() """ return _sicpykernel.SiconosMatrix_PLUFactorizationInPlace(self)
[docs] def Factorize(self) -> "void": r""" computes a factorization of a general M-by-N matrix The implementation is based on an internal NumericsMatrix """ return _sicpykernel.SiconosMatrix_Factorize(self)
[docs] def PLUInverseInPlace(self) -> "void": r""" compute inverse of this thanks to LU factorization with partial pivoting. This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A). The result is returned in this (InPlace). Based on Blas dgetri function for dense function """ return _sicpykernel.SiconosMatrix_PLUInverseInPlace(self)
[docs] def solve_matrix(self, B: "SiconosMatrix") -> "void": r""" solves a system of linear equations A * X = B (A=this) for a general N-by-N matrix A using the LU factorization computed by PLUFactorize. :type B: :py:class:`SiconosMatrix`, in/out :param B: on input the RHS matrix b; on output the result x """ return _sicpykernel.SiconosMatrix_solve_matrix(self, B)
[docs] def PLUForwardBackwardInPlace(self, *args) -> "void": r""" *Overload 1:* solves a system of linear equations A * X = B (A=this) for a general N-by-N matrix A using the LU factorization computed by PLUFactorizationInPlace. Based on Blas dgetrs function for dense matrix. :type B: :py:class:`SiconosMatrix`, in/out :param B: on input the RHS matrix b; on output the result x | *Overload 2:* solves a system of linear equations A * X = B (A=this) for a general N-by-N matrix A using the LU factorization computed by PLUFactorizationInPlace. Based on Blas dgetrs function for dense matrix. :type B: :py:class:`SiconosVector`, in/out :param B: on input the RHS matrix b; on output the result x """ return _sicpykernel.SiconosMatrix_PLUForwardBackwardInPlace(self, *args)
[docs] def solve_vector(self, B: "SiconosVector") -> "void": r""" solves a system of linear equations A * X = B (A=this) for a general N-by-N matrix A using the LU factorization computed by PLUFactorize. :type B: :py:class:`SiconosVector`, in/out :param B: on input the RHS matrix b; on output the result x """ return _sicpykernel.SiconosMatrix_solve_vector(self, B)
[docs] def resetLU(self) -> "void": r""" set to false all LU indicators. Useful in case of assignment for example. """ return _sicpykernel.SiconosMatrix_resetLU(self)
[docs] def resetFactorizationFlags(self) -> "void": r""" set to false all factorization indicators. Useful in case of assignment for example. """ return _sicpykernel.SiconosMatrix_resetFactorizationFlags(self)
[docs] def nnz(self, tol: "double"=1e-14) -> "size_t": r""" return the number of non-zero in the matrix :type tol: float, optional :param tol: the tolerance to consider a number zero (not used if the matrix is sparse) :rtype: int :return: the number of non-zeros """ return _sicpykernel.SiconosMatrix_nnz(self, tol)
[docs] def fillCSC(self, *args) -> "bool": r""" *Overload 1:* Fill CSparseMatrix compresses column sparse matrix :type csc: CSparseMatrix :param csc: the compressed column sparse matrix :type row_off: int :param row_off: :type col_off: int :param col_off: :type tol: float, optional :param tol: the tolerance under which a number is considered as equal to zero :rtype: boolean :return: true if function worked. Warning: not clear that it works for an empty csr matrix with row_off =0 and col_off =0 | *Overload 2:* Fill CSparseMatrix compresses column sparse matrix :type csc: CSparseMatrix :param csc: the compressed column sparse matrix :type tol: float, optional :param tol: the tolerance under which a number is considered as equal to zero :rtype: boolean :return: true if function worked. | *Overload 3:* Fill CSparseMatrix compresses column sparse matrix :type csc: CSparseMatrix :param csc: the compressed column sparse matrix :param tol: the tolerance under which a number is considered as equal to zero :rtype: boolean :return: true if function worked. """ return _sicpykernel.SiconosMatrix_fillCSC(self, *args)
def fromCSC(self, csc: "CSparseMatrix *") -> "bool": return _sicpykernel.SiconosMatrix_fromCSC(self, csc)
[docs] def fillTriplet(self, csc: "CSparseMatrix *", row_off: "size_t", col_off: "size_t", tol: "double"=1e-14) -> "bool": r""" return the number of non-zero in the matrix :type csc: CSparseMatrix :param csc: the compressed column sparse matrix :type row_off: int :param row_off: :type col_off: int :param col_off: :type tol: float, optional :param tol: the tolerance to consider a number zero (not used if the matrix is sparse) :rtype: boolean :return: the number of non-zeros """ return _sicpykernel.SiconosMatrix_fillTriplet(self, csc, row_off, col_off, tol)
def __str__(self) -> "std::string": return _sicpykernel.SiconosMatrix___str__(self) def __getitem__(self, args: "PyObject *") -> "PyObject *": return _sicpykernel.SiconosMatrix___getitem__(self, args) def __setitem__(self, args: "PyObject *", value: "double") -> "PyObject *": return _sicpykernel.SiconosMatrix___setitem__(self, args, value)
# Register SiconosMatrix in _sicpykernel: _sicpykernel.SiconosMatrix_swigregister(SiconosMatrix) def prod(*args) -> "void": return _sicpykernel.prod(*args)
[docs] class SimpleMatrix(SiconosMatrix): r""" Matrix (embedded various types of Boost matrices of double) SimpleMatrix is used in the platform to store matrices (mathematical object) of double. Possible types: Siconos::DENSE (default), TRIANGULAR, SYMMETRIC, SPARSE, BANDED, ZERO, Siconos::IDENTITY, Siconos::SPARSE_COORDINATE. TODO: : review resize function for Banded, Symetric and Triangular. Error in tests. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor with the type and the dimension of the Boost matrix :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type typ: int, optional :param typ: the type of matrix :type upper: int, optional :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :type lower: int, optional :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 3:* constructor with the type and the dimension of the Boost matrix :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type typ: int, optional :param typ: the type of matrix :type upper: int, optional :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 4:* constructor with the type and the dimension of the Boost matrix :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type typ: int, optional :param typ: the type of matrix :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 5:* constructor with the type and the dimension of the Boost matrix :type row: int :param row: number of rows. :type col: int :param col: number of columns. :param typ: the type of matrix :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 6:* constructor with the the dimensions of the Boost matrix, a default value and the type. :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type inputValue: float :param inputValue: double a, so that *this = [a a a ...] :type typ: int, optional :param typ: the type of matrix :type upper: int, optional :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :type lower: int, optional :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 7:* constructor with the the dimensions of the Boost matrix, a default value and the type. :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type inputValue: float :param inputValue: double a, so that *this = [a a a ...] :type typ: int, optional :param typ: the type of matrix :type upper: int, optional :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 8:* constructor with the the dimensions of the Boost matrix, a default value and the type. :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type inputValue: float :param inputValue: double a, so that *this = [a a a ...] :type typ: int, optional :param typ: the type of matrix :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 9:* constructor with the the dimensions of the Boost matrix, a default value and the type. :type row: int :param row: number of rows. :type col: int :param col: number of columns. :type inputValue: float :param inputValue: double a, so that *this = [a a a ...] :param typ: the type of matrix :param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal :param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal | *Overload 10:* copy constructor :type smat: :py:class:`SimpleMatrix` :param smat: the matrix to copy | *Overload 11:* copy constructor of a block given by the coord = [r0A r1A c0A c1A] :type A: :py:class:`SimpleMatrix` :param A: the matrix which contains the block to extract :type coord: Index :param coord: positions of the block to be extracted (row:start, row:end, col:start, col:end) | *Overload 12:* constructor with a DenseMat matrix (see SiconosMatrix.h for details) :type m: DenseMat :param m: a DenseMat | *Overload 13:* constructor with a TriangMat matrix (see SiconosMatrix.h for details) :type m: TriangMat :param m: a TriangMat | *Overload 14:* constructor with a SymMat matrix (see SiconosMatrix.h for details) :type m: SymMat :param m: a SymMat | *Overload 15:* constructor with a BandedMat matrix (see SiconosMatrix.h for details) :type m: BandedMat :param m: a BandedMat | *Overload 16:* constructor with a SparseMat matrix (see SiconosMatrix.h for details) :type m: SparseMat :param m: a SparseMat | *Overload 17:* constructor with a SparseCoordinateMat matrix (see SiconosMatrix.h for details) :type m: SparseCoordinateMat :param m: a SparseMat | *Overload 18:* constructor with a ZeroMat matrix (see SiconosMatrix.h for details) :type m: ZeroMat :param m: a ZeroMat | *Overload 19:* constructor with a IdentityMat matrix (see SiconosMatrix.h for details) :type m: IdentityMat :param m: a IdentityMat | *Overload 20:* constructor with an input file :type file: string :param file: the input file path :type ascii: boolean, optional :param ascii: a boolean to indicate if the file is in ascii | *Overload 21:* constructor with an input file :type file: string :param file: the input file path :param ascii: a boolean to indicate if the file is in ascii """ _sicpykernel.SimpleMatrix_swiginit(self, _sicpykernel.new_SimpleMatrix(*args)) __swig_destroy__ = _sicpykernel.delete_SimpleMatrix def updateNumericsMatrix(self) -> "void": return _sicpykernel.SimpleMatrix_updateNumericsMatrix(self) def numericsMatrix(self) -> "NumericsMatrix *": return _sicpykernel.SimpleMatrix_numericsMatrix(self)
[docs] def isPLUInversed(self) -> "bool": r""" determines if the matrix has been inversed :rtype: boolean :return: true if the matrix is inversed """ return _sicpykernel.SimpleMatrix_isPLUInversed(self)
[docs] def isPLUFactorized(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SimpleMatrix_isPLUFactorized(self)
[docs] def isPLUFactorizedInPlace(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SimpleMatrix_isPLUFactorizedInPlace(self)
[docs] def isCholeskyFactorized(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SimpleMatrix_isCholeskyFactorized(self)
[docs] def isCholeskyFactorizedInPlace(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SimpleMatrix_isCholeskyFactorizedInPlace(self)
[docs] def isQRFactorized(self) -> "bool": r""" determines if the matrix has been factorized :rtype: boolean :return: true if the matrix is factorized """ return _sicpykernel.SimpleMatrix_isQRFactorized(self)
def ipiv(self) -> "SP::VInt": return _sicpykernel.SimpleMatrix_ipiv(self)
[docs] def checkSymmetry(self, tol: "double") -> "bool": return _sicpykernel.SimpleMatrix_checkSymmetry(self, tol)
[docs] def getDense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat const": r""" get DenseMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: DenseMat :return: a DenseMat """ return _sicpykernel.SimpleMatrix_getDense(self, row, col)
[docs] def getTriang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat const": r""" get TriangMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: TriangMat :return: a TriangMat """ return _sicpykernel.SimpleMatrix_getTriang(self, row, col)
[docs] def getSym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat const": r""" get SymMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SymMat :return: a SymMat """ return _sicpykernel.SimpleMatrix_getSym(self, row, col)
[docs] def getBanded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat const": r""" get BandedMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: BandedMat :return: a BandedMat """ return _sicpykernel.SimpleMatrix_getBanded(self, row, col)
[docs] def getSparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat const": r""" get SparseMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SparseMat :return: a SparseMat """ return _sicpykernel.SimpleMatrix_getSparse(self, row, col)
[docs] def getSparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat const": r""" get SparseCoordinateMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SparseCoordinateMat :return: a SparseCoordinateMat """ return _sicpykernel.SimpleMatrix_getSparseCoordinate(self, row, col)
[docs] def getZero(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat const": r""" get ZeroMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: ZeroMat :return: a ZeroMat """ return _sicpykernel.SimpleMatrix_getZero(self, row, col)
[docs] def getIdentity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat const": r""" get getIdentity matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: IdentityMat :return: an IdentityMat """ return _sicpykernel.SimpleMatrix_getIdentity(self, row, col)
[docs] def dense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat *": r""" get a pointer on DenseMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: DenseMat :return: a DenseMat* """ return _sicpykernel.SimpleMatrix_dense(self, row, col)
[docs] def triang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat *": r""" get a pointer on TriangMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: TriangMat :return: a TriangMat* """ return _sicpykernel.SimpleMatrix_triang(self, row, col)
[docs] def sym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat *": r""" get a pointer on SymMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SymMat :return: a SymMat* """ return _sicpykernel.SimpleMatrix_sym(self, row, col)
[docs] def banded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat *": r""" get a pointer on BandedMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: BandedMat :return: a BandedMat* """ return _sicpykernel.SimpleMatrix_banded(self, row, col)
[docs] def sparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat *": r""" get a pointer on SparseMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SparseMat :return: a SparseMat* """ return _sicpykernel.SimpleMatrix_sparse(self, row, col)
[docs] def sparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat *": r""" get a pointer on SparseCoordinateMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: SparseCoordinateMat :return: a SparseCoordinateMat* """ return _sicpykernel.SimpleMatrix_sparseCoordinate(self, row, col)
[docs] def zero_mat(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat *": r""" get a pointer on ZeroMat matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: ZeroMat :return: a ZeroMat* """ return _sicpykernel.SimpleMatrix_zero_mat(self, row, col)
[docs] def identity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat *": r""" get a pointer on Identity matrix :type row: int, optional :param row: an unsigned int, position of the block - Useless for SimpleMatrix :type col: int, optional :param col: an unsigned int, position of the block - Useless for SimpleMatrix :rtype: IdentityMat :return: an IdentityMat* """ return _sicpykernel.SimpleMatrix_identity(self, row, col)
[docs] def getArray(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "double *": r""" return the address of the array of double values of the matrix :type row: int, optional :param row: position for the required block ->useless for SimpleMatrix :type col: int, optional :param col: position for the required block ->useless for SimpleMatrix :rtype: float :return: double* : the pointer on the double array """ return _sicpykernel.SimpleMatrix_getArray(self, row, col)
[docs] def zero(self) -> "void": r""" sets all the values of the matrix to 0.0""" return _sicpykernel.SimpleMatrix_zero(self)
[docs] def randomize(self) -> "void": r""" Initialize the matrix with random values""" return _sicpykernel.SimpleMatrix_randomize(self)
[docs] def randomize_sym(self) -> "void": r""" Initialize a symmetric matrix with random values""" return _sicpykernel.SimpleMatrix_randomize_sym(self)
[docs] def eye(self) -> "void": r""" set an identity matrix""" return _sicpykernel.SimpleMatrix_eye(self)
[docs] def copyData(self, data: "double *") -> "unsigned int": r""" copy the matrix data to the array given in parameter' Works only for dense matrices ! :type data: float :param data: array where the matrix is copied :rtype: int :return: the size of the matrix """ return _sicpykernel.SimpleMatrix_copyData(self, data)
def assign(self, smat: "SimpleMatrix") -> "void": return _sicpykernel.SimpleMatrix_assign(self, smat)
[docs] def size(self, index: "unsigned int") -> "unsigned int": r""" get the number of rows or columns of the matrix :type index: int :param index: 0 for rows, 1 for columns :rtype: int :return: the size """ return _sicpykernel.SimpleMatrix_size(self, index)
[docs] def resize(self, row: "unsigned int", col: "unsigned int", lower: "unsigned int"=0, upper: "unsigned int"=0, preserve: "bool"=True) -> "void": r""" resize the matrix with nbrow rows and nbcol columns The existing elements of the matrix are preseved when specified. :type row: int :param row: the new number of rows :type col: int :param col: the mew number of columns :type lower: int, optional :param lower: (only for Banded) :type upper: int, optional :param upper: (only for Banded) :type preserve: boolean, optional :param preserve: preserve existing elements """ return _sicpykernel.SimpleMatrix_resize(self, row, col, lower, upper, preserve)
[docs] def normInf(self) -> "double": r""" compute the infinite norm of the matrix :rtype: float :return: a double """ return _sicpykernel.SimpleMatrix_normInf(self)
[docs] def normInfByColumn(self, vIn: "SP::SiconosVector") -> "void": r""" Compute the normInf for each column :type vIn: :py:class:`SiconosVector` :param vIn: column """ return _sicpykernel.SimpleMatrix_normInfByColumn(self, vIn)
[docs] def det(self) -> "double": r""" compute the determinant of the matrix (use LU factorization) :rtype: float :return: a double """ return _sicpykernel.SimpleMatrix_det(self)
[docs] def display(self) -> "void": r""" display data on standard output""" return _sicpykernel.SimpleMatrix_display(self)
[docs] def displayExpert(self, brief: "bool"=True) -> "void": return _sicpykernel.SimpleMatrix_displayExpert(self, brief)
[docs] def toString(self) -> "std::string": r""" put data of the matrix into a std::string :rtype: string :return: std::string """ return _sicpykernel.SimpleMatrix_toString(self)
[docs] def getValue(self, i: "unsigned int", j: "unsigned int") -> "double": r""" return the element matrix[i,j] :type i: int :param i: an unsigned int :type j: int :param j: an unsigned int :rtype: float :return: a double """ return _sicpykernel.SimpleMatrix_getValue(self, i, j)
[docs] def setValue(self, i: "unsigned int", j: "unsigned int", value: "double") -> "void": r""" set the element matrix[i,j] :type i: int :param i: an unsigned int :type j: int :param j: an unsigned int :type value: float :param value: """ return _sicpykernel.SimpleMatrix_setValue(self, i, j, value)
[docs] def getRow(self, row: "unsigned int", vOut: "SiconosVector") -> "void": r""" get row index of current matrix and save it into vOut :type row: int :param row: index row we want to get :type vOut: :py:class:`SiconosVector`, out :param vOut: SiconosVector that will contain the desired row """ return _sicpykernel.SimpleMatrix_getRow(self, row, vOut)
[docs] def getCol(self, col: "unsigned int", vOut: "SiconosVector") -> "void": r""" get column index of current matrix and save it into vOut :type col: int :param col: index column we want to get :type vOut: :py:class:`SiconosVector`, out :param vOut: SiconosVector that will contain the desired column """ return _sicpykernel.SimpleMatrix_getCol(self, col, vOut)
[docs] def setRow(self, row: "unsigned int", vIn: "SiconosVector") -> "void": r""" set line row of the current matrix with vector v :type row: int :param row: index row we want to set :type vIn: :py:class:`SiconosVector` :param vIn: SiconosVector containing the new row """ return _sicpykernel.SimpleMatrix_setRow(self, row, vIn)
[docs] def setCol(self, col: "unsigned int", vIn: "SiconosVector") -> "void": r""" set column col of the current matrix with vector v :type col: int :param col: index column we want to set :type vIn: :py:class:`SiconosVector` :param vIn: a SiconosVector containing the new column """ return _sicpykernel.SimpleMatrix_setCol(self, col, vIn)
[docs] def getSubCol(self, index: "unsigned int", pos: "unsigned int", vOut: "SP::SiconosVector") -> "void": r""" get column number index of current matrix, starting from element at position pos and save it into vOut :type index: int :param index: index of required column :type pos: int :param pos: index of the first required element in the column :type vOut: :py:class:`SiconosVector`, out :param vOut: a SP::SiconosVector """ return _sicpykernel.SimpleMatrix_getSubCol(self, index, pos, vOut)
[docs] def getSubRow(self, index: "unsigned int", pos: "unsigned int", vOut: "SP::SiconosVector") -> "void": r""" get row number index of current matrix, starting from element at position pos and save it into vOut :type index: int :param index: index of the required row :type pos: int :param pos: index of the first required element in the row :type vOut: :py:class:`SiconosVector`, out :param vOut: a SP::SiconosVector that will contain the sub row """ return _sicpykernel.SimpleMatrix_getSubRow(self, index, pos, vOut)
[docs] def setSubCol(self, index: "unsigned int", pos: "unsigned int", vIn: "SP::SiconosVector") -> "void": r""" set column number index of current matrix, starting from element at position pos, with vIn :type index: int :param index: index of required column :type pos: int :param pos: index of the first required element in the column :type vIn: :py:class:`SiconosVector` :param vIn: a vector """ return _sicpykernel.SimpleMatrix_setSubCol(self, index, pos, vIn)
[docs] def setSubRow(self, index: "unsigned int", pos: "unsigned int", vIn: "SP::SiconosVector") -> "void": r""" set row number index of current matrix, starting from element at position pos, with vIn :type index: int :param index: index of required row :type pos: int :param pos: index of the first required element in the row :type vIn: :py:class:`SiconosVector` :param vIn: a vector """ return _sicpykernel.SimpleMatrix_setSubRow(self, index, pos, vIn)
[docs] def addBlock(self, i: "unsigned int", j: "unsigned int", m: "SiconosMatrix") -> "void": r""" add the input matrix to the elements starting from position i (row) and j (col). :type i: int :param i: an unsigned int :type j: int :param j: an unsigned int :type m: :py:class:`SiconosMatrix` :param m: a SiconosMatrix """ return _sicpykernel.SimpleMatrix_addBlock(self, i, j, m)
[docs] def subBlock(self, i: "unsigned int", j: "unsigned int", m: "SiconosMatrix") -> "void": r""" subtract the input matrix to the elements starting from position i (row) and j (col). :type i: int :param i: an unsigned int :type j: int :param j: an unsigned int :type m: :py:class:`SiconosMatrix` :param m: a SiconosMatrix """ return _sicpykernel.SimpleMatrix_subBlock(self, i, j, m)
[docs] def trans(self, *args) -> "void": r""" *Overload 1:* transpose in place: x->trans() is x = transpose of x. | *Overload 2:* transpose a matrix: x->trans(m) is x = transpose of m. :type mat: :py:class:`SiconosMatrix` :param mat: the matrix to be transposed. """ return _sicpykernel.SimpleMatrix_trans(self, *args)
def __copy__(self, *args) -> "SimpleMatrix &": r""" *Overload 1:* assignment :type m: :py:class:`SimpleMatrix` :param m: the matrix to be copied :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix | *Overload 2:* assignment to a DenseMat :type m: DenseMat :param m: the matrix to be copied :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.SimpleMatrix___copy__(self, *args) def __iadd__(self, m: "SiconosMatrix") -> "SimpleMatrix &": r""" operator += :type m: :py:class:`SiconosMatrix` :param m: a matrix to add :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.SimpleMatrix___iadd__(self, m) def __isub__(self, m: "SiconosMatrix") -> "SimpleMatrix &": r""" operator -= :type m: :py:class:`SiconosMatrix` :param m: a matrix to subtract :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.SimpleMatrix___isub__(self, m)
[docs] def PLUFactorizationInPlace(self) -> "void": r""" computes an LU factorization of a general M-by-N matrix using partial pivoting with row interchanges. The result is returned in this (InPlace). Based on Blas dgetrf function. """ return _sicpykernel.SimpleMatrix_PLUFactorizationInPlace(self)
[docs] def Factorize(self) -> "void": r""" computes a factorization of a general M-by-N matrix""" return _sicpykernel.SimpleMatrix_Factorize(self)
[docs] def PLUInverseInPlace(self) -> "void": r""" compute inverse of this thanks to LU factorization with Partial pivoting. This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A). The result is returned in this (InPlace). Based on Blas dgetri function. """ return _sicpykernel.SimpleMatrix_PLUInverseInPlace(self)
[docs] def solve_matrix(self, B: "SiconosMatrix") -> "void": return _sicpykernel.SimpleMatrix_solve_matrix(self, B)
[docs] def PLUForwardBackwardInPlace(self, *args) -> "void": r""" *Overload 1:* solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the LU factorization computed by PLUFactorizationInPlace. Based on Blas dgetrs function. :type B: :py:class:`SiconosMatrix`, in/out :param B: on input the RHS matrix b; on output the result x | *Overload 2:* solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the LU factorization computed by PLUFactorizationInPlace. Based on Blas dgetrs function. :type B: :py:class:`SiconosVector`, in/out :param B: on input the RHS matrix b; on output the result x """ return _sicpykernel.SimpleMatrix_PLUForwardBackwardInPlace(self, *args)
[docs] def solve_vector(self, B: "SiconosVector") -> "void": return _sicpykernel.SimpleMatrix_solve_vector(self, B)
[docs] def SolveByLeastSquares(self, *args) -> "void": r""" *Overload 1:* solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the Least squares method :type B: :py:class:`SiconosMatrix`, in/out :param B: on input the RHS matrix b; on output the result x | *Overload 2:* solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the Least squares method :type B: :py:class:`SiconosVector`, in/out :param B: on input the RHS matrix b; on output the result x """ return _sicpykernel.SimpleMatrix_SolveByLeastSquares(self, *args)
[docs] def resetLU(self) -> "void": r""" set to false all LU indicators. Useful in case of assignment for example. """ return _sicpykernel.SimpleMatrix_resetLU(self)
[docs] def resetCholesky(self) -> "void": r""" set to false all Cholesky indicators. Useful in case of assignment for example. """ return _sicpykernel.SimpleMatrix_resetCholesky(self)
[docs] def resetQR(self) -> "void": r""" set to false all QR indicators. Useful in case of assignment for example. """ return _sicpykernel.SimpleMatrix_resetQR(self)
[docs] def resetFactorizationFlags(self) -> "void": r""" set to false all factorization indicators. Useful in case of assignment for example. """ return _sicpykernel.SimpleMatrix_resetFactorizationFlags(self)
def __str__(self) -> "std::string": return _sicpykernel.SimpleMatrix___str__(self) def __getitem__(self, args: "PyObject *") -> "PyObject *": return _sicpykernel.SimpleMatrix___getitem__(self, args) def __setitem__(self, args: "PyObject *", value: "double") -> "PyObject *": return _sicpykernel.SimpleMatrix___setitem__(self, args, value)
# Register SimpleMatrix in _sicpykernel: _sicpykernel.SimpleMatrix_swigregister(SimpleMatrix) def __mul__(arg1: "SP::SimpleMatrix const", arg2: "SP::SimpleMatrix const") -> "SP::SimpleMatrix": return _sicpykernel.__mul__(arg1, arg2) def __iadd__(arg1: "SP::SiconosMatrix", arg2: "SP::SimpleMatrix") -> "void": return _sicpykernel.__iadd__(arg1, arg2) def __eq__(arg1: "SiconosMatrix", arg2: "SiconosMatrix") -> "bool": return _sicpykernel.__eq__(arg1, arg2) def __ne__(arg1: "SiconosMatrix", arg2: "SiconosMatrix") -> "bool": return _sicpykernel.__ne__(arg1, arg2)
[docs] class VECTOR_UBLAS_TYPE(object): r""" Union to gather all types of ublas vectors used in Siconos""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr Dense = property(_sicpykernel.VECTOR_UBLAS_TYPE_Dense_get, _sicpykernel.VECTOR_UBLAS_TYPE_Dense_set) Sparse = property(_sicpykernel.VECTOR_UBLAS_TYPE_Sparse_get, _sicpykernel.VECTOR_UBLAS_TYPE_Sparse_set) def __init__(self): _sicpykernel.VECTOR_UBLAS_TYPE_swiginit(self, _sicpykernel.new_VECTOR_UBLAS_TYPE()) __swig_destroy__ = _sicpykernel.delete_VECTOR_UBLAS_TYPE
# Register VECTOR_UBLAS_TYPE in _sicpykernel: _sicpykernel.VECTOR_UBLAS_TYPE_swigregister(VECTOR_UBLAS_TYPE)
[docs] class SiconosVector(object): r""" Vectors of double. (Interface to various types of Boost-Ublas vectors). Two possible types: Siconos::DENSE (default) and Siconos:SPARSE. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Creates a zero-size vector. | *Overload 2:* creates a vector, all components set to zero. :type row: int :param row: the size of the vector :type type: int, optional :param type: the type of vector (dense or sparse) | *Overload 3:* creates a vector, all components set to zero. :type row: int :param row: the size of the vector :param type: the type of vector (dense or sparse) | *Overload 4:* creates a vector and initializes its content with a single value :type row: int :param row: size of the new vector :type val: float :param val: value to initialize its content :type type: int, optional :param type: type of vector (dense or sparse) | *Overload 5:* creates a vector and initializes its content with a single value :type row: int :param row: size of the new vector :type val: float :param val: value to initialize its content :param type: type of vector (dense or sparse) | *Overload 6:* creates a dense vector from a copy of a stl vector. :type vec: std::vector< double,std::allocator< double > > :param vec: vector to be copied :type type: int, optional :param type: of the vector (dense or sparse) | *Overload 7:* creates a dense vector from a copy of a stl vector. :type vec: std::vector< double,std::allocator< double > > :param vec: vector to be copied :param type: of the vector (dense or sparse) | *Overload 8:* copy constructor :type v: :py:class:`SiconosVector` :param v: source vector to be copied | *Overload 9:* creates a dense vector, with a copy. :type v: DenseVect :param v: source vector (ublas dense) | *Overload 10:* creates a sparse vector, with a copy. :type v: SparseVect :param v: source vector (ublas sparse) | *Overload 11:* creates a vector from data in a file :type filename: string :param filename: file name (possibly with path) :type is_ascii: boolean :param is_ascii: file format (true if ascii, false if binary) | *Overload 12:* constructor from the concatenation of two vectors :type v1: :py:class:`SiconosVector` :param v1: the first vector :type v2: :py:class:`SiconosVector` :param v2: the second vector | *Overload 13:* constructor from a BlockVector. explicit to forbid implicit conversion/conversion constructor. :type input: :py:class:`BlockVector` :param input: source vector """ _sicpykernel.SiconosVector_swiginit(self, _sicpykernel.new_SiconosVector(*args)) __swig_destroy__ = _sicpykernel.delete_SiconosVector
[docs] def size(self) -> "unsigned int": r""" get the vector size, ie the total number of (double) elements in the vector :rtype: int :return: unsigned int """ return _sicpykernel.SiconosVector_size(self)
[docs] def num(self) -> "Siconos::UBLAS_TYPE": r""" Get the type number of the current vector. :rtype: int :return: an unsigned int """ return _sicpykernel.SiconosVector_num(self)
[docs] def dense(self) -> "DenseVect *": r""" get a pointer to the ublas embedded vector if it's type is Dense :rtype: DenseVect :return: a DenseVect* """ return _sicpykernel.SiconosVector_dense(self)
[docs] def sparse(self) -> "SparseVect *": r""" get a pointer to the ublas embedded vector if it's type is Sparse :rtype: SparseVect :return: a SparseVect* """ return _sicpykernel.SiconosVector_sparse(self)
[docs] def getArray(self) -> "double *": r""" :rtype: float :return: the array of double values of the vector """ return _sicpykernel.SiconosVector_getArray(self)
[docs] def zero(self) -> "void": r""" sets all the values of the vector to 0.0""" return _sicpykernel.SiconosVector_zero(self)
[docs] def resize(self, size: "unsigned int", preserve: "bool"=True) -> "void": r""" Resize the vector. The existing elements may be preseved if specified. :type size: int :param size: new size of the vector :type preserve: boolean, optional :param preserve: true if the content of the vector must be preserved. """ return _sicpykernel.SiconosVector_resize(self, size, preserve)
[docs] def normInf(self) -> "double": r""" :rtype: float :return: the infinite norm of the vector """ return _sicpykernel.SiconosVector_normInf(self)
[docs] def norm2(self) -> "double": r""" :rtype: float :return: the Euclidian norm of the vector """ return _sicpykernel.SiconosVector_norm2(self)
[docs] def vector_sum(self) -> "double": r""" :rtype: float :return: the sum of all elements of the vector """ return _sicpykernel.SiconosVector_vector_sum(self)
[docs] def display(self) -> "void": r""" display vector content""" return _sicpykernel.SiconosVector_display(self)
[docs] def fill(self, a: "double") -> "void": r""" set all values of the vector to input value. :type a: float :param a: input value """ return _sicpykernel.SiconosVector_fill(self, a)
[docs] def toString(self) -> "std::string": r""" :rtype: string :return: the content of the vector as a string """ return _sicpykernel.SiconosVector_toString(self)
[docs] def getValue(self, i: "unsigned int") -> "double": r""" Get a component of the vector :type i: int :param i: index of the required component :rtype: float :return: the component value """ return _sicpykernel.SiconosVector_getValue(self, i)
[docs] def setValue(self, i: "unsigned int", value: "double") -> "void": r""" set a component of the vector :type i: int :param i: index of the required component :type value: float :param value: of the component """ return _sicpykernel.SiconosVector_setValue(self, i, value)
def __call__(self, i: "unsigned int") -> "double &": r""" get a component of the vector :type i: int :param i: index of the required component :rtype: float :return: value of the component """ return _sicpykernel.SiconosVector___call__(self, i)
[docs] def toBlock(self, vOut: "SiconosVector", sizeB: "unsigned int", startIn: "unsigned int", startOut: "unsigned int") -> "void": r""" copy a part of the vector into another :type vOut: :py:class:`SiconosVector` :param vOut: destination vector :type sizeB: int :param sizeB: number of the elements to copy :type startIn: int :param startIn: the beginning of the range of elements to copy from :type startOut: int :param startOut: the beginning of the destination range """ return _sicpykernel.SiconosVector_toBlock(self, vOut, sizeB, startIn, startOut)
[docs] def addBlock(self, i: "unsigned int", v: "SiconosVector") -> "void": r""" add the input vector to a sub-block of the current vector :type i: int :param i: the beginning of the destination range :type v: :py:class:`SiconosVector` :param v: the source vector to be added """ return _sicpykernel.SiconosVector_addBlock(self, i, v)
[docs] def subBlock(self, i: "unsigned int", v: "SiconosVector") -> "void": r""" subtract the input vector to a sub-block of the current vector :type i: int :param i: the beginning of the destination range :type v: :py:class:`SiconosVector` :param v: the source vector to be added """ return _sicpykernel.SiconosVector_subBlock(self, i, v)
[docs] def copyData(self, data: "double *") -> "unsigned int": r""" copy the vector into an array :type data: float :param data: the memory where to copy the data :rtype: int :return: the number of element written (size of the vector) """ return _sicpykernel.SiconosVector_copyData(self, data)
def __copy__(self, *args) -> "SiconosVector &": r""" *Overload 1:* operator = :type v: :py:class:`SiconosVector` :param v: the vector to be copied :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 2:* operator = :type b: :py:class:`BlockVector` :param b: the vector to be copied :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 3:* operator = :type v: DenseVect :param v: the vector to be copied :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 4:* operator = :type sp: SparseVect :param sp: the vector to be copied :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 5:* operator = :type d: float :param d: data to put the in vector :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.SiconosVector___copy__(self, *args) def __iadd__(self, *args) -> "SiconosVector &": r""" *Overload 1:* operator += :type v: :py:class:`SiconosVector` :param v: the vector to add :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 2:* operator += :type v: :py:class:`BlockVector` :param v: the vector to add :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.SiconosVector___iadd__(self, *args) def __isub__(self, *args) -> "SiconosVector &": r""" *Overload 1:* operator -= :type v: :py:class:`SiconosVector` :param v: the vector to subtract :rtype: :py:class:`SiconosVector` :return: SiconosVector | *Overload 2:* operator -= :type v: :py:class:`BlockVector` :param v: the vector to subtract :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.SiconosVector___isub__(self, *args) def __str__(self) -> "std::string": return _sicpykernel.SiconosVector___str__(self) def __getitem__(self, i: "size_t") -> "PyObject *": return _sicpykernel.SiconosVector___getitem__(self, i) def __setitem__(self, i: "size_t", value: "double") -> "PyObject *": return _sicpykernel.SiconosVector___setitem__(self, i, value) def __len__(self) -> "double": return _sicpykernel.SiconosVector___len__(self) def __iter__(self) -> "SiconosVectorIterator": return _sicpykernel.SiconosVector___iter__(self) def __array__(self): import numpy return numpy.fromiter(self, dtype=float)
# Register SiconosVector in _sicpykernel: _sicpykernel.SiconosVector_swigregister(SiconosVector) def __imul__(*args) -> "SiconosVector &": return _sicpykernel.__imul__(*args) def __idiv__(*args) -> "SiconosVector &": return _sicpykernel.__idiv__(*args) def abs_wise(arg1: "SiconosVector", arg2: "SiconosVector") -> "void": return _sicpykernel.abs_wise(arg1, arg2) def getMax(arg1: "SiconosVector", arg2: "double &", arg3: "unsigned int &") -> "void": return _sicpykernel.getMax(arg1, arg2, arg3) def getMin(arg1: "SiconosVector", arg2: "double &", arg3: "unsigned int &") -> "void": return _sicpykernel.getMin(arg1, arg2, arg3) class TestDense(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __call__(self, input: "SP::SiconosVector") -> "bool": return _sicpykernel.TestDense___call__(self, input) def __init__(self): _sicpykernel.TestDense_swiginit(self, _sicpykernel.new_TestDense()) __swig_destroy__ = _sicpykernel.delete_TestDense # Register TestDense in _sicpykernel: _sicpykernel.TestDense_swigregister(TestDense) class SiconosVectorIterator(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): _sicpykernel.SiconosVectorIterator_swiginit(self, _sicpykernel.new_SiconosVectorIterator(*args)) def __iter__(self): return SiconosVectorIterator(self) def next(self) -> "PyObject *": return _sicpykernel.SiconosVectorIterator_next(self) __next__ = next __swig_destroy__ = _sicpykernel.delete_SiconosVectorIterator # Register SiconosVectorIterator in _sicpykernel: _sicpykernel.SiconosVectorIterator_swigregister(SiconosVectorIterator) class SiconosVectorConstIterator(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): _sicpykernel.SiconosVectorConstIterator_swiginit(self, _sicpykernel.new_SiconosVectorConstIterator(*args)) __swig_destroy__ = _sicpykernel.delete_SiconosVectorConstIterator # Register SiconosVectorConstIterator in _sicpykernel: _sicpykernel.SiconosVectorConstIterator_swigregister(SiconosVectorConstIterator)
[docs] class BlockVector(object): r""" "Block" vector : container (list) of SiconosVector A block vector is a stl vector that handles pointers to SiconosVector. Insertion of nullptr SP::SiconosVector is not allowed. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default contructor | *Overload 2:* copy contructor :type v: :py:class:`BlockVector` :param v: BlockVector | *Overload 3:* contructor with 2 SiconosVectors :type v1: :py:class:`SiconosVector` :param v1: first vector :type v2: :py:class:`SiconosVector` :param v2: second vector | *Overload 4:* contructor with a BlockVector of n (numberOfBlocks) blocks of the same size (dim) filled with a new vector :type numberOfBlocks: int :param numberOfBlocks: number of blocks :type dim: int :param dim: dimension of the vector | *Overload 5:* contructor with a BlockVector of n (numberOfBlocks) blocks that point on nullptr :type numberOfBlocks: int :param numberOfBlocks: number of blocks """ _sicpykernel.BlockVector_swiginit(self, _sicpykernel.new_BlockVector(*args)) __swig_destroy__ = _sicpykernel.delete_BlockVector
[docs] def size(self) -> "unsigned int": r""" :rtype: int :return: the size of the vector (sum of the sizes of all its blocks) """ return _sicpykernel.BlockVector_size(self)
[docs] def begin(self) -> "VectorOfVectors::iterator": r""" :rtype: VectorOfVectors::iterator :return: an iterator pointing to the first block in the container. """ return _sicpykernel.BlockVector_begin(self)
[docs] def end(self) -> "VectorOfVectors::iterator": r""" :rtype: VectorOfVectors::iterator :return: an iterator referring to the past-the-end element in the container. """ return _sicpykernel.BlockVector_end(self)
[docs] def getAllVect(self) -> "VectorOfVectors": r""" :rtype: :py:class:`VectorOfVectors` :return: the complete stl container """ return _sicpykernel.BlockVector_getAllVect(self)
[docs] def numberOfBlocks(self) -> "Index::size_type": r""" :rtype: Index::size_type :return: the number of SiconosVectors in the container """ return _sicpykernel.BlockVector_numberOfBlocks(self)
[docs] def isDense(self) -> "bool": r""" :rtype: boolean :return: true if all SiconosVector in the container are dense * """ return _sicpykernel.BlockVector_isDense(self)
[docs] def zero(self) -> "void": r""" sets all the values of the vector to 0.0""" return _sicpykernel.BlockVector_zero(self)
[docs] def fill(self, a: "double") -> "void": r""" set all values of the vector component to value. :type a: float :param a: double """ return _sicpykernel.BlockVector_fill(self, a)
[docs] def display(self) -> "void": r""" display data on standard output""" return _sicpykernel.BlockVector_display(self)
[docs] def toString(self) -> "std::string": r""" put data of the vector into a std::string :rtype: string :return: std::string """ return _sicpykernel.BlockVector_toString(self)
[docs] def getValue(self, i: "unsigned int") -> "double": r""" Get a component of the vector :type i: int :param i: index of the required component :rtype: float :return: the component value """ return _sicpykernel.BlockVector_getValue(self, i)
[docs] def setValue(self, i: "unsigned int", value: "double") -> "void": r""" set a component of the vector :type i: int :param i: index of the required component :type value: float :param value: of the component """ return _sicpykernel.BlockVector_setValue(self, i, value)
def __call__(self, i: "unsigned int") -> "double &": r""" get a component of the vector :type i: int :param i: index of the required component :rtype: float :return: value of the component """ return _sicpykernel.BlockVector___call__(self, i)
[docs] def vector(self, pos: "unsigned int") -> "SP::SiconosVector": r""" get a block (SiconosVector) of the vector :type pos: int :param pos: index of the required block :rtype: :py:class:`SiconosVector` :return: the expected block """ return _sicpykernel.BlockVector_vector(self, pos)
[docs] def setVector(self, pos: "unsigned int", v: "SiconosVector") -> "void": r""" set a block with a given vector (copy!) :type pos: int :param pos: index of the block to set :type v: :py:class:`SiconosVector` :param v: source vector to be copied at position i """ return _sicpykernel.BlockVector_setVector(self, pos, v)
[docs] def setVectorPtr(self, pos: "unsigned int", v: "SP::SiconosVector") -> "void": r""" set a block with a given vector (pointer link!) :type pos: int :param pos: index of the block to set :type v: :py:class:`SiconosVector` :param v: source vector to be inserted at position i """ return _sicpykernel.BlockVector_setVectorPtr(self, pos, v)
[docs] def setAllVect(self, v: "VectorOfVectors") -> "void": r""" Fill the container with a list of SiconosVector. Warning: pointer links, no copy :type v: :py:class:`VectorOfVectors` :param v: the vectors to be inserted """ return _sicpykernel.BlockVector_setAllVect(self, v)
[docs] def tabIndex(self) -> "SP::Index const": r""" :rtype: SP::Index :return: a pointer to the index tab """ return _sicpykernel.BlockVector_tabIndex(self)
[docs] def getNumVectorAtPos(self, pos: "unsigned int") -> "unsigned int": r""" get the number of the vector that handles element at position "pos" :type pos: int :param pos: unsigned int, position of the element :rtype: int :return: unsigned int number of the searched vector """ return _sicpykernel.BlockVector_getNumVectorAtPos(self, pos)
def __copy__(self, *args) -> "BlockVector &": r""" *Overload 1:* Assignment operator :type vIn: :py:class:`BlockVector` :param vIn: the vector to be copied :rtype: :py:class:`BlockVector` :return: BlockVector | *Overload 2:* Assignment operator :type data: float :param data: data to put in the BlockVector :rtype: :py:class:`BlockVector` :return: BlockVector | *Overload 3:* Assignment operator :type vIn: :py:class:`SiconosVector` :param vIn: the vector to be copied :rtype: :py:class:`BlockVector` :return: BlockVector """ return _sicpykernel.BlockVector___copy__(self, *args) def __iadd__(self, *args) -> "BlockVector &": r""" *Overload 1:* Add in place operator :param vIn: rhs of the operator :rtype: :py:class:`BlockVector` :return: BlockVector | *Overload 2:* Add in place operator :type vIn: :py:class:`SiconosVector` :param vIn: rhs of the operator :rtype: :py:class:`BlockVector` :return: BlockVector """ return _sicpykernel.BlockVector___iadd__(self, *args) def __isub__(self, *args) -> "BlockVector &": r""" *Overload 1:* Subtract in place operator :type vIn: :py:class:`BlockVector` :param vIn: rhs of the operator :rtype: :py:class:`BlockVector` :return: BlockVector | *Overload 2:* Subtract in place operator :type vIn: :py:class:`SiconosVector` :param vIn: rhs of the operator :rtype: :py:class:`BlockVector` :return: BlockVector """ return _sicpykernel.BlockVector___isub__(self, *args) def __imul__(self, s: "double") -> "BlockVector &": r""" multiply by a scalar, result in place :type s: float :param s: the scalar factor :rtype: :py:class:`BlockVector` :return: BlockVector """ return _sicpykernel.BlockVector___imul__(self, s) def __itruediv__(self, *args): return _sicpykernel.BlockVector___idiv__(self, *args) __idiv__ = __itruediv__
[docs] def insertPtr(self, v: "SP::SiconosVector") -> "void": r""" Insert a new block (no allocation and nor copy) :type v: :py:class:`SiconosVector` :param v: the vector to be inserted """ return _sicpykernel.BlockVector_insertPtr(self, v)
[docs] def norm2(self) -> "double": r""" :rtype: float :return: the Euclidian norm of the vector """ return _sicpykernel.BlockVector_norm2(self)
[docs] def normInf(self) -> "double": r""" :rtype: float :return: the infinite norm of the vector """ return _sicpykernel.BlockVector_normInf(self)
[docs] def prepareVectorForPlugin(self) -> "SP::SiconosVector": r""" Tranform a BlockVector into a SiconosVector. Required for plugins, that need contiguous memory for their parameters. :rtype: :py:class:`SiconosVector` :return: a vector (the result depends on the number of blocks in input. 1 block : link to first component of the container, more : copy of all components into a SiconosVector) """ return _sicpykernel.BlockVector_prepareVectorForPlugin(self)
def __str__(self) -> "std::string": return _sicpykernel.BlockVector___str__(self)
# Register BlockVector in _sicpykernel: _sicpykernel.BlockVector_swigregister(BlockVector)
[docs] class Callback(object): r""" Structure used to store user callbacks inside solvers""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr env = property(_sicpykernel.Callback_env_get, _sicpykernel.Callback_env_set, doc=r""" general user environment""") collectStatsIteration = property(_sicpykernel.Callback_collectStatsIteration_get, _sicpykernel.Callback_collectStatsIteration_set, doc=r""" pointer on a function Its signature is: user env, problem size, reaction, velocity, error at end of solver iteration (when this makes sense) and an extra data structure """) def __init__(self): _sicpykernel.Callback_swiginit(self, _sicpykernel.new_Callback()) __swig_destroy__ = _sicpykernel.delete_Callback
# Register Callback in _sicpykernel: _sicpykernel.Callback_swigregister(Callback) OPTIONS_PARAM_SIZE = _sicpykernel.OPTIONS_PARAM_SIZE
[docs] class SolverOptions(object): r""" Structure used to send options (name, parameters and so on) to a specific solver (mainly from Kernel to Numerics). Creation, update and destruction: - solver_options_create() - solver_options_update_internal() - solver_options_delete() Details in users'guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr solverId = property(_sicpykernel.SolverOptions_solverId_get, _sicpykernel.SolverOptions_solverId_set, doc=r""" id number of the solver.""") isSet = property(_sicpykernel.SolverOptions_isSet_get, _sicpykernel.SolverOptions_isSet_set, doc=r""" true(1) if the structure is ready to be used by a numerics driver. """) iSize = property(_sicpykernel.SolverOptions_iSize_get, _sicpykernel.SolverOptions_iSize_set, doc=r""" iSize size of vector iparam""") iparam = property(_sicpykernel.SolverOptions_iparam_get, _sicpykernel.SolverOptions_iparam_set, doc=r""" list of solver parameters (integer type); Check solvers doc for details. """) dSize = property(_sicpykernel.SolverOptions_dSize_get, _sicpykernel.SolverOptions_dSize_set, doc=r""" size of vector dparam""") dparam = property(_sicpykernel.SolverOptions_dparam_get, _sicpykernel.SolverOptions_dparam_set, doc=r""" list of solver parameters (double type); Check solvers doc for details. """) filterOn = property(_sicpykernel.SolverOptions_filterOn_get, _sicpykernel.SolverOptions_filterOn_set, doc=r""" if true (1), check solution validity after the driver call. Default = 1. For example if filterOn = 1 for a LCP, lcp_compute_error() will be called at the end of the process). """) dWorkSize = property(_sicpykernel.SolverOptions_dWorkSize_get, _sicpykernel.SolverOptions_dWorkSize_set, doc=r""" size of double type internal work array.""") dWork = property(_sicpykernel.SolverOptions_dWork_get, _sicpykernel.SolverOptions_dWork_set, doc=r""" internal (double type) work array.""") iWorkSize = property(_sicpykernel.SolverOptions_iWorkSize_get, _sicpykernel.SolverOptions_iWorkSize_set, doc=r""" size of integer type internal work array.""") iWork = property(_sicpykernel.SolverOptions_iWork_get, _sicpykernel.SolverOptions_iWork_set, doc=r""" internal (integer type) work array.""") numberOfInternalSolvers = property(_sicpykernel.SolverOptions_numberOfInternalSolvers_get, _sicpykernel.SolverOptions_numberOfInternalSolvers_set, doc=r""" the number of internal or local 'sub-solvers' used by the solver (size of internalSolvers) . """) internalSolvers = property(_sicpykernel.SolverOptions_internalSolvers_get, _sicpykernel.SolverOptions_internalSolvers_set, doc=r""" list of internal solver options""") callback = property(_sicpykernel.SolverOptions_callback_get, _sicpykernel.SolverOptions_callback_set, doc=r""" pointer to user-defined callback""") solverParameters = property(_sicpykernel.SolverOptions_solverParameters_get, _sicpykernel.SolverOptions_solverParameters_set, doc=r""" additional parameters specific to the solver (GAMS and NewtonMethod only) """) solverData = property(_sicpykernel.SolverOptions_solverData_get, _sicpykernel.SolverOptions_solverData_set, doc=r""" additional data specific to the solver""") def __init__(self): _sicpykernel.SolverOptions_swiginit(self, _sicpykernel.new_SolverOptions()) __swig_destroy__ = _sicpykernel.delete_SolverOptions
# Register SolverOptions in _sicpykernel: _sicpykernel.SolverOptions_swigregister(SolverOptions) SICONOS_IPARAM_MAX_ITER = _sicpykernel.SICONOS_IPARAM_MAX_ITER SICONOS_IPARAM_ITER_DONE = _sicpykernel.SICONOS_IPARAM_ITER_DONE SICONOS_IPARAM_PREALLOC = _sicpykernel.SICONOS_IPARAM_PREALLOC SICONOS_IPARAM_NSGS_SHUFFLE = _sicpykernel.SICONOS_IPARAM_NSGS_SHUFFLE SICONOS_IPARAM_ERROR_EVALUATION = _sicpykernel.SICONOS_IPARAM_ERROR_EVALUATION SICONOS_IPARAM_PATHSEARCH_STACKSIZE = _sicpykernel.SICONOS_IPARAM_PATHSEARCH_STACKSIZE SICONOS_ERROR_FULL_EVALUATION = _sicpykernel.SICONOS_ERROR_FULL_EVALUATION r""" Complete error computation, including v computation""" SICONOS_ERROR_LIGHT_EVALUATION = _sicpykernel.SICONOS_ERROR_LIGHT_EVALUATION r""" Light error computation with incremental values on r verification of absolute error at the end """ SICONOS_ERROR_LIGHT_EVALUATION_NO_UPDATE = _sicpykernel.SICONOS_ERROR_LIGHT_EVALUATION_NO_UPDATE r""" only light error computation, do not update v unknown)""" SICONOS_DPARAM_TOL = _sicpykernel.SICONOS_DPARAM_TOL SICONOS_DPARAM_RESIDU = _sicpykernel.SICONOS_DPARAM_RESIDU
[docs] def solver_options_print(options: "SolverOptions") -> "void": r""" screen display of solver parameters :type options: :py:class:`SolverOptions` :param options: the structure to be displayed """ return _sicpykernel.solver_options_print(options)
[docs] def solver_options_delete(options: "SolverOptions") -> "void": r""" Clear and free all pointer members of the structure, then release memory :type options: :py:class:`SolverOptions` :param options: the structure to be cleared. """ return _sicpykernel.solver_options_delete(options)
[docs] def solver_options_create(solverId: "int") -> "SolverOptions *": r""" Create and initialize a SolverOptions struct: allocate internal memories, set default values depending on the id. :param id: solver id number It must belong to one of the available ids defined for each formulation, see users'guide for details :rtype: :py:class:`SolverOptions` :return: a pointer to options set, ready to use by a driver. """ return _sicpykernel.solver_options_create(solverId)
[docs] def solver_options_copy(source: "SolverOptions") -> "SolverOptions *": r""" Copy an existing set of options, to create a new one. Warning : callback, solverData and solverParameters of the new structure are pointer links to those of the original one! :type source: :py:class:`SolverOptions` :param source: an existing solver options structure :rtype: :py:class:`SolverOptions` :return: a pointer to options set, ready to use by a driver. """ return _sicpykernel.solver_options_copy(source)
[docs] def solver_options_update_internal(parent: "SolverOptions", internal_solver_number: "size_t", solver_id: "int") -> "void": r""" Change one of the internal solver of a previously defined SolverOptions set. Allocate internal memories and set default values for the internal solver. Warning : the actual internal solver in position internal_solver_number and all its content will be destroyed and replaced by a new one. :type parent: :py:class:`SolverOptions` :param parent: the top-level SolverOptions which contains the internal solver to be updated :type internal_solver_number: int :param internal_solver_number: number of the internal solver to be update (warning : this is the position in the list of internal solvers, not the id!) :type solver_id: int :param solver_id: id number of the new internal solver to be created/updated """ return _sicpykernel.solver_options_update_internal(parent, internal_solver_number, solver_id)
[docs] def solver_options_name_to_id(pName: "char const *") -> "int": r""" return the id of a solver based on its name :type pName: string :param pName: the name of the solver :rtype: int :return: the id of the solver or 0 if it failed """ return _sicpykernel.solver_options_name_to_id(pName)
[docs] def solver_options_id_to_name(Id: "int") -> "char const *": r""" return the name of a solver given its id :type Id: int :param Id: the id of the solver :rtype: string :return: the name of the solver """ return _sicpykernel.solver_options_id_to_name(Id)
[docs] def solver_options_get_internal_solver(options: "SolverOptions", n: "size_t") -> "SolverOptions *": r""" return the internal solver options set :type options: :py:class:`SolverOptions` :param options: parent options :param number: of the targeted solver :rtype: :py:class:`SolverOptions` :return: a pointer to the internal solver options set """ return _sicpykernel.solver_options_get_internal_solver(options, n)
[docs] def solver_options_set_internal_solver(options: "SolverOptions", n: "size_t", NSO: "SolverOptions") -> "void": r""" set internal solver :type options: :py:class:`SolverOptions` :param options: parent options :param number: of the targeted solver :param the: solver options to be used as internal solver number n """ return _sicpykernel.solver_options_set_internal_solver(options, n, NSO)
LEVELMAX = _sicpykernel.LEVELMAX r""" Internal bound max levels for time integrators. This value may be checked to see if initialization has occured. """ class InteractionsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def interactions(self) -> "PyObject *": return _sicpykernel.InteractionsGraph_interactions(self) def dynamicalSystems(self) -> "PyObject *": return _sicpykernel.InteractionsGraph_dynamicalSystems(self) def __init__(self): _sicpykernel.InteractionsGraph_swiginit(self, _sicpykernel.new_InteractionsGraph()) __swig_destroy__ = _sicpykernel.delete_InteractionsGraph # Register InteractionsGraph in _sicpykernel: _sicpykernel.InteractionsGraph_swigregister(InteractionsGraph) class DynamicalSystemsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def interactions(self) -> "PyObject *": return _sicpykernel.DynamicalSystemsGraph_interactions(self) def dynamicalSystems(self) -> "PyObject *": return _sicpykernel.DynamicalSystemsGraph_dynamicalSystems(self) def __init__(self): _sicpykernel.DynamicalSystemsGraph_swiginit(self, _sicpykernel.new_DynamicalSystemsGraph()) __swig_destroy__ = _sicpykernel.delete_DynamicalSystemsGraph # Register DynamicalSystemsGraph in _sicpykernel: _sicpykernel.DynamicalSystemsGraph_swigregister(DynamicalSystemsGraph) vertex_properties = _sicpykernel.vertex_properties edge_properties = _sicpykernel.edge_properties graph_properties = _sicpykernel.graph_properties vertex_siconos_bundle = _sicpykernel.vertex_siconos_bundle edge_siconos_bundle = _sicpykernel.edge_siconos_bundle class _DynamicalSystemsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _stamp = property(_sicpykernel._DynamicalSystemsGraph__stamp_get, _sicpykernel._DynamicalSystemsGraph__stamp_set) vertex_descriptor = property(_sicpykernel._DynamicalSystemsGraph_vertex_descriptor_get, _sicpykernel._DynamicalSystemsGraph_vertex_descriptor_set) def __init__(self): r""" default constructor""" _sicpykernel._DynamicalSystemsGraph_swiginit(self, _sicpykernel.new__DynamicalSystemsGraph()) __swig_destroy__ = _sicpykernel.delete__DynamicalSystemsGraph def storage(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::graph_t const &": return _sicpykernel._DynamicalSystemsGraph_storage(self) def edge(self, u: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor", v: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor,bool >": return _sicpykernel._DynamicalSystemsGraph_edge(self, u, v) def edge_exists(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "bool": return _sicpykernel._DynamicalSystemsGraph_edge_exists(self, vd1, vd2) def is_edge(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< Interaction > const &") -> "bool": return _sicpykernel._DynamicalSystemsGraph_is_edge(self, vd1, vd2, e_bundle) def adjacent_vertex_exists(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "bool": return _sicpykernel._DynamicalSystemsGraph_adjacent_vertex_exists(self, vd) def size(self) -> "size_t": return _sicpykernel._DynamicalSystemsGraph_size(self) def vertices_number(self) -> "size_t": return _sicpykernel._DynamicalSystemsGraph_vertices_number(self) def edges_number(self) -> "size_t": return _sicpykernel._DynamicalSystemsGraph_edges_number(self) def properties(self, *args) -> "InteractionProperties &": return _sicpykernel._DynamicalSystemsGraph_properties(self, *args) def is_vertex(self, vertex: "std::shared_ptr< DynamicalSystem > const &") -> "bool": return _sicpykernel._DynamicalSystemsGraph_is_vertex(self, vertex) def descriptor(self, vertex: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &": return _sicpykernel._DynamicalSystemsGraph_descriptor(self, vertex) def vertices(self) -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator >": return _sicpykernel._DynamicalSystemsGraph_vertices(self) def begin(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator": return _sicpykernel._DynamicalSystemsGraph_begin(self) def end(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator": return _sicpykernel._DynamicalSystemsGraph_end(self) def adjacent_vertices(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::AVIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::AVIterator >": return _sicpykernel._DynamicalSystemsGraph_adjacent_vertices(self, vd) def edges(self, *args) -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EIterator >": return _sicpykernel._DynamicalSystemsGraph_edges(self, *args) def out_edges(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::OEIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::OEIterator >": return _sicpykernel._DynamicalSystemsGraph_out_edges(self, vd) def target(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor": return _sicpykernel._DynamicalSystemsGraph_target(self, ed) def source(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor": return _sicpykernel._DynamicalSystemsGraph_source(self, ed) def add_vertex(self, vertex_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor": return _sicpykernel._DynamicalSystemsGraph_add_vertex(self, vertex_bundle) def remove_vertex(self, vertex_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "void": return _sicpykernel._DynamicalSystemsGraph_remove_vertex(self, vertex_bundle) def add_edge(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor": return _sicpykernel._DynamicalSystemsGraph_add_edge(self, vd1, vd2, e_bundle) def remove_edge(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "void": return _sicpykernel._DynamicalSystemsGraph_remove_edge(self, ed) def stamp(self) -> "int": return _sicpykernel._DynamicalSystemsGraph_stamp(self) def update_vertices_indices(self) -> "void": return _sicpykernel._DynamicalSystemsGraph_update_vertices_indices(self) def update_edges_indices(self) -> "void": return _sicpykernel._DynamicalSystemsGraph_update_edges_indices(self) def clear(self) -> "void": return _sicpykernel._DynamicalSystemsGraph_clear(self) def vertex_descriptor_map(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VMap": return _sicpykernel._DynamicalSystemsGraph_vertex_descriptor_map(self) def display(self) -> "void": return _sicpykernel._DynamicalSystemsGraph_display(self) # Register _DynamicalSystemsGraph in _sicpykernel: _sicpykernel._DynamicalSystemsGraph_swigregister(_DynamicalSystemsGraph) class SP_DynamicalSystemsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): _sicpykernel.SP_DynamicalSystemsGraph_swiginit(self, _sicpykernel.new_SP_DynamicalSystemsGraph()) __swig_destroy__ = _sicpykernel.delete_SP_DynamicalSystemsGraph # Register SP_DynamicalSystemsGraph in _sicpykernel: _sicpykernel.SP_DynamicalSystemsGraph_swigregister(SP_DynamicalSystemsGraph) class _InteractionsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _stamp = property(_sicpykernel._InteractionsGraph__stamp_get, _sicpykernel._InteractionsGraph__stamp_set) vertex_descriptor = property(_sicpykernel._InteractionsGraph_vertex_descriptor_get, _sicpykernel._InteractionsGraph_vertex_descriptor_set) def __init__(self): r""" default constructor""" _sicpykernel._InteractionsGraph_swiginit(self, _sicpykernel.new__InteractionsGraph()) __swig_destroy__ = _sicpykernel.delete__InteractionsGraph def storage(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::graph_t const &": return _sicpykernel._InteractionsGraph_storage(self) def edge(self, u: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor", v: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor,bool >": return _sicpykernel._InteractionsGraph_edge(self, u, v) def edge_exists(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "bool": return _sicpykernel._InteractionsGraph_edge_exists(self, vd1, vd2) def is_edge(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "bool": return _sicpykernel._InteractionsGraph_is_edge(self, vd1, vd2, e_bundle) def adjacent_vertex_exists(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "bool": return _sicpykernel._InteractionsGraph_adjacent_vertex_exists(self, vd) def size(self) -> "size_t": return _sicpykernel._InteractionsGraph_size(self) def vertices_number(self) -> "size_t": return _sicpykernel._InteractionsGraph_vertices_number(self) def edges_number(self) -> "size_t": return _sicpykernel._InteractionsGraph_edges_number(self) def properties(self, *args) -> "DynamicalSystemProperties &": return _sicpykernel._InteractionsGraph_properties(self, *args) def is_vertex(self, vertex: "std::shared_ptr< Interaction > const &") -> "bool": return _sicpykernel._InteractionsGraph_is_vertex(self, vertex) def descriptor(self, vertex: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &": return _sicpykernel._InteractionsGraph_descriptor(self, vertex) def vertices(self) -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator >": return _sicpykernel._InteractionsGraph_vertices(self) def begin(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator": return _sicpykernel._InteractionsGraph_begin(self) def end(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator": return _sicpykernel._InteractionsGraph_end(self) def adjacent_vertices(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::AVIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::AVIterator >": return _sicpykernel._InteractionsGraph_adjacent_vertices(self, vd) def edges(self, *args) -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EIterator >": return _sicpykernel._InteractionsGraph_edges(self, *args) def out_edges(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::OEIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::OEIterator >": return _sicpykernel._InteractionsGraph_out_edges(self, vd) def target(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor": return _sicpykernel._InteractionsGraph_target(self, ed) def source(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor": return _sicpykernel._InteractionsGraph_source(self, ed) def add_vertex(self, vertex_bundle: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor": return _sicpykernel._InteractionsGraph_add_vertex(self, vertex_bundle) def remove_vertex(self, vertex_bundle: "std::shared_ptr< Interaction > const &") -> "void": return _sicpykernel._InteractionsGraph_remove_vertex(self, vertex_bundle) def add_edge(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor": return _sicpykernel._InteractionsGraph_add_edge(self, vd1, vd2, e_bundle) def remove_edge(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "void": return _sicpykernel._InteractionsGraph_remove_edge(self, ed) def stamp(self) -> "int": return _sicpykernel._InteractionsGraph_stamp(self) def update_vertices_indices(self) -> "void": return _sicpykernel._InteractionsGraph_update_vertices_indices(self) def update_edges_indices(self) -> "void": return _sicpykernel._InteractionsGraph_update_edges_indices(self) def clear(self) -> "void": return _sicpykernel._InteractionsGraph_clear(self) def vertex_descriptor_map(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VMap": return _sicpykernel._InteractionsGraph_vertex_descriptor_map(self) def display(self) -> "void": return _sicpykernel._InteractionsGraph_display(self) # Register _InteractionsGraph in _sicpykernel: _sicpykernel._InteractionsGraph_swigregister(_InteractionsGraph) class SP_InteractionsGraph(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): _sicpykernel.SP_InteractionsGraph_swiginit(self, _sicpykernel.new_SP_InteractionsGraph()) __swig_destroy__ = _sicpykernel.delete_SP_InteractionsGraph # Register SP_InteractionsGraph in _sicpykernel: _sicpykernel.SP_InteractionsGraph_swigregister(SP_InteractionsGraph)
[docs] def ioMatrix_read(fileName: "std::string const &", mode: "std::string const &", m: "SiconosMatrix") -> "bool": r""" Read a SiconosMatrix :type fileName: string, in :param fileName: the name of the file to read :type mode: string, in :param mode: the storage type used in the file (either ascii or binary) :type m: :py:class:`SiconosMatrix`, in/out :param m: the SiconosMatrix to be filled :rtype: boolean :return: true if read ok, else false ... """ return _sicpykernel.ioMatrix_read(fileName, mode, m)
[docs] def ioMatrix_write(*args) -> "bool": r""" Write a SiconosMatrix :type fileName: string, in :param fileName: the name of the file to write in :type mode: string, in :param mode: the storage type used in the file (either ascii or binary) :type m: :py:class:`SiconosMatrix`, in :param m: the SiconosMatrix to write :type outputType: string, in, optional :param outputType: type of output: - "python"(default): row col a00 a01 a02 ... a10 ... - "noDim": a00 a01 a02 ... a10 ... Reading input format is the one corresponding to "python". :rtype: boolean :return: true if read ok, else false ... """ return _sicpykernel.ioMatrix_write(*args)
[docs] def compareRefFile(*args) -> "double": r""" Function to load data from a file and compare it with the provided data. Returns the measured difference between files if the file was loaded and the comparison was performed, which must be >= 0.0, otherwise -1.0 is returned. Caller needs to check diff <= epsilon to verify the result. :type data: :py:class:`SimpleMatrix` :param data: The data to compare against the file. :type filename: string :param filename: The name of the file to load and compare. :type epsilon: float :param epsilon: The comparison threshold. :type index: Index, optional :param index: An optional list of column indexes, size==0 indicates all columns. :type ref: :py:class:`SimpleMatrix`, optional :param ref: If provided, loaded matrix is returned in this pointer. :type mode: string, optional :param mode: Mode string to pass to ioMatrix::read. :type verbose: boolean, optional :param verbose: True to print verbose output. :rtype: float :return: Positive or 0.0 if the file was loaded and the comparison was performed, otherwise -1. """ return _sicpykernel.compareRefFile(*args)
SICONOS_OSNSP_DEFAULT = _sicpykernel.SICONOS_OSNSP_DEFAULT SICONOS_OSNSP_ED_SMOOTH_ACC = _sicpykernel.SICONOS_OSNSP_ED_SMOOTH_ACC SICONOS_OSNSP_ED_IMPACT = _sicpykernel.SICONOS_OSNSP_ED_IMPACT SICONOS_OSNSP_ED_SMOOTH_POS = _sicpykernel.SICONOS_OSNSP_ED_SMOOTH_POS SICONOS_OSNSP_TS_VELOCITY = _sicpykernel.SICONOS_OSNSP_TS_VELOCITY SICONOS_OSNSP_TS_POS = _sicpykernel.SICONOS_OSNSP_TS_POS TD_EVENT = _sicpykernel.TD_EVENT r""" Event constants""" NS_EVENT = _sicpykernel.NS_EVENT def dynamicalSystems(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >": return _sicpykernel.dynamicalSystems(dsg) def interactions(dsg: "SP::InteractionsGraph") -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >": return _sicpykernel.interactions(dsg) def dynamicalSystemsVector() -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >": return _sicpykernel.dynamicalSystemsVector() def graphLayout(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< std::pair< SP::DynamicalSystem,SP::DynamicalSystem >,std::allocator< std::pair< SP::DynamicalSystem,SP::DynamicalSystem > > >": return _sicpykernel.graphLayout(dsg) def graphLayoutInt(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< std::pair< unsigned int,unsigned int >,std::allocator< std::pair< unsigned int,unsigned int > > >": return _sicpykernel.graphLayoutInt(dsg) class graphAccess(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr graph = property(_sicpykernel.graphAccess_graph_get, _sicpykernel.graphAccess_graph_set) vertices = property(_sicpykernel.graphAccess_vertices_get, _sicpykernel.graphAccess_vertices_set) edges = property(_sicpykernel.graphAccess_edges_get, _sicpykernel.graphAccess_edges_set) def update(self) -> "void": return _sicpykernel.graphAccess_update(self) def __init__(self, ig: "std::shared_ptr< _InteractionsGraph >"): _sicpykernel.graphAccess_swiginit(self, _sicpykernel.new_graphAccess(ig)) __swig_destroy__ = _sicpykernel.delete_graphAccess # Register graphAccess in _sicpykernel: _sicpykernel.graphAccess_swigregister(graphAccess) cvar = _sicpykernel.cvar SICONOS_NB_OSNSP_TS = cvar.SICONOS_NB_OSNSP_TS SICONOS_NB_OSNSP_TSP = cvar.SICONOS_NB_OSNSP_TSP class __mpz_struct(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): _sicpykernel.__mpz_struct_swiginit(self, _sicpykernel.new___mpz_struct()) __swig_destroy__ = _sicpykernel.delete___mpz_struct # Register __mpz_struct in _sicpykernel: _sicpykernel.__mpz_struct_swigregister(__mpz_struct) BLOCK = _sicpykernel.BLOCK DENSE = _sicpykernel.DENSE r""" id for dense matrix or vector""" TRIANGULAR = _sicpykernel.TRIANGULAR r""" id for triangular matrix""" SYMMETRIC = _sicpykernel.SYMMETRIC r""" id for symmetric matrix""" SPARSE = _sicpykernel.SPARSE r""" id for sparse matrix or vector""" BANDED = _sicpykernel.BANDED r""" id for banded matrix""" ZERO = _sicpykernel.ZERO r""" id for zero matrix""" IDENTITY = _sicpykernel.IDENTITY r""" id for identity matrix""" SPARSE_COORDINATE = _sicpykernel.SPARSE_COORDINATE r""" id for sparse matrix or vector""" def axisAngleFromQuaternion(q0: "double", q1: "double", q2: "double", q3: "double", axis: "SP::SiconosVector") -> "double": return _sicpykernel.axisAngleFromQuaternion(q0, q1, q2, q3, axis) def axisAngleFromConfiguration(q: "SP::SiconosVector", axis: "SP::SiconosVector") -> "double": return _sicpykernel.axisAngleFromConfiguration(q, axis) def rotationVectorFromQuaternion(q0: "double", q1: "double", q2: "double", q3: "double", rotationVector: "SP::SiconosVector") -> "void": return _sicpykernel.rotationVectorFromQuaternion(q0, q1, q2, q3, rotationVector) def rotationVectorFromConfiguration(q: "SP::SiconosVector", rotationVector: "SP::SiconosVector") -> "void": return _sicpykernel.rotationVectorFromConfiguration(q, rotationVector) def quaternionFromAxisAngle(axis: "SP::SiconosVector", angle: "double", q: "SP::SiconosVector") -> "void": return _sicpykernel.quaternionFromAxisAngle(axis, angle, q) def quaternionFromRotationVector(rotationVector: "SP::SiconosVector", q: "SP::SiconosVector") -> "void": return _sicpykernel.quaternionFromRotationVector(rotationVector, q) def quaternionFromTwistVector(twist: "SiconosVector", q: "SiconosVector") -> "void": return _sicpykernel.quaternionFromTwistVector(twist, q) def quaternionNorm(q: "SiconosVector") -> "double": return _sicpykernel.quaternionNorm(q) def normalizeq(q: "SP::SiconosVector") -> "void": return _sicpykernel.normalizeq(q) def computeRotationMatrix(*args) -> "void": return _sicpykernel.computeRotationMatrix(*args) def computeRotationMatrixTransposed(q: "SP::SiconosVector", rotationMatrix: "SP::SimpleMatrix") -> "void": return _sicpykernel.computeRotationMatrixTransposed(q, rotationMatrix) def quaternionRotate(*args) -> "void": return _sicpykernel.quaternionRotate(*args) def changeFrameAbsToBody(*args) -> "void": return _sicpykernel.changeFrameAbsToBody(*args) def changeFrameBodyToAbs(*args) -> "void": return _sicpykernel.changeFrameBodyToAbs(*args) def compositionLawLieGroup(*args) -> "void": return _sicpykernel.compositionLawLieGroup(*args) class dspv(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _sicpykernel.dspv_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpykernel.dspv___nonzero__(self) def __bool__(self) -> "bool": return _sicpykernel.dspv___bool__(self) def __len__(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type": return _sicpykernel.dspv___len__(self) def __getslice__(self, i: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type", j: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type") -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > >,std::allocator< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > > > *": return _sicpykernel.dspv___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpykernel.dspv___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type", j: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type") -> "void": return _sicpykernel.dspv___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpykernel.dspv___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &": return _sicpykernel.dspv___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpykernel.dspv___setitem__(self, *args) def pop(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type": return _sicpykernel.dspv_pop(self) def append(self, x: "dsp") -> "void": return _sicpykernel.dspv_append(self, x) def empty(self) -> "bool": return _sicpykernel.dspv_empty(self) def size(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type": return _sicpykernel.dspv_size(self) def begin(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator": return _sicpykernel.dspv_begin(self) def end(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator": return _sicpykernel.dspv_end(self) def rbegin(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::reverse_iterator": return _sicpykernel.dspv_rbegin(self) def rend(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::reverse_iterator": return _sicpykernel.dspv_rend(self) def clear(self) -> "void": return _sicpykernel.dspv_clear(self) def get_allocator(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::allocator_type": return _sicpykernel.dspv_get_allocator(self) def pop_back(self) -> "void": return _sicpykernel.dspv_pop_back(self) def erase(self, *args) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator": return _sicpykernel.dspv_erase(self, *args) def __init__(self, *args): _sicpykernel.dspv_swiginit(self, _sicpykernel.new_dspv(*args)) def push_back(self, x: "dsp") -> "void": return _sicpykernel.dspv_push_back(self, x) def front(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &": return _sicpykernel.dspv_front(self) def back(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &": return _sicpykernel.dspv_back(self) def assign(self, n: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type", x: "dsp") -> "void": return _sicpykernel.dspv_assign(self, n, x) def resize(self, *args) -> "void": return _sicpykernel.dspv_resize(self, *args) def insert(self, *args) -> "void": return _sicpykernel.dspv_insert(self, *args) def reserve(self, n: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type") -> "void": return _sicpykernel.dspv_reserve(self, n) def capacity(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type": return _sicpykernel.dspv_capacity(self) __swig_destroy__ = _sicpykernel.delete_dspv # Register dspv in _sicpykernel: _sicpykernel.dspv_swigregister(dspv) N_DOUBLE_PRECISION = cvar.N_DOUBLE_PRECISION M_MAXSIZEFORDISPLAY = cvar.M_MAXSIZEFORDISPLAY DEFAULT_FORMAT = cvar.DEFAULT_FORMAT class dsiv(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _sicpykernel.dsiv_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpykernel.dsiv___nonzero__(self) def __bool__(self) -> "bool": return _sicpykernel.dsiv___bool__(self) def __len__(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type": return _sicpykernel.dsiv___len__(self) def __getslice__(self, i: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type", j: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type") -> "std::vector< std::pair< unsigned int,unsigned int >,std::allocator< std::pair< unsigned int,unsigned int > > > *": return _sicpykernel.dsiv___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpykernel.dsiv___setslice__(self, *args) def __delslice__(self, i: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type", j: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type") -> "void": return _sicpykernel.dsiv___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpykernel.dsiv___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &": return _sicpykernel.dsiv___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpykernel.dsiv___setitem__(self, *args) def pop(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type": return _sicpykernel.dsiv_pop(self) def append(self, x: "dsi") -> "void": return _sicpykernel.dsiv_append(self, x) def empty(self) -> "bool": return _sicpykernel.dsiv_empty(self) def size(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type": return _sicpykernel.dsiv_size(self) def begin(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator": return _sicpykernel.dsiv_begin(self) def end(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator": return _sicpykernel.dsiv_end(self) def rbegin(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::reverse_iterator": return _sicpykernel.dsiv_rbegin(self) def rend(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::reverse_iterator": return _sicpykernel.dsiv_rend(self) def clear(self) -> "void": return _sicpykernel.dsiv_clear(self) def get_allocator(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::allocator_type": return _sicpykernel.dsiv_get_allocator(self) def pop_back(self) -> "void": return _sicpykernel.dsiv_pop_back(self) def erase(self, *args) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator": return _sicpykernel.dsiv_erase(self, *args) def __init__(self, *args): _sicpykernel.dsiv_swiginit(self, _sicpykernel.new_dsiv(*args)) def push_back(self, x: "dsi") -> "void": return _sicpykernel.dsiv_push_back(self, x) def front(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &": return _sicpykernel.dsiv_front(self) def back(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &": return _sicpykernel.dsiv_back(self) def assign(self, n: "std::vector< std::pair< unsigned int,unsigned int > >::size_type", x: "dsi") -> "void": return _sicpykernel.dsiv_assign(self, n, x) def resize(self, *args) -> "void": return _sicpykernel.dsiv_resize(self, *args) def insert(self, *args) -> "void": return _sicpykernel.dsiv_insert(self, *args) def reserve(self, n: "std::vector< std::pair< unsigned int,unsigned int > >::size_type") -> "void": return _sicpykernel.dsiv_reserve(self, n) def capacity(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type": return _sicpykernel.dsiv_capacity(self) __swig_destroy__ = _sicpykernel.delete_dsiv # Register dsiv in _sicpykernel: _sicpykernel.dsiv_swigregister(dsiv) class dsi(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): _sicpykernel.dsi_swiginit(self, _sicpykernel.new_dsi(*args)) first = property(_sicpykernel.dsi_first_get, _sicpykernel.dsi_first_set) second = property(_sicpykernel.dsi_second_get, _sicpykernel.dsi_second_set) def __len__(self): return 2 def __repr__(self): return str((self.first, self.second)) def __getitem__(self, index): if not (index % 2): return self.first else: return self.second def __setitem__(self, index, val): if not (index % 2): self.first = val else: self.second = val __swig_destroy__ = _sicpykernel.delete_dsi # Register dsi in _sicpykernel: _sicpykernel.dsi_swigregister(dsi) class dsp(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): _sicpykernel.dsp_swiginit(self, _sicpykernel.new_dsp(*args)) first = property(_sicpykernel.dsp_first_get, _sicpykernel.dsp_first_set) second = property(_sicpykernel.dsp_second_get, _sicpykernel.dsp_second_set) def __len__(self): return 2 def __repr__(self): return str((self.first, self.second)) def __getitem__(self, index): if not (index % 2): return self.first else: return self.second def __setitem__(self, index, val): if not (index % 2): self.first = val else: self.second = val __swig_destroy__ = _sicpykernel.delete_dsp # Register dsp in _sicpykernel: _sicpykernel.dsp_swigregister(dsp) class unsignedintv(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): _sicpykernel.unsignedintv_swiginit(self, _sicpykernel.new_unsignedintv()) __swig_destroy__ = _sicpykernel.delete_unsignedintv # Register unsignedintv in _sicpykernel: _sicpykernel.unsignedintv_swigregister(unsignedintv) class MemoryContainer(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def iterator(self) -> "swig::SwigPyIterator *": return _sicpykernel.MemoryContainer_iterator(self) def __iter__(self): return self.iterator() def __nonzero__(self) -> "bool": return _sicpykernel.MemoryContainer___nonzero__(self) def __bool__(self) -> "bool": return _sicpykernel.MemoryContainer___bool__(self) def __len__(self) -> "std::vector< SiconosVector >::size_type": return _sicpykernel.MemoryContainer___len__(self) def __getslice__(self, i: "std::vector< SiconosVector >::difference_type", j: "std::vector< SiconosVector >::difference_type") -> "std::vector< SiconosVector,std::allocator< SiconosVector > > *": return _sicpykernel.MemoryContainer___getslice__(self, i, j) def __setslice__(self, *args) -> "void": return _sicpykernel.MemoryContainer___setslice__(self, *args) def __delslice__(self, i: "std::vector< SiconosVector >::difference_type", j: "std::vector< SiconosVector >::difference_type") -> "void": return _sicpykernel.MemoryContainer___delslice__(self, i, j) def __delitem__(self, *args) -> "void": return _sicpykernel.MemoryContainer___delitem__(self, *args) def __getitem__(self, *args) -> "std::vector< SiconosVector >::value_type const &": return _sicpykernel.MemoryContainer___getitem__(self, *args) def __setitem__(self, *args) -> "void": return _sicpykernel.MemoryContainer___setitem__(self, *args) def pop(self) -> "std::vector< SiconosVector >::value_type": return _sicpykernel.MemoryContainer_pop(self) def append(self, x: "SiconosVector") -> "void": return _sicpykernel.MemoryContainer_append(self, x) def empty(self) -> "bool": return _sicpykernel.MemoryContainer_empty(self) def size(self) -> "std::vector< SiconosVector >::size_type": return _sicpykernel.MemoryContainer_size(self) def begin(self) -> "std::vector< SiconosVector >::iterator": return _sicpykernel.MemoryContainer_begin(self) def end(self) -> "std::vector< SiconosVector >::iterator": return _sicpykernel.MemoryContainer_end(self) def rbegin(self) -> "std::vector< SiconosVector >::reverse_iterator": return _sicpykernel.MemoryContainer_rbegin(self) def rend(self) -> "std::vector< SiconosVector >::reverse_iterator": return _sicpykernel.MemoryContainer_rend(self) def clear(self) -> "void": return _sicpykernel.MemoryContainer_clear(self) def get_allocator(self) -> "std::vector< SiconosVector >::allocator_type": return _sicpykernel.MemoryContainer_get_allocator(self) def pop_back(self) -> "void": return _sicpykernel.MemoryContainer_pop_back(self) def erase(self, *args) -> "std::vector< SiconosVector >::iterator": return _sicpykernel.MemoryContainer_erase(self, *args) def __init__(self, *args): _sicpykernel.MemoryContainer_swiginit(self, _sicpykernel.new_MemoryContainer(*args)) def push_back(self, x: "SiconosVector") -> "void": return _sicpykernel.MemoryContainer_push_back(self, x) def front(self) -> "std::vector< SiconosVector >::value_type const &": return _sicpykernel.MemoryContainer_front(self) def back(self) -> "std::vector< SiconosVector >::value_type const &": return _sicpykernel.MemoryContainer_back(self) def assign(self, n: "std::vector< SiconosVector >::size_type", x: "SiconosVector") -> "void": return _sicpykernel.MemoryContainer_assign(self, n, x) def resize(self, *args) -> "void": return _sicpykernel.MemoryContainer_resize(self, *args) def insert(self, *args) -> "void": return _sicpykernel.MemoryContainer_insert(self, *args) def reserve(self, n: "std::vector< SiconosVector >::size_type") -> "void": return _sicpykernel.MemoryContainer_reserve(self, n) def capacity(self) -> "std::vector< SiconosVector >::size_type": return _sicpykernel.MemoryContainer_capacity(self) __swig_destroy__ = _sicpykernel.delete_MemoryContainer # Register MemoryContainer in _sicpykernel: _sicpykernel.MemoryContainer_swigregister(MemoryContainer)
[docs] class SiconosMemory(MemoryContainer): r""" Interface to stl container of SiconosVector. This class is used as a backup during simulation, to save vectors (e.g. state) computed during previous time steps. - The size of the container is fixed, with a first-in first-out mechanism used through swap method. - All saved vectors must have the same dimension. This class must be reviewed and backup should probably be moved to graph rather than in this object. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* creates an empty SiconosMemory. | *Overload 2:* creates a SiconosMemory :type size: int :param size: number of elements in the container :type vectorSize: int :param vectorSize: size of each vector in the container | *Overload 3:* creates a SiconosMemory, copy constructor Required because of resize call in DS initMemory function. :type mem: :py:class:`SiconosMemory` :param mem: a SiconosMemory """ _sicpykernel.SiconosMemory_swiginit(self, _sicpykernel.new_SiconosMemory(*args)) __swig_destroy__ = _sicpykernel.delete_SiconosMemory def __copy__(self, arg2: "SiconosMemory") -> "void": r""" Assignment""" return _sicpykernel.SiconosMemory___copy__(self, arg2)
[docs] def getSiconosVector(self, arg2: "unsigned int const") -> "SiconosVector const &": r""" To get SiconosVector number i of the memory :param int: i: the position in the memory of the wanted SiconosVector :rtype: :py:class:`SiconosVector` :return: a SP::SiconosVector """ return _sicpykernel.SiconosMemory_getSiconosVector(self, arg2)
[docs] def getSiconosVectorMutable(self, arg2: "unsigned int const") -> "SiconosVector &": r""" To get SiconosVector number i of the memory as mutable reference. Use should be avoided whenever possible. (Used in LinearSMC::actuate) :param int: i: the position in the memory of the wanted SiconosVector :rtype: :py:class:`SiconosVector` :return: a SP::SiconosVector """ return _sicpykernel.SiconosMemory_getSiconosVectorMutable(self, arg2)
[docs] def setMemorySize(self, steps: "unsigned int const", vectorSize: "unsigned int const") -> "void": r""" set size of the SiconosMemory (number of vectors and size of vector) :type steps: int :param steps: the max size for this SiconosMemory, size of the container :type vectorSize: int :param vectorSize: size of each vector of the container """ return _sicpykernel.SiconosMemory_setMemorySize(self, steps, vectorSize)
[docs] def nbVectorsInMemory(self) -> "MemoryContainer::size_type": r""" gives the numbers of SiconosVectors currently stored in the memory :rtype: int :return: int >= 0 """ return _sicpykernel.SiconosMemory_nbVectorsInMemory(self)
[docs] def display(self) -> "void": r""" displays the data of the memory object""" return _sicpykernel.SiconosMemory_display(self)
# Register SiconosMemory in _sicpykernel: _sicpykernel.SiconosMemory_swigregister(SiconosMemory)
[docs] class NonSmoothLaw(object): r""" Non Smooth Laws (NSL) Base Class This class is the base class for all nonsmooth laws in Siconos. A nonsmooth law characterize the (nonsmooth) relationship between 2 variables, usually designated by :math:`y` and :math:`\lambda`. :math:`y` is most of time seen as the "input" from DynamicalSystems and is given by a Relation linked to this nonsmoothlaw. :math:`\lambda` is then the "output" and through the same Relation is fed back to one or more DynamicalSystem. classical examples of nonsmooth law include: - RelayNSL: :math:`-y \in \mathcal{N}_{[-1,1]}(\lambda)\quad \Longleftrightarrow\quad -\lambda \in \mbox{sgn} (y)` - NormalConeNSL: given a polytope :math:`K`, :math:`-\lambda \in \partial \sigma_{-K}(y)\quad\Longleftrightarrow\quad y\in\mathcal{N}_{-K}(-\lambda)` - ComplementarityConditionNSL: :math:`0\leq y \perp \lambda \geq 0` - NewtonImpactNSL and NewtonImpactFrictionNSL for impact, without or with friction - MultipleImpactNSL for a multiple impact law - MixedComplementarityConditionNSL The computation of both :math:`y` and :math:`\lambda` is carried on by a solver in Numerics through a OneStepNSProblem object. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _size = property(_sicpykernel.NonSmoothLaw__size_get, _sicpykernel.NonSmoothLaw__size_set, doc=r""" "size" of the NonSmoothLaw""") def __init__(self, *args): r""" basic constructor :type size: int :param size: the nonsmooth law size """ if self.__class__ == NonSmoothLaw: _self = None else: _self = self _sicpykernel.NonSmoothLaw_swiginit(self, _sicpykernel.new_NonSmoothLaw(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NonSmoothLaw
[docs] def isVerified(self) -> "bool": r""" :rtype: boolean :return: a boolean value which determines if the NS Law is verified. Not implemented for the moment. """ return _sicpykernel.NonSmoothLaw_isVerified(self)
[docs] def size(self) -> "unsigned int": r""" :rtype: int :return: the size of the NS law """ return _sicpykernel.NonSmoothLaw_size(self)
[docs] def display(self) -> "void": r""" display the data of the NonSmoothLaw on the standard output""" return _sicpykernel.NonSmoothLaw_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NonSmoothLaw(self) return weakref.proxy(self)
# Register NonSmoothLaw in _sicpykernel: _sicpykernel.NonSmoothLaw_swigregister(NonSmoothLaw)
[docs] class NewtonImpactNSL(NonSmoothLaw): r""" Newton impact Non Smooth Law This class formalizes the Newton Impact law together with a complementarity condition. i.e. .. math:: \left\{\begin{array}{l} y \geq 0, \lambda \geq 0, y^{T} \lambda=0\ \ if y \leq 0 \quad \mbox{then} \quad \dot y(t^{+}) - e \dot y(t^{-}) \geq 0, \quad \lambda \geq 0, (\dot y(t^{+}) - e \dot y(t^{-}))^{T} \lambda=0 \end{array}\right. nsLawSize is equal to 1. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor with the value of the NewtonImpactNSL attributes :type e: float :param e: the value of the coefficient of restitution | *Overload 3:* Apply multiple-axis impact """ if self.__class__ == NewtonImpactNSL: _self = None else: _self = self _sicpykernel.NewtonImpactNSL_swiginit(self, _sicpykernel.new_NewtonImpactNSL(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NewtonImpactNSL
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: a boolean value whioch determines if the NS Law is verified """ return _sicpykernel.NewtonImpactNSL_isVerified(self)
[docs] def e(self) -> "double": r""" :rtype: float :return: the value of e """ return _sicpykernel.NewtonImpactNSL_e(self)
[docs] def setE(self, newVal: "double") -> "void": r""" setter of e :type newVal: float :param newVal: a double to set e """ return _sicpykernel.NewtonImpactNSL_setE(self, newVal)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.NewtonImpactNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonImpactNSL(self) return weakref.proxy(self)
# Register NewtonImpactNSL in _sicpykernel: _sicpykernel.NewtonImpactNSL_swigregister(NewtonImpactNSL)
[docs] class NewtonImpactFrictionNSL(NonSmoothLaw): r""" Newton Impact-Friction Non Smooth Law""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* basic constructor :type size: int :param size: size of the ns law | *Overload 2:* constructor with the value of the NewtonImpactFrictionNSL attributes :type en: float :param en: double : normal e coefficient :type et: float :param et: double : tangent e coefficient :type mu: float :param mu: double : friction coefficient :type size: int :param size: unsigned int: size of the ns law """ if self.__class__ == NewtonImpactFrictionNSL: _self = None else: _self = self _sicpykernel.NewtonImpactFrictionNSL_swiginit(self, _sicpykernel.new_NewtonImpactFrictionNSL(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NewtonImpactFrictionNSL
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: a boolean value whioch determines if the NS Law is verified """ return _sicpykernel.NewtonImpactFrictionNSL_isVerified(self)
[docs] def en(self) -> "double": r""" :rtype: float :return: the value of en """ return _sicpykernel.NewtonImpactFrictionNSL_en(self)
[docs] def setEn(self, newVal: "double") -> "void": r""" setter of en :type newVal: float :param newVal: a double to set en """ return _sicpykernel.NewtonImpactFrictionNSL_setEn(self, newVal)
[docs] def et(self) -> "double": r""" :rtype: float :return: the value of et """ return _sicpykernel.NewtonImpactFrictionNSL_et(self)
[docs] def setEt(self, newVal: "double") -> "void": r""" setter of et :type newVal: float :param newVal: a double to set et """ return _sicpykernel.NewtonImpactFrictionNSL_setEt(self, newVal)
[docs] def mu(self) -> "double": r""" :rtype: float :return: the value of mu """ return _sicpykernel.NewtonImpactFrictionNSL_mu(self)
[docs] def setMu(self, newVal: "double") -> "void": r""" setter of mu :type newVal: float :param newVal: a double to set mu """ return _sicpykernel.NewtonImpactFrictionNSL_setMu(self, newVal)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.NewtonImpactFrictionNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonImpactFrictionNSL(self) return weakref.proxy(self)
# Register NewtonImpactFrictionNSL in _sicpykernel: _sicpykernel.NewtonImpactFrictionNSL_swigregister(NewtonImpactFrictionNSL)
[docs] class FremondImpactFrictionNSL(NonSmoothLaw): r""" Fremond Impact-Friction Non Smooth Law""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* basic constructor :type size: int :param size: size of the ns law | *Overload 2:* constructor with the value of the FremondImpactFrictionNSL attributes :type en: float :param en: double : normal e coefficient :type et: float :param et: double : tangent e coefficient :type mu: float :param mu: double : friction coefficient :type size: int :param size: unsigned int: size of the ns law """ if self.__class__ == FremondImpactFrictionNSL: _self = None else: _self = self _sicpykernel.FremondImpactFrictionNSL_swiginit(self, _sicpykernel.new_FremondImpactFrictionNSL(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FremondImpactFrictionNSL
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: a boolean value whioch determines if the NS Law is verified """ return _sicpykernel.FremondImpactFrictionNSL_isVerified(self)
[docs] def en(self) -> "double": r""" :rtype: float :return: the value of en """ return _sicpykernel.FremondImpactFrictionNSL_en(self)
[docs] def setEn(self, newVal: "double") -> "void": r""" setter of en :type newVal: float :param newVal: a double to set en """ return _sicpykernel.FremondImpactFrictionNSL_setEn(self, newVal)
[docs] def et(self) -> "double": r""" :rtype: float :return: the value of et """ return _sicpykernel.FremondImpactFrictionNSL_et(self)
[docs] def setEt(self, newVal: "double") -> "void": r""" setter of et :type newVal: float :param newVal: a double to set et """ return _sicpykernel.FremondImpactFrictionNSL_setEt(self, newVal)
[docs] def mu(self) -> "double": r""" :rtype: float :return: the value of mu """ return _sicpykernel.FremondImpactFrictionNSL_mu(self)
[docs] def setMu(self, newVal: "double") -> "void": r""" setter of mu :type newVal: float :param newVal: a double to set mu """ return _sicpykernel.FremondImpactFrictionNSL_setMu(self, newVal)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.FremondImpactFrictionNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_FremondImpactFrictionNSL(self) return weakref.proxy(self)
# Register FremondImpactFrictionNSL in _sicpykernel: _sicpykernel.FremondImpactFrictionNSL_swigregister(FremondImpactFrictionNSL)
[docs] class NewtonImpactRollingFrictionNSL(NonSmoothLaw): r""" Newton Impact-Friction Non Smooth Law""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* basic constructor :type size: int :param size: size of the ns law | *Overload 2:* constructor with the value of the NewtonImpactRollingFrictionNSL attributes :type en: float :param en: double : normal e coefficient :type et: float :param et: double tangent e coefficient :type mu: float :param mu: double : friction coefficient :type muR: float :param muR: double : rolling friction coefficient :type size: int :param size: unsigned int: size of the ns law """ if self.__class__ == NewtonImpactRollingFrictionNSL: _self = None else: _self = self _sicpykernel.NewtonImpactRollingFrictionNSL_swiginit(self, _sicpykernel.new_NewtonImpactRollingFrictionNSL(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NewtonImpactRollingFrictionNSL
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: a boolean value whioch determines if the NS Law is verified """ return _sicpykernel.NewtonImpactRollingFrictionNSL_isVerified(self)
[docs] def en(self) -> "double": r""" :rtype: float :return: the value of en """ return _sicpykernel.NewtonImpactRollingFrictionNSL_en(self)
[docs] def setEn(self, newVal: "double") -> "void": r""" setter of en :type newVal: float :param newVal: a double to set en """ return _sicpykernel.NewtonImpactRollingFrictionNSL_setEn(self, newVal)
[docs] def et(self) -> "double": r""" :rtype: float :return: the value of et """ return _sicpykernel.NewtonImpactRollingFrictionNSL_et(self)
[docs] def setEt(self, newVal: "double") -> "void": r""" setter of et :type newVal: float :param newVal: a double to set et """ return _sicpykernel.NewtonImpactRollingFrictionNSL_setEt(self, newVal)
[docs] def mu(self) -> "double": r""" :rtype: float :return: the value of mu """ return _sicpykernel.NewtonImpactRollingFrictionNSL_mu(self)
[docs] def muR(self) -> "double": r""" :rtype: float :return: the value of mu """ return _sicpykernel.NewtonImpactRollingFrictionNSL_muR(self)
[docs] def setMu(self, newVal: "double") -> "void": r""" setter of mu :type newVal: float :param newVal: a double to set mu """ return _sicpykernel.NewtonImpactRollingFrictionNSL_setMu(self, newVal)
[docs] def setMuR(self, newVal: "double") -> "void": r""" setter of muR :type newVal: float :param newVal: a double to set muR """ return _sicpykernel.NewtonImpactRollingFrictionNSL_setMuR(self, newVal)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.NewtonImpactRollingFrictionNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonImpactRollingFrictionNSL(self) return weakref.proxy(self)
# Register NewtonImpactRollingFrictionNSL in _sicpykernel: _sicpykernel.NewtonImpactRollingFrictionNSL_swigregister(NewtonImpactRollingFrictionNSL)
[docs] class MixedComplementarityConditionNSL(NonSmoothLaw): r""" Complementarity NonSmoothLaw """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, newSize: "unsigned int", equalitySize: "unsigned int"): r""" basic constructor :type newSize: int :param newSize: size of the non smooth law :type equalitySize: int :param equalitySize: size of the equality relation """ if self.__class__ == MixedComplementarityConditionNSL: _self = None else: _self = self _sicpykernel.MixedComplementarityConditionNSL_swiginit(self, _sicpykernel.new_MixedComplementarityConditionNSL(_self, newSize, equalitySize)) __swig_destroy__ = _sicpykernel.delete_MixedComplementarityConditionNSL
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.MixedComplementarityConditionNSL_display(self)
[docs] def equalitySize(self) -> "unsigned int": r""" get the number of equality present in the MLCP :rtype: int :return: an unsigned int """ return _sicpykernel.MixedComplementarityConditionNSL_equalitySize(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_MixedComplementarityConditionNSL(self) return weakref.proxy(self)
# Register MixedComplementarityConditionNSL in _sicpykernel: _sicpykernel.MixedComplementarityConditionNSL_swigregister(MixedComplementarityConditionNSL)
[docs] class ComplementarityConditionNSL(NonSmoothLaw): r""" Complementarity NonSmoothLaw """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, size: "unsigned int"): r""" basic constructor :type size: int :param size: of the non smooth law """ if self.__class__ == ComplementarityConditionNSL: _self = None else: _self = self _sicpykernel.ComplementarityConditionNSL_swiginit(self, _sicpykernel.new_ComplementarityConditionNSL(_self, size)) __swig_destroy__ = _sicpykernel.delete_ComplementarityConditionNSL
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.ComplementarityConditionNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_ComplementarityConditionNSL(self) return weakref.proxy(self)
# Register ComplementarityConditionNSL in _sicpykernel: _sicpykernel.ComplementarityConditionNSL_swigregister(ComplementarityConditionNSL)
[docs] class EqualityConditionNSL(NonSmoothLaw): r""" Equality NonSmoothLaw """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, size: "unsigned int"): r""" basic constructor :type size: int :param size: of the non smooth law """ if self.__class__ == EqualityConditionNSL: _self = None else: _self = self _sicpykernel.EqualityConditionNSL_swiginit(self, _sicpykernel.new_EqualityConditionNSL(_self, size)) __swig_destroy__ = _sicpykernel.delete_EqualityConditionNSL
[docs] def display(self) -> "void": r""" display the data of the NonSmoothLaw on the standard output""" return _sicpykernel.EqualityConditionNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_EqualityConditionNSL(self) return weakref.proxy(self)
# Register EqualityConditionNSL in _sicpykernel: _sicpykernel.EqualityConditionNSL_swigregister(EqualityConditionNSL)
[docs] class MultipleImpactNSL(NonSmoothLaw): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): if self.__class__ == MultipleImpactNSL: _self = None else: _self = self _sicpykernel.MultipleImpactNSL_swiginit(self, _sicpykernel.new_MultipleImpactNSL(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MultipleImpactNSL def ResCof(self) -> "double": return _sicpykernel.MultipleImpactNSL_ResCof(self) def Stiff(self) -> "double": return _sicpykernel.MultipleImpactNSL_Stiff(self) def ElasCof(self) -> "double": return _sicpykernel.MultipleImpactNSL_ElasCof(self) def setResCof(self, newResCof: "double") -> "void": return _sicpykernel.MultipleImpactNSL_setResCof(self, newResCof) def setStiff(self, newStiff: "double") -> "void": return _sicpykernel.MultipleImpactNSL_setStiff(self, newStiff) def setElasCoeff(self, _newElasCoef: "double") -> "void": return _sicpykernel.MultipleImpactNSL_setElasCoeff(self, _newElasCoef)
[docs] def isVerified(self) -> "bool": return _sicpykernel.MultipleImpactNSL_isVerified(self)
[docs] def display(self) -> "void": return _sicpykernel.MultipleImpactNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_MultipleImpactNSL(self) return weakref.proxy(self)
# Register MultipleImpactNSL in _sicpykernel: _sicpykernel.MultipleImpactNSL_swigregister(MultipleImpactNSL)
[docs] class RelayNSL(NonSmoothLaw): r""" Relay NonSmoothLaw This class formalizes the Relay nonsmooth law i.e. .. math:: -y \in \mathcal{N}_{[lb,ub]}(\lambda), where :math:`lb` is the lower bound and :math:`ub` is the upper bound of the Relay law. In this default case, the lower bound is set to :math:`lb=-1` and the upper bound ub is set to :math:`ub=1`. We get the well-known form of the RelayNSL as the multivalued sign function, i.e. .. math:: y \in -\mathcal{N}_{[-1,1]}(\lambda) \Longleftrightarrow \lambda \in -\mbox{sgn} (y) where the multi-valued sign function is defined as .. math:: \mbox{sgn} (y) = \left\{ \begin{array}{lcl} 1 && y >0 \\ [-1,1] && y =0 \\ -1 && y <0 \end{array}\right. TODO: Build the Sgn NonSmoothLaw as the default instance of Relay """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, size: "unsigned int", lb: "double"=-1.0, ub: "double"=1.0): r""" constructor with the value of the RelayNSL attributes :type size: int :param size: size of the NonSmoothLaw :type lb: float, optional :param lb: lower endpoint of the interval, default value is -1.0 :type ub: float, optional :param ub: upper endpoint of the interval, default value is 1.0 """ if self.__class__ == RelayNSL: _self = None else: _self = self _sicpykernel.RelayNSL_swiginit(self, _sicpykernel.new_RelayNSL(_self, size, lb, ub)) __swig_destroy__ = _sicpykernel.delete_RelayNSL
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: true if the NS Law is verified, false otherwise """ return _sicpykernel.RelayNSL_isVerified(self)
[docs] def lb(self) -> "double": r""" to get lb :rtype: float :return: the value of lb """ return _sicpykernel.RelayNSL_lb(self)
[docs] def setLb(self, lb: "double") -> "void": r""" to set the lower bound :type lb: float :param lb: the new lower bound """ return _sicpykernel.RelayNSL_setLb(self, lb)
[docs] def ub(self) -> "double": r""" to get ub :rtype: float :return: the value of ub """ return _sicpykernel.RelayNSL_ub(self)
[docs] def setUb(self, ub: "double") -> "void": r""" to set ub :type ub: float :param ub: the new upper bound """ return _sicpykernel.RelayNSL_setUb(self, ub)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.RelayNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_RelayNSL(self) return weakref.proxy(self)
# Register RelayNSL in _sicpykernel: _sicpykernel.RelayNSL_swigregister(RelayNSL)
[docs] class NormalConeNSL(NonSmoothLaw): r""" NormalCone NonSmoothLaw This class formalizes a nonsmooth law in the form of a normal cone inclusion i.e. .. math:: 0 \in y + \mathcal{N}_{P}(\lambda), where :math:`P` is a polyhedral set. This is a generalization of the RelayNSL law, where the set :math:`P` is a scaled box. Note that there exists an inverse of the previous relation in the form .. math:: \lambda \in \partial \sigma_{P} (-y), with :math:`\sigma_{P}` the support function of :math:`P` and :math:`\partial \sigma_{P}` the subdifferential of this support function. Note that the polyhedral set :math:`P` is described as :math:`\{\lambda\mid H \lambda \geq K\}`, where :math:`H` is a matrix and :math:`K` a vector. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, size: "unsigned int", H: "SP::SimpleMatrix", K: "SP::SiconosVector"): r""" Constructor with the polyhedral representation of P as Hx >= K :type size: int :param size: size of the NonSmoothLaw :type H: :py:class:`SimpleMatrix` :param H: matrix in the (H-K)-representation of the polytope P :type K: :py:class:`SiconosVector` :param K: vector in the (H-K)-representation of the polytope P """ if self.__class__ == NormalConeNSL: _self = None else: _self = self _sicpykernel.NormalConeNSL_swiginit(self, _sicpykernel.new_NormalConeNSL(_self, size, H, K)) __swig_destroy__ = _sicpykernel.delete_NormalConeNSL
[docs] def H(self) -> "SimpleMatrix &": r""" get H :rtype: :py:class:`SimpleMatrix` :return: a reference to the H matrix """ return _sicpykernel.NormalConeNSL_H(self)
[docs] def K(self) -> "SiconosVector &": r""" get K :rtype: :py:class:`SiconosVector` :return: a reference to the K vector """ return _sicpykernel.NormalConeNSL_K(self)
[docs] def isVerified(self) -> "bool": r""" check the ns law to see if it is verified :rtype: boolean :return: true if the NS Law is verified, false otherwise """ return _sicpykernel.NormalConeNSL_isVerified(self)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.NormalConeNSL_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NormalConeNSL(self) return weakref.proxy(self)
# Register NormalConeNSL in _sicpykernel: _sicpykernel.NormalConeNSL_swigregister(NormalConeNSL)
[docs] class DynamicalSystem(object): r""" Abstract interface to Dynamical Systems This class is used to describe dynamical systems of the form : :math:`g(\dot x, x, t, z) = 0` where - :math:`x \in R^{n}` is the state. - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discret state. For example, z may be used to set some perturbation parameters, to control the system (z set by actuators) and so on. - :math:`g : R^{n} \times R \to R^{n}` . By default, the DynamicalSystem is considered to be an Initial Value Problem (IVP) and the initial conditions are given by :math:`x(t_0)=x_0` Under some specific conditions, the system can be written as: :math:`\dot x = rhs(x, t, z)` In that case, :math:`\nabla_{\dot x} g` must be invertible. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr local_buffer = _sicpykernel.DynamicalSystem_local_buffer freeresidu = _sicpykernel.DynamicalSystem_freeresidu free = _sicpykernel.DynamicalSystem_free acce_memory = _sicpykernel.DynamicalSystem_acce_memory acce_like = _sicpykernel.DynamicalSystem_acce_like sizeWorkV = _sicpykernel.DynamicalSystem_sizeWorkV _number = property(_sicpykernel.DynamicalSystem__number_get, _sicpykernel.DynamicalSystem__number_set, doc=r""" An id number for the DynamicalSystem""") _n = property(_sicpykernel.DynamicalSystem__n_get, _sicpykernel.DynamicalSystem__n_set, doc=r""" the dimension of the system (*ie* size of the state vector x)""") _x0 = property(_sicpykernel.DynamicalSystem__x0_get, _sicpykernel.DynamicalSystem__x0_set, doc=r""" initial state of the system""") _r = property(_sicpykernel.DynamicalSystem__r_get, _sicpykernel.DynamicalSystem__r_set, doc=r""" the input vector due to the non-smooth law :math:`r \in R^{n}` (multiplier, force, ...) Remarks: V.A. 17/09/2011 : This should be a VectorOfVectors as for _x when higher relative degree systems will be simulated """) _x = property(_sicpykernel.DynamicalSystem__x_get, _sicpykernel.DynamicalSystem__x_set, doc=r""" state of the system, :math:`x \in R^{n}` - With _x[0]= :math:`x` , _x[1]= :math:`\dot{x}` . """) _jacxRhs = property(_sicpykernel.DynamicalSystem__jacxRhs_get, _sicpykernel.DynamicalSystem__jacxRhs_set, doc=r""" jacobian according to x of the right-hand side (:math:`rhs = \dot x = f(x,t) + r`)""") _z = property(_sicpykernel.DynamicalSystem__z_get, _sicpykernel.DynamicalSystem__z_set, doc=r""" Arbitrary algebraic values vector, z, discrete state of the system. """) _xMemory = property(_sicpykernel.DynamicalSystem__xMemory_get, doc=r""" the previous state vectors stored in memory""") _stepsInMemory = property(_sicpykernel.DynamicalSystem__stepsInMemory_get, _sicpykernel.DynamicalSystem__stepsInMemory_set, doc=r""" number of previous states stored in memory""") def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* minimal constructor, from state dimension result in :math:`\dot x = r` :type dimension: int :param dimension: size of the system (n) | *Overload 3:* Copy constructor :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem to copy """ if self.__class__ == DynamicalSystem: _self = None else: _self = self _sicpykernel.DynamicalSystem_swiginit(self, _sicpykernel.new_DynamicalSystem(_self, *args)) def _zeroPlugin(self) -> "void": r""" Initialize all PluggedObject whether they are used or not.""" return _sicpykernel.DynamicalSystem__zeroPlugin(self) def _init(self) -> "void": r""" Common code for constructors should be replaced in C++11 by delegating constructors """ return _sicpykernel.DynamicalSystem__init(self) __swig_destroy__ = _sicpykernel.delete_DynamicalSystem
[docs] def initRhs(self, time: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type time: float :param time: of initialization """ return _sicpykernel.DynamicalSystem_initRhs(self, time)
[docs] def initializeNonSmoothInput(self, level: "unsigned int") -> "void": r""" set nonsmooth input to zero :type level: int :param level: input-level to be initialized. """ return _sicpykernel.DynamicalSystem_initializeNonSmoothInput(self, level)
[docs] def update(self, time: "double") -> "void": r""" compute all component of the dynamical system, for the current state. :type time: float :param time: current time (the one used to update ds component) """ return _sicpykernel.DynamicalSystem_update(self, time)
[docs] def computeRhs(self, time: "double") -> "void": r""" update right-hand side for the current state :type time: float :param time: of interest """ return _sicpykernel.DynamicalSystem_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" update :math:`\nabla_x rhs` for the current state :type time: float :param time: of interest """ return _sicpykernel.DynamicalSystem_computeJacobianRhsx(self, time)
[docs] def resetAllNonSmoothParts(self) -> "void": r""" reset nonsmooth part of the rhs, for all 'levels'""" return _sicpykernel.DynamicalSystem_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" set nonsmooth part of the rhs to zero for a given level :type level: int :param level: """ return _sicpykernel.DynamicalSystem_resetNonSmoothPart(self, level)
[docs] def number(self) -> "size_t": r""" returns the id of the dynamical system""" return _sicpykernel.DynamicalSystem_number(self)
[docs] def setNumber(self, new_number: "size_t") -> "size_t": r""" set the id of the DynamicalSystem :rtype: int :return: the previous value of number """ return _sicpykernel.DynamicalSystem_setNumber(self, new_number)
[docs] def n(self) -> "unsigned int": r""" returns the size of the vector state x""" return _sicpykernel.DynamicalSystem_n(self)
[docs] def dimension(self) -> "unsigned int": r""" returns the dimension of the system (depends on system type, e.g. n for first order, ndof for Lagrangian). """ return _sicpykernel.DynamicalSystem_dimension(self)
[docs] def x0(self) -> "SP::SiconosVector": r""" returns a pointer to the initial state vector""" return _sicpykernel.DynamicalSystem_x0(self)
[docs] def getX0(self) -> "SiconosVector const": r""" get a copy of the initial state vector""" return _sicpykernel.DynamicalSystem_getX0(self)
[docs] def setX0(self, newValue: "SiconosVector") -> "void": r""" set initial state (copy) :type newValue: :py:class:`SiconosVector` :param newValue: input vector to copy """ return _sicpykernel.DynamicalSystem_setX0(self, newValue)
[docs] def setX0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial state (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: vector (pointer) to set x0 """ return _sicpykernel.DynamicalSystem_setX0Ptr(self, newPtr)
[docs] def x(self) -> "SP::SiconosVector": r""" returns a pointer to the state vector :math:`x` :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_x(self)
[docs] def getx(self) -> "SiconosVector const &": r""" get a copy of the current state vector :math:`x` :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.DynamicalSystem_getx(self)
[docs] def setX(self, newValue: "SiconosVector") -> "void": r""" set content of current state vector :math:`x` :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.DynamicalSystem_setX(self, newValue)
[docs] def setXPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set state vector :math:`x` (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_setXPtr(self, newPtr)
[docs] def r(self) -> "SP::SiconosVector": r""" returns a pointer to r vector (input due to nonsmooth behavior) :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_r(self)
[docs] def getR(self) -> "SiconosVector const": r""" get a copy of r vector (input due to nonsmooth behavior) :rtype: :py:class:`SiconosVector` :return: a SiconosVector """ return _sicpykernel.DynamicalSystem_getR(self)
[docs] def setR(self, newValue: "SiconosVector") -> "void": r""" set r vector (input due to nonsmooth behavior) content (copy) :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.DynamicalSystem_setR(self, newValue)
[docs] def setRPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set r vector (input due to nonsmooth behavior) (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector newPtr """ return _sicpykernel.DynamicalSystem_setRPtr(self, newPtr)
[docs] def rhs(self) -> "SP::SiconosVector": r""" returns a pointer to the right-hand side vector, (i.e. :math:`\dot x`) :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_rhs(self)
[docs] def getRhs(self) -> "SiconosVector &": r""" get a copy of the right-hand side vector, (i.e. :math:`\dot x`) :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.DynamicalSystem_getRhs(self)
[docs] def setRhs(self, newValue: "SiconosVector") -> "void": r""" set the value of the right-hand side, :math:`\dot x` :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.DynamicalSystem_setRhs(self, newValue)
[docs] def setRhsPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set right-hand side, :math:`\dot x` (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_setRhsPtr(self, newPtr)
[docs] def jacobianRhsx(self) -> "SP::SiconosMatrix": r""" returns a pointer to :math:`\nabla_x rhs()` :rtype: :py:class:`SiconosMatrix` :return: SP::SiconosMatrix """ return _sicpykernel.DynamicalSystem_jacobianRhsx(self)
[docs] def setJacobianRhsx(self, newValue: "SiconosMatrix") -> "void": r""" set the value of :math:`\nabla_x rhs()` :type newValue: :py:class:`SiconosMatrix` :param newValue: SiconosMatrix """ return _sicpykernel.DynamicalSystem_setJacobianRhsx(self, newValue)
[docs] def setJacobianRhsxPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set :math:`\nabla_x rhs()`, pointer link :type newPtr: :py:class:`SiconosMatrix` :param newPtr: SP::SiconosMatrix """ return _sicpykernel.DynamicalSystem_setJacobianRhsxPtr(self, newPtr)
[docs] def z(self) -> "SP::SiconosVector": r""" returns a pointer to :math:`z`, the vector of algebraic parameters. :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_z(self)
[docs] def getz(self) -> "SiconosVector const &": r""" get a copy of :math:`z`, the vector of algebraic parameters. :rtype: :py:class:`SiconosVector` :return: a SiconosVector """ return _sicpykernel.DynamicalSystem_getz(self)
[docs] def setz(self, newValue: "SiconosVector") -> "void": r""" set the value of :math:`z` (copy) :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.DynamicalSystem_setz(self, newValue)
[docs] def setzPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set :math:`z` (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector """ return _sicpykernel.DynamicalSystem_setzPtr(self, newPtr)
[docs] def xMemory(self) -> "SiconosMemory &": r""" get all the values of the state vector x stored in a SiconosMemory object (not const due to LinearSMC::actuate) :rtype: :py:class:`SiconosMemory` :return: a reference to the SiconosMemory object """ return _sicpykernel.DynamicalSystem_xMemory(self)
[docs] def stepsInMemory(self) -> "unsigned int": r""" returns the number of step saved in memory for state vector :rtype: int :return: int """ return _sicpykernel.DynamicalSystem_stepsInMemory(self)
[docs] def setStepsInMemory(self, steps: "unsigned int") -> "void": r""" set number of steps to be saved :type steps: int :param steps: """ return _sicpykernel.DynamicalSystem_setStepsInMemory(self, steps)
[docs] def initMemory(self, steps: "unsigned int") -> "void": r""" initialize the SiconosMemory objects: reserve memory for i vectors in memory and reset all to zero. :type steps: int :param steps: the size of the SiconosMemory (i) """ return _sicpykernel.DynamicalSystem_initMemory(self, steps)
[docs] def swapInMemory(self) -> "void": r""" push the current values of x and r in memory (index 0 of memory is the last inserted vector) xMemory and rMemory, """ return _sicpykernel.DynamicalSystem_swapInMemory(self)
[docs] def updatePlugins(self, time: "double") -> "void": r""" call all plugged functions for the current state :type time: float :param time: the current time """ return _sicpykernel.DynamicalSystem_updatePlugins(self, time)
[docs] @staticmethod def resetCount(new_count: "size_t"=0) -> "size_t": r""" reset the global DynamicSystem counter (for ids) :rtype: int :return: the previous value of count """ return _sicpykernel.DynamicalSystem_resetCount(new_count)
[docs] def resetToInitialState(self) -> "void": r""" reset the state x() to the initial state x0""" return _sicpykernel.DynamicalSystem_resetToInitialState(self)
[docs] def isLinear(self) -> "bool": r""" :rtype: boolean :return: true if the system is linear """ return _sicpykernel.DynamicalSystem_isLinear(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data of the dynamical system on the standard output""" return _sicpykernel.DynamicalSystem_display(self, brief)
def __disown__(self): self.this.disown() _sicpykernel.disown_DynamicalSystem(self) return weakref.proxy(self)
# Register DynamicalSystem in _sicpykernel: _sicpykernel.DynamicalSystem_swigregister(DynamicalSystem)
[docs] def DynamicalSystem_resetCount(new_count: "size_t"=0) -> "size_t": r""" reset the global DynamicSystem counter (for ids) :rtype: int :return: the previous value of count """ return _sicpykernel.DynamicalSystem_resetCount(new_count)
[docs] class NonSmoothDynamicalSystem(object): r""" the NonSmoothDynamicalSystem consists in Dynamical Systems and Interactions structured into a graph defined in a Topology. In the DynamicalSystem graph, DynamicalSystem objects are nodes and Interaction objects are edges. To add a DynamicalSystem, use insertDynamicalSystem method. To add a new Interaction, use link method. A dual graph is also contructed, where Interactions are vertices and DynamicalSystems are edges. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr addDynamicalSystem = _sicpykernel.NonSmoothDynamicalSystem_addDynamicalSystem rmDynamicalSystem = _sicpykernel.NonSmoothDynamicalSystem_rmDynamicalSystem addInteraction = _sicpykernel.NonSmoothDynamicalSystem_addInteraction rmInteraction = _sicpykernel.NonSmoothDynamicalSystem_rmInteraction clearTopology = _sicpykernel.NonSmoothDynamicalSystem_clearTopology def __init__(self, t0: "double", T: "double"): r""" NSDS constructor. :type t0: float :param t0: initial time :type T: float :param T: final time """ _sicpykernel.NonSmoothDynamicalSystem_swiginit(self, _sicpykernel.new_NonSmoothDynamicalSystem(t0, T)) __swig_destroy__ = _sicpykernel.delete_NonSmoothDynamicalSystem
[docs] def currentTime(self) -> "double": r""" :rtype: float :return: the current time value """ return _sicpykernel.NonSmoothDynamicalSystem_currentTime(self)
[docs] def setCurrentTime(self, newValue: "double") -> "void": r""" set the current time :type newValue: float :param newValue: the new time """ return _sicpykernel.NonSmoothDynamicalSystem_setCurrentTime(self, newValue)
[docs] def t0(self) -> "double": r""" :rtype: float :return: initial time """ return _sicpykernel.NonSmoothDynamicalSystem_t0(self)
[docs] def sett0(self, newT0: "double") -> "void": r""" set initial time of the time discretisation :type newT0: float :param newT0: """ return _sicpykernel.NonSmoothDynamicalSystem_sett0(self, newT0)
[docs] def finalT(self) -> "double": r""" :rtype: float :return: final time """ return _sicpykernel.NonSmoothDynamicalSystem_finalT(self)
[docs] def setT(self, newValue: "double") -> "void": r""" set final time :type newValue: float :param newValue: the new final time for the Simulatiom """ return _sicpykernel.NonSmoothDynamicalSystem_setT(self, newValue)
[docs] def title(self) -> "std::string const": r""" get the title of the simulation :rtype: string :return: std::string : the title """ return _sicpykernel.NonSmoothDynamicalSystem_title(self)
[docs] def setTitle(self, s: "std::string const &") -> "void": r""" set the title of the simulation :type s: string :param s: : the title """ return _sicpykernel.NonSmoothDynamicalSystem_setTitle(self, s)
[docs] def author(self) -> "std::string const": r""" get the author of the simulation :rtype: string :return: std::string : the author """ return _sicpykernel.NonSmoothDynamicalSystem_author(self)
[docs] def setAuthor(self, s: "std::string const &") -> "void": r""" set the author of the simulation :type s: string :param s: std::string : the author """ return _sicpykernel.NonSmoothDynamicalSystem_setAuthor(self, s)
[docs] def description(self) -> "std::string const": r""" allows to get the description of the simulation :rtype: string :return: std::string : the description """ return _sicpykernel.NonSmoothDynamicalSystem_description(self)
[docs] def setDescription(self, s: "std::string const &") -> "void": r""" set the author of the simulation :type s: string :param s: std::string : the author """ return _sicpykernel.NonSmoothDynamicalSystem_setDescription(self, s)
[docs] def date(self) -> "std::string const": r""" allows to get the date of the simulation :rtype: string :return: std::string : the date """ return _sicpykernel.NonSmoothDynamicalSystem_date(self)
[docs] def setDate(self, s: "std::string const &") -> "void": r""" set the date of the simulation :type s: string :param s: std::string : the date """ return _sicpykernel.NonSmoothDynamicalSystem_setDate(self, s)
[docs] def isBVP(self) -> "bool": r""" get problem type (true if BVP) :rtype: boolean :return: a bool """ return _sicpykernel.NonSmoothDynamicalSystem_isBVP(self)
[docs] def isIVP(self) -> "bool": r""" get problem type (true if IVP) :rtype: boolean :return: a bool """ return _sicpykernel.NonSmoothDynamicalSystem_isIVP(self)
[docs] def setBVP(self, newBvp: "bool const &") -> "void": r""" set the NonSmoothDynamicalSystem to BVP, else it is IVP :type newBvp: boolean :param newBvp: true if BVP, false otherwise """ return _sicpykernel.NonSmoothDynamicalSystem_setBVP(self, newBvp)
[docs] def changeLog(self) -> "NonSmoothDynamicalSystem::ChangeLog const &": r""" get a reference to the changelog for an NSDS. :rtype: NonSmoothDynamicalSystem::ChangeLog :return: a reference to the changelog. """ return _sicpykernel.NonSmoothDynamicalSystem_changeLog(self)
[docs] def changeLogPosition(self) -> "NonSmoothDynamicalSystem::ChangeLogIter": r""" get an iterator to the last item in the changelog. :rtype: NonSmoothDynamicalSystem::ChangeLogIter :return: an iterator pointing at the last item in the changelog. """ return _sicpykernel.NonSmoothDynamicalSystem_changeLogPosition(self)
[docs] def changeLogBegin(self) -> "NonSmoothDynamicalSystem::ChangeLogIter": r""" get an iterator to the beginning of the changelog. :rtype: NonSmoothDynamicalSystem::ChangeLogIter :return: an iterator pointing at the beginning of the changelog. """ return _sicpykernel.NonSmoothDynamicalSystem_changeLogBegin(self)
[docs] def clearChangeLogTo(self, it: "NonSmoothDynamicalSystem::ChangeLogIter const &") -> "void": r""" clear the changelog up to a given position. :type it: NonSmoothDynamicalSystem::ChangeLogIter :param it: This iterator must point to somewhere in the changelog for this NSDS. """ return _sicpykernel.NonSmoothDynamicalSystem_clearChangeLogTo(self, it)
[docs] def getNumberOfDS(self) -> "size_t": r""" :rtype: int :return: the number of Dynamical Systems present in the NSDS """ return _sicpykernel.NonSmoothDynamicalSystem_getNumberOfDS(self)
[docs] def dynamicalSystems(self) -> "SP::DynamicalSystemsGraph const": r""" get all the dynamical systems declared in the NonSmoothDynamicalSystem. :rtype: :py:class:`DynamicalSystemsGraph` :return: a SP::DynamicalSystemsGraph """ return _sicpykernel.NonSmoothDynamicalSystem_dynamicalSystems(self)
[docs] def dynamicalSystemsVector(self) -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >": r""" get all the dynamical systems declared in the NonSmoothDynamicalSystem. into a std::vector<SP::DynamicalSystem> Useful for iterates on DynamicalSystems in Python for instance :rtype: std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > > :return: std::vector<SP::DynamicalSystem> """ return _sicpykernel.NonSmoothDynamicalSystem_dynamicalSystemsVector(self)
[docs] def insertDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void": r""" add a dynamical system into the DS graph (as a vertex) :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the system to add """ return _sicpykernel.NonSmoothDynamicalSystem_insertDynamicalSystem(self, ds)
[docs] def dynamicalSystem(self, nb: "unsigned int") -> "SP::DynamicalSystem": r""" get Dynamical system number I :type nb: int :param nb: the identifier of the DynamicalSystem to get :rtype: :py:class:`DynamicalSystem` :return: a pointer on DynamicalSystem """ return _sicpykernel.NonSmoothDynamicalSystem_dynamicalSystem(self, nb)
def displayDynamicalSystems(self) -> "void": return _sicpykernel.NonSmoothDynamicalSystem_displayDynamicalSystems(self)
[docs] def removeDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void": r""" remove a dynamical system :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the dynamical system to remove """ return _sicpykernel.NonSmoothDynamicalSystem_removeDynamicalSystem(self, ds)
[docs] def getNumberOfInteractions(self) -> "size_t": r""" get the number of Interactions present in the NSDS. :rtype: int :return: an unsigned int """ return _sicpykernel.NonSmoothDynamicalSystem_getNumberOfInteractions(self)
[docs] def interactions(self) -> "SP::InteractionsGraph const": r""" return the graph of Interactions present in the NSDS. :rtype: :py:class:`InteractionsGraph` :return: SP::InteractionGraph """ return _sicpykernel.NonSmoothDynamicalSystem_interactions(self)
[docs] def removeInteraction(self, inter: "SP::Interaction") -> "void": r""" remove an interaction to the system :type inter: :py:class:`Interaction` :param inter: a pointer to the interaction to remove """ return _sicpykernel.NonSmoothDynamicalSystem_removeInteraction(self, inter)
[docs] def interaction(self, *args) -> "SP::Interaction": r""" *Overload 1:* get Interaction number I :type nb: int :param nb: the identifier of the Interaction to get :rtype: :py:class:`Interaction` :return: a pointer to an Interaction | *Overload 2:* get Interaction named name :type name: string :param name: of the Interaction to get :rtype: :py:class:`Interaction` :return: a pointer to an Interaction """ return _sicpykernel.NonSmoothDynamicalSystem_interaction(self, *args)
[docs] def InteractionsVector(self) -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >": r""" get all the interactions declared in the NonSmoothDynamicalSystem. into a std::vector<SP::Interaction> Useful for iterates on Interaction in Python for instance :rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > > :return: std::vector<SP::Interaction> """ return _sicpykernel.NonSmoothDynamicalSystem_InteractionsVector(self)
[docs] def setName(self, *args) -> "void": r""" *Overload 1:* set the name for this Dynamical System :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the system :type name: string :param name: the name of the DynamicalSystem | *Overload 2:* set the name for this Interaction :type interaction: :py:class:`Interaction` :param interaction: a pointer to the Interaction :type name: string :param name: the name of the Interaction """ return _sicpykernel.NonSmoothDynamicalSystem_setName(self, *args)
[docs] def name(self, *args) -> "std::string": r""" *Overload 1:* get the name for this Dynamical System :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the system :rtype: string :return: name the name of the DynamicalSystem, or empty string if not found. | *Overload 2:* get the name for this Interaction :type inter: :py:class:`Interaction` :param inter: a pointer to the Interaction :rtype: string :return: name the name of the Interaction, or empty string if not found. """ return _sicpykernel.NonSmoothDynamicalSystem_name(self, *args)
[docs] def setControlProperty(self, inter: "SP::Interaction", isControlInteraction: "bool const") -> "void": r""" specify id the given Interaction is for controlling the DS :type inter: :py:class:`Interaction` :param inter: the Interaction :type isControlInteraction: boolean :param isControlInteraction: true if the Interaction is used for control purposes """ return _sicpykernel.NonSmoothDynamicalSystem_setControlProperty(self, inter, isControlInteraction)
[docs] def topology(self) -> "SP::Topology": r""" get the topology of the system :rtype: :py:class:`Topology` :return: a pointer on Topology """ return _sicpykernel.NonSmoothDynamicalSystem_topology(self)
[docs] def display(self) -> "void": r""" display the data of the Non Smooth Dynamical System""" return _sicpykernel.NonSmoothDynamicalSystem_display(self)
[docs] def isLinear(self) -> "bool": r""" return false is one of the interations is not linear. else return true. :rtype: boolean :return: a bool """ return _sicpykernel.NonSmoothDynamicalSystem_isLinear(self)
def clear(self) -> "void": return _sicpykernel.NonSmoothDynamicalSystem_clear(self)
[docs] def setSymmetric(self, val: "bool") -> "void": r""" set symmetry in the blocks computation :type val: boolean :param val: a bool """ return _sicpykernel.NonSmoothDynamicalSystem_setSymmetric(self, val)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" Set all DS non-smooth part to zero for a given level. :type level: int :param level: the level to will be zeroed """ return _sicpykernel.NonSmoothDynamicalSystem_resetNonSmoothPart(self, level)
[docs] def swapInMemory(self) -> "void": r""" save DynamicalSystems and Interactions states in Memories""" return _sicpykernel.NonSmoothDynamicalSystem_swapInMemory(self)
[docs] def pushInteractionsInMemory(self) -> "void": r""" save interaction states in memories. Applied to all interactions of the connected topology """ return _sicpykernel.NonSmoothDynamicalSystem_pushInteractionsInMemory(self)
[docs] def updateDSPlugins(self, time: "double") -> "void": r""" update the plugins of the DS :type time: float :param time: to be used for plugins """ return _sicpykernel.NonSmoothDynamicalSystem_updateDSPlugins(self, time)
[docs] def updateInput(self, time: "double", level: "unsigned int") -> "void": r""" compute r thanks to lambda[level] for all Interactions :type time: float :param time: :type level: int :param level: lambda level """ return _sicpykernel.NonSmoothDynamicalSystem_updateInput(self, time, level)
[docs] def updateOutput(self, *args) -> "void": r""" *Overload 1:* compute output for all the interactions for a given level :type time: float :param time: :type level: int, optional :param level: y order to be computed | *Overload 2:* compute output for all the interactions and for a level range :type time: float :param time: :type level_min: int :param level_min: y min order to be computed :type level_max: int :param level_max: y max order to be computed """ return _sicpykernel.NonSmoothDynamicalSystem_updateOutput(self, *args)
[docs] def computeInteractionJacobians(self, *args) -> "void": r""" *Overload 1:* compute Jacobians for all the interactions (in indexSet0) :type time: float :param time: | *Overload 2:* compute Jacobians for all the interactions of a given index set :type time: float :param time: :type indexSet: :py:class:`InteractionsGraph` :param indexSet: InteractionsGraph of interest """ return _sicpykernel.NonSmoothDynamicalSystem_computeInteractionJacobians(self, *args)
[docs] def visitDynamicalSystems(self, visitor: "SP::SiconosVisitor") -> "void": r""" visit all dynamical systems in this system :type visitor: SP::SiconosVisitor :param visitor: an SP::SiconosVisitor that can visit classes derived from DS """ return _sicpykernel.NonSmoothDynamicalSystem_visitDynamicalSystems(self, visitor)
# Register NonSmoothDynamicalSystem in _sicpykernel: _sicpykernel.NonSmoothDynamicalSystem_swigregister(NonSmoothDynamicalSystem)
[docs] class LinearComplementaritySystemsNSDS(NonSmoothDynamicalSystem): r""" The LinearComplementaritySystemsNSDS_H inherits frim NSDS for a direct instanciation of a LCS """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, t0: "double", T: "double", x0: "SP::SiconosVector", A: "SP::SimpleMatrix", B: "SP::SimpleMatrix", C: "SP::SimpleMatrix", D: "SP::SimpleMatrix", a: "SP::SiconosVector", b: "SP::SiconosVector"): r""" constructor with t0 and T :type t0: float :param t0: initial time :type T: float :param T: final time """ _sicpykernel.LinearComplementaritySystemsNSDS_swiginit(self, _sicpykernel.new_LinearComplementaritySystemsNSDS(t0, T, x0, A, B, C, D, a, b)) __swig_destroy__ = _sicpykernel.delete_LinearComplementaritySystemsNSDS def ds(self) -> "SP::FirstOrderLinearTIDS": return _sicpykernel.LinearComplementaritySystemsNSDS_ds(self) def relation(self) -> "SP::FirstOrderLinearTIR": return _sicpykernel.LinearComplementaritySystemsNSDS_relation(self) def nslaw(self) -> "SP::ComplementarityConditionNSL": return _sicpykernel.LinearComplementaritySystemsNSDS_nslaw(self)
[docs] def interaction(self) -> "SP::Interaction": return _sicpykernel.LinearComplementaritySystemsNSDS_interaction(self)
# Register LinearComplementaritySystemsNSDS in _sicpykernel: _sicpykernel.LinearComplementaritySystemsNSDS_swigregister(LinearComplementaritySystemsNSDS)
[docs] class Topology(object): r""" This class describes the topology of the non-smooth dynamical system. It holds all the "potential" Interactions". Topology is built in NSDS constructors but initialized in Simulation->initialize(), ie when all Interactions have been clearly defined. Note that indexSet0 holds all the possible relations (declared by user) not only those which are "actives". Construction consists in: - link with the NSDS that owns the topology. Initialization consists in: - scan of all the interactions of the NSDS - initialization of each interaction - insertion of the relations of all the Interaction into indexSet0 Insertion of an Interaction into the set indexSet0: addInteractionInIndexSet0(SP::Interaction inter) for each relation of the interaction, it creates a new Interaction and inserts it into indexSet0 It also counts the total number of "constraints" in the system. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r""" default constructor""" _sicpykernel.Topology_swiginit(self, _sicpykernel.new_Topology()) __swig_destroy__ = _sicpykernel.delete_Topology
[docs] def hasDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "bool": r""" check if an dynamical system is already a vertex of the DSs graph. :type ds: :py:class:`DynamicalSystem` :param ds: the DS to test :rtype: boolean :return: true if ds is in the graph """ return _sicpykernel.Topology_hasDynamicalSystem(self, ds)
[docs] def hasInteraction(self, inter: "SP::Interaction") -> "bool": r""" check if an interaction is already a vertex of the Interactions graph. :type inter: :py:class:`Interaction` :param inter: the Interaction to test :rtype: boolean :return: true if inter is in the graph """ return _sicpykernel.Topology_hasInteraction(self, inter)
[docs] def removeInteraction(self, inter: "SP::Interaction") -> "void": r""" remove an Interaction from the topology. The interaction is removed from Dynamical Systems graph and Interactions Graph. The interaction is not removed from actives subgraphs : see updateIndexSet :type inter: :py:class:`Interaction` :param inter: the interaction to remove """ return _sicpykernel.Topology_removeInteraction(self, inter)
[docs] def insertDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void": r""" add a dynamical system :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem to add """ return _sicpykernel.Topology_insertDynamicalSystem(self, ds)
[docs] def removeDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void": r""" remove a Dynamical System from the topology. The dynamical system is removed from Dynamical Systems graph and Interactions Graph. The dynamical system is not removed from actives subgraphs : see updateIndexSet :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system to remove """ return _sicpykernel.Topology_removeDynamicalSystem(self, ds)
[docs] def setName(self, *args) -> "void": r""" *Overload 1:* set the name for this Dynamical System :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the system :type name: string :param name: the name of the DynamicalSystem | *Overload 2:* set the name for an Interaction :type inter: :py:class:`Interaction` :param inter: a pointer to the Interaction :type name: string :param name: the name of the Interaction """ return _sicpykernel.Topology_setName(self, *args)
[docs] def name(self, *args) -> "std::string": r""" *Overload 1:* get the name for this Dynamical System :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to the system :rtype: string :return: name the name of the DynamicalSystem, or empty string if not found. | *Overload 2:* get the name for this Interaction :type inter: :py:class:`Interaction` :param inter: a pointer to the Interaction :rtype: string :return: name the name of the Interaction, or empty string if not found. """ return _sicpykernel.Topology_name(self, *args)
[docs] def setOSI(self, ds: "SP::DynamicalSystem", OSI: "SP::OneStepIntegrator") -> "void": r""" set the OSI for this DynamicalSystem :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem :type OSI: :py:class:`OneStepIntegrator` :param OSI: the integrator to use for this DS """ return _sicpykernel.Topology_setOSI(self, ds, OSI)
[docs] def setControlProperty(self, inter: "SP::Interaction", isControlInteraction: "bool const") -> "void": r""" specify if the given Interaction is for controlling the DS :type inter: :py:class:`Interaction` :param inter: Interaction :type isControlInteraction: boolean :param isControlInteraction: true if the Interaction is used for control purposes """ return _sicpykernel.Topology_setControlProperty(self, inter, isControlInteraction)
[docs] def indexSet0(self) -> "SP::InteractionsGraph": r""" get a pointer to the graph of all Interactions. :rtype: :py:class:`InteractionsGraph` :return: a SP::InteractionsGraph """ return _sicpykernel.Topology_indexSet0(self)
def interaction_properties(self, index: "unsigned int", inter: "SP::Interaction") -> "SP::InteractionProperties": return _sicpykernel.Topology_interaction_properties(self, index, inter)
[docs] def indexSet(self, num: "unsigned int") -> "SP::InteractionsGraph": r""" get a pointer to the graph at level num of Interactions :type num: int :param num: the number of indexSet :rtype: :py:class:`InteractionsGraph` :return: a SP::InteractionsGraph """ return _sicpykernel.Topology_indexSet(self, num)
[docs] def numberOfIndexSet(self) -> "size_t": r""" get a pointer to the graph at level num of Interactions :rtype: int :return: a SP::InteractionsGraph """ return _sicpykernel.Topology_numberOfIndexSet(self)
[docs] def resetIndexSetPtr(self, num: "unsigned int") -> "void": r""" reset graph at level num of Interactions :type num: int :param num: the indexSet to reset """ return _sicpykernel.Topology_resetIndexSetPtr(self, num)
[docs] def dSG(self, num: "unsigned int") -> "SP::DynamicalSystemsGraph": r""" get a pointer to the graph at level num of Dynamical System :type num: int :param num: the level :rtype: :py:class:`DynamicalSystemsGraph` :return: a SP::DynamicalSystemsGraph """ return _sicpykernel.Topology_dSG(self, num)
[docs] def indexSetsSize(self) -> "size_t": r""" get the number of Interactions Graphs :rtype: int :return: the number of Interactions Graphs """ return _sicpykernel.Topology_indexSetsSize(self)
[docs] def indexSetSize(self, level: "unsigned int") -> "size_t": r""" get the size of the InteractionGraphs at a given level :type level: int :param level: :rtype: int :return: size of the InteractionGraphs at a given level """ return _sicpykernel.Topology_indexSetSize(self, level)
[docs] def indexSetsResize(self, newSize: "unsigned int") -> "void": r""" resize Interactions Graphs :type newSize: int :param newSize: the new size """ return _sicpykernel.Topology_indexSetsResize(self, newSize)
[docs] def setHasChanged(self, val: "bool const") -> "void": r""" set _hasChanged to val :type val: boolean :param val: a bool """ return _sicpykernel.Topology_setHasChanged(self, val)
[docs] def hasChanged(self) -> "bool": r""" check :rtype: boolean :return: a bool """ return _sicpykernel.Topology_hasChanged(self)
[docs] def numberOfConstraints(self) -> "unsigned int": r""" get the total number of scalar constraints :rtype: int :return: an unsigned int """ return _sicpykernel.Topology_numberOfConstraints(self)
def clear(self) -> "void": return _sicpykernel.Topology_clear(self)
[docs] def setSymmetric(self, val: "bool") -> "void": r""" set symmetry in the blocks computation :type val: boolean :param val: a bool """ return _sicpykernel.Topology_setSymmetric(self, val)
[docs] def setProperties(self) -> "void": r""" initialize graphs properties""" return _sicpykernel.Topology_setProperties(self)
[docs] def displayDynamicalSystems(self) -> "void": r""" list and display all dynamical systems""" return _sicpykernel.Topology_displayDynamicalSystems(self)
[docs] def getDynamicalSystem(self, *args) -> "SP::DynamicalSystem": r""" *Overload 1:* Get a dynamical system using its number Warning: O(n) complexity :type requiredNumber: int :param requiredNumber: the required number :rtype: :py:class:`DynamicalSystem` :return: a DynamicalSystem | *Overload 2:* Get a dynamical system using its name Warning: O(n) complexity :type name: string :param name: the name of the dynamical system :rtype: :py:class:`DynamicalSystem` :return: a DynamicalSystem """ return _sicpykernel.Topology_getDynamicalSystem(self, *args)
[docs] def getInteraction(self, *args) -> "SP::Interaction": r""" *Overload 1:* Get a interaction using its number Warning: O(n) complexity :type requiredNumber: int :param requiredNumber: the required number :rtype: :py:class:`Interaction` :return: an Interaction | *Overload 2:* Get a interaction using its name Warning: O(n) complexity :type name: string :param name: the name of the Interaction :rtype: :py:class:`Interaction` :return: an Interaction pointer """ return _sicpykernel.Topology_getInteraction(self, *args)
[docs] def interactionsForDS(self, arg2: "SP::DynamicalSystem") -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >": r""" get Interactions for a given DS :rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > > :return: a vector of pointers to Interaction """ return _sicpykernel.Topology_interactionsForDS(self, arg2)
[docs] def interactionsForPairOfDS(self, *args) -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >": r""" get Interactions for a given pair of DSs :rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > > :return: a vector of pointers to Interaction """ return _sicpykernel.Topology_interactionsForPairOfDS(self, *args)
[docs] def dynamicalSystemsForInteraction(self, arg2: "SP::Interaction") -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >": r""" get DynamicalSystems for a given Interaction :rtype: std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > > :return: a vector of pointers to DynamicalSystem """ return _sicpykernel.Topology_dynamicalSystemsForInteraction(self, arg2)
[docs] def getDSG0Descriptor(self, ds: "SP::DynamicalSystem") -> "DynamicalSystemsGraph::VDescriptor": r""" Helper to get the descriptor in DSG0 from a DynamicalSystem :type ds: :py:class:`DynamicalSystem` :param ds: DynamicalSystem of which we want the descriptor :rtype: DynamicalSystemsGraph::VDescriptor :return: the descriptor in DSG0 from a DynamicalSystem """ return _sicpykernel.Topology_getDSG0Descriptor(self, ds)
[docs] def numberOfInvolvedDS(self, inumber: "unsigned int") -> "unsigned int": r""" get the number of DynamicalSystem currently involved in an indexSet :type inumber: int :param inumber: the indexSet number :rtype: int :return: the number of DynamicalSystem involved """ return _sicpykernel.Topology_numberOfInvolvedDS(self, inumber)
# Register Topology in _sicpykernel: _sicpykernel.Topology_swigregister(Topology)
[docs] class SecondOrderDS(DynamicalSystem): r""" Second Order non linear dynamical systems - :math:`M(q,z) \dot v = F(v, q, t, z) + p` This class defines and computes a generic ndof-dimensional second order Non Linear Dynamical System of the form : .. math:: M(q,z) \dot v = F(v, q, t, z) + p \\ \dot q = G(q,v) where - :math:`q \in R^{ndof}` is the set of the coordinates, - :math:`\dot q =v \in R^{ndof}` the velocity, - :math:`\ddot q = \dot v \in R^{ndof}` the acceleration, i. e. the second time derivative of the generalized coordinates. - :math:`p \in R^{ndof}` the reaction forces due to the Non Smooth Interaction. - :math:`M(q) \in R^{ndof \times ndof}` is the inertia term (access : mass() method). - :math:`F( \dot q , q , t) \in R^{ndof}` are the forces (access forces() method). - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discrete state. q[i] is the derivative number i of q. Thus: q[0]= :math:`q`, global coordinates, q[1]= :math:`\dot q`, velocity, q[2]= :math:`\ddot q`, acceleration. The following operators (and their jacobians) can be plugged, in the usual way (see User Guide, 'User-defined plugins') - :math:`M(q)` (computeMass()) - :math:`F(v , q , t, z)` (computeF()) If required (e.g. for Event-Driven like simulation), formulation as a first-order system is also available, and writes: - :math:`n= 2 ndof` - :math:`x = \left[\begin{array}{c}q \\ \dot q\end{array}\right]` - rhs given by: .. math:: \dot x = \left[\begin{array}{c} \dot q\\ \ddot q = M^{-1}(q)\left[F(v, q , t, z) + p \right]\\ \end{array}\right] - jacobian of the rhs, with respect to x .. math:: \nabla_{x}rhs(x,t) = \left[\begin{array}{cc} 0 & I \\ \nabla_{q}(M^{-1}(q)F(v, q , t, z)) & \nabla_{\dot q}(M^{-1}(q)F(v, q , t, z)) \\ \end{array}\right] with the input due to the non smooth law: .. math:: \left[\begin{array}{c} 0 \\ p \end{array}\right] In that case, use the following methods: - initRhs() to allocate/initialize memory for these new operators, - rhs() to get the rhs vector - computeRhs(), computeJacobianRhsx() ..., to update the content of rhs, its jacobians ... """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr _ndof = property(_sicpykernel.SecondOrderDS__ndof_get, _sicpykernel.SecondOrderDS__ndof_set, doc=r""" number of degrees of freedom of the system""") _mass = property(_sicpykernel.SecondOrderDS__mass_get, _sicpykernel.SecondOrderDS__mass_set, doc=r""" mass of the system""") _hasConstantMass = property(_sicpykernel.SecondOrderDS__hasConstantMass_get, _sicpykernel.SecondOrderDS__hasConstantMass_set, doc=r""" true if the mass matrix is constant""") _inverseMass = property(_sicpykernel.SecondOrderDS__inverseMass_get, _sicpykernel.SecondOrderDS__inverseMass_set, doc=r""" inverse or factorization of the mass of the system""") _p = property(_sicpykernel.SecondOrderDS__p_get, _sicpykernel.SecondOrderDS__p_set, doc=r""" "Reaction", generalized forces or imuplses due to the non smooth law The index corresponds to the kinematic level of the corresponding constraints. It mainly depends on what the simulation part want to store, but some rules have to be followed. For instance : - for the constraints at the acceleration level, _p[2] stores the reaction forces, - for the constraints at the veocity level, _p[1] stores the (discrete) reaction impulse - for the constraints at the position level, _p[0] stores the multiplier for a constraint in position """) _q0 = property(_sicpykernel.SecondOrderDS__q0_get, _sicpykernel.SecondOrderDS__q0_set, doc=r""" Initial position""") _pMemory = property(_sicpykernel.SecondOrderDS__pMemory_get, _sicpykernel.SecondOrderDS__pMemory_set, doc=r""" memory of previous generalized forces due to constraints""") _boundaryConditions = property(_sicpykernel.SecondOrderDS__boundaryConditions_get, _sicpykernel.SecondOrderDS__boundaryConditions_set, doc=r""" Boundary condition applied to a dynamical system""") _reactionToBoundaryConditions = property(_sicpykernel.SecondOrderDS__reactionToBoundaryConditions_get, _sicpykernel.SecondOrderDS__reactionToBoundaryConditions_set, doc=r""" Reaction to an applied boundary condition""") __swig_destroy__ = _sicpykernel.delete_SecondOrderDS
[docs] def p(self, level: "unsigned int"=2) -> "SP::SiconosVector": r""" get p :type level: int, optional :param level: unsigned int, required level for p, default = 2 :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_p(self, level)
[docs] def mass(self) -> "SP::SiconosMatrix": r""" get mass matrix (pointer link) :rtype: :py:class:`SiconosMatrix` :return: SP::SiconosMatrix """ return _sicpykernel.SecondOrderDS_mass(self)
[docs] def inverseMass(self) -> "SP::SimpleMatrix": r""" get (pointer) inverse or LU-factorization of the mass, used for LU-forward-backward computation :rtype: :py:class:`SimpleMatrix` :return: pointer SP::SimpleMatrix """ return _sicpykernel.SecondOrderDS_inverseMass(self)
[docs] def setMassPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set mass to pointer newPtr :type newPtr: :py:class:`SimpleMatrix` :param newPtr: a plugged matrix SP """ return _sicpykernel.SecondOrderDS_setMassPtr(self, newPtr)
[docs] def setRhs(self, newValue: "SiconosVector") -> "void": r""" set the value of the right-hand side, :math:`\dot x` :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.SecondOrderDS_setRhs(self, newValue)
[docs] def setRhsPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set right-hand side, :math:`\dot x` (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector """ return _sicpykernel.SecondOrderDS_setRhsPtr(self, newPtr)
[docs] def computeForces(self, time: "double", q: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void": r""" Compute :math:`F(v,q,t,z)` :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: SP::SiconosVector: pointers on q :type velocity: :py:class:`SiconosVector` :param velocity: SP::SiconosVector: pointers on velocity """ return _sicpykernel.SecondOrderDS_computeForces(self, time, q, velocity)
[docs] def computeJacobianqForces(self, time: "double") -> "void": r""" Compute :math:`\nabla_qF(v,q,t,z)` for current :math:`q,v` Default function to compute forces :type time: float :param time: the current time """ return _sicpykernel.SecondOrderDS_computeJacobianqForces(self, time)
[docs] def computeJacobianvForces(self, time: "double") -> "void": r""" Compute :math:`\nabla_{\dot q}F(v,q,t,z)` for current :math:`q,v` :type time: float :param time: the current time """ return _sicpykernel.SecondOrderDS_computeJacobianvForces(self, time)
[docs] def dimension(self) -> "unsigned int": r""" return the number of degrees of freedom of the system :rtype: int :return: an unsigned int. """ return _sicpykernel.SecondOrderDS_dimension(self)
[docs] def q(self) -> "SP::SiconosVector": r""" generalized coordinates of the system (vector of size dimension()) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_q(self)
[docs] def setQ(self, newValue: "SiconosVector") -> "void": r""" set value of generalized coordinates vector (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.SecondOrderDS_setQ(self, newValue)
[docs] def setQPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set value of generalized coordinates vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.SecondOrderDS_setQPtr(self, newPtr)
[docs] def q0(self) -> "SP::SiconosVector": r""" get initial state (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_q0(self)
[docs] def setQ0(self, newValue: "SiconosVector") -> "void": r""" set initial state (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.SecondOrderDS_setQ0(self, newValue)
[docs] def setQ0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial state (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.SecondOrderDS_setQ0Ptr(self, newPtr)
[docs] def velocity(self) -> "SP::SiconosVector": r""" get velocity vector (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_velocity(self)
[docs] def setVelocity(self, newValue: "SiconosVector") -> "void": r""" set velocity vector (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.SecondOrderDS_setVelocity(self, newValue)
[docs] def setVelocityPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set velocity vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.SecondOrderDS_setVelocityPtr(self, newPtr)
[docs] def velocity0(self) -> "SP::SiconosVector": r""" get initial velocity (pointer) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_velocity0(self)
[docs] def setVelocity0(self, newValue: "SiconosVector") -> "void": r""" set initial velocity (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.SecondOrderDS_setVelocity0(self, newValue)
[docs] def setVelocity0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial velocity (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.SecondOrderDS_setVelocity0Ptr(self, newPtr)
[docs] def acceleration(self) -> "SP::SiconosVector": r""" get acceleration (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_acceleration(self)
[docs] def forces(self) -> "SP::SiconosVector": r""" get :math:`F(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.SecondOrderDS_forces(self)
[docs] def jacobianqForces(self) -> "SP::SiconosMatrix": r""" :rtype: :py:class:`SiconosMatrix` :return: :math:`\nabla_qF(v,q,t,z)` (pointer link) """ return _sicpykernel.SecondOrderDS_jacobianqForces(self)
[docs] def jacobianvForces(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{\dot q}F(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.SecondOrderDS_jacobianvForces(self)
[docs] def qMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector q stored in memory. note: not const due to SchatzmanPaoliOSI::initializeWorkVectorsForDS :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.SecondOrderDS_qMemory(self)
[docs] def velocityMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector velocity stored in memory. note: not const due to SchatzmanPaoliOSI::initializeWorkVectorsForDS :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.SecondOrderDS_velocityMemory(self)
[docs] def forcesMemory(self) -> "SiconosMemory const &": r""" get forces in memory buff :rtype: :py:class:`SiconosMemory` :return: pointer on a SiconosMemory """ return _sicpykernel.SecondOrderDS_forcesMemory(self)
[docs] def initMemory(self, size: "unsigned int") -> "void": r""" initialize the SiconosMemory objects with a positive size. :type size: int :param size: the size of the SiconosMemory. must be >= 0 """ return _sicpykernel.SecondOrderDS_initMemory(self, size)
[docs] def computeMass(self, *args) -> "void": r""" *Overload 1:* default function to compute the mass | *Overload 2:* function to compute the mass :type position: :py:class:`SiconosVector` :param position: value used to evaluate the mass matrix """ return _sicpykernel.SecondOrderDS_computeMass(self, *args)
[docs] def setBoundaryConditions(self, newbd: "SP::BoundaryCondition") -> "void": r""" set Boundary Conditions :type newbd: :py:class:`BoundaryCondition` :param newbd: BoundaryConditions """ return _sicpykernel.SecondOrderDS_setBoundaryConditions(self, newbd)
[docs] def boundaryConditions(self) -> "SP::BoundaryCondition": r""" get Boundary Conditions :rtype: :py:class:`BoundaryCondition` :return: SP::BoundaryCondition pointer on a BoundaryConditions """ return _sicpykernel.SecondOrderDS_boundaryConditions(self)
[docs] def setReactionToBoundaryConditions(self, newrbd: "SP::SiconosVector") -> "void": r""" set Reaction to Boundary Conditions :type newrbd: :py:class:`SiconosVector` :param newrbd: BoundaryConditions pointer """ return _sicpykernel.SecondOrderDS_setReactionToBoundaryConditions(self, newrbd)
[docs] def reactionToBoundaryConditions(self) -> "SP::SiconosVector": r""" get Reaction to Boundary Conditions :rtype: :py:class:`SiconosVector` :return: pointer on a BoundaryConditions """ return _sicpykernel.SecondOrderDS_reactionToBoundaryConditions(self)
[docs] def init_inverse_mass(self) -> "void": r""" Allocate memory for the lu factorization of the mass of the system. Useful for some integrators with system inversion involving the mass """ return _sicpykernel.SecondOrderDS_init_inverse_mass(self)
[docs] def update_inverse_mass(self) -> "void": r""" Update the content of the lu factorization of the mass of the system, if required. """ return _sicpykernel.SecondOrderDS_update_inverse_mass(self)
[docs] def init_forces(self) -> "void": r""" Allocate memory for forces and its jacobian.""" return _sicpykernel.SecondOrderDS_init_forces(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_SecondOrderDS(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" Initialize all PluggedObject whether they are used or not.""" return _sicpykernel.SecondOrderDS__zeroPlugin(self)
# Register SecondOrderDS in _sicpykernel: _sicpykernel.SecondOrderDS_swigregister(SecondOrderDS)
[docs] class LagrangianDS(SecondOrderDS): r""" Lagrangian non linear dynamical systems - :math:`M(q,z) \dot v = F(v, q, t, z) + p` This class defines and computes a generic ndof-dimensional Lagrangian Non Linear Dynamical System of the form : .. math:: M(q,z) \dot v + F_{gyr}(v, q, z) + F_{int}(v , q , t, z) = F_{ext}(t, z) + p \\ \dot q = v where - :math:`q \in R^{ndof}` is the set of the generalized coordinates, - :math:`\dot q =v \in R^{ndof}` the velocity, i. e. the time derivative of the generalized coordinates (Lagrangian systems). - :math:`\ddot q =\\dot v \in R^{ndof}` the acceleration, i. e. the second time derivative of the generalized coordinates. - :math:`p \in R^{ndof}` the reaction forces due to the Non Smooth Interaction. - :math:`M(q) \in R^{ndof \times ndof}` is the inertia term (access : mass() method). - :math:`F_{gyr}(\dot q, q) \in R^{ndof}` is the non linear inertia term (access fGyr() method). - :math:`F_{int}(\dot q , q , t) \in R^{ndof}` are the internal forces (access fInt() method). - :math:`F_{ext}(t) \in R^{ndof}` are the external forces (access fExt() method). - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discrete state. The equation of motion is also shortly denoted as :math:`M(q,z) \dot v = F(v, q, t, z) + p` where :math:`F(v, q, t, z) \in R^{ndof}` collects the total forces acting on the system, that is :math:`F(v, q, t, z) = F_{ext}(t, z) - F_{gyr}(v, q, z) + F_{int}(v, q , t, z)` This vector is saved and may be accessed using forces() method. q[i] is the derivative number i of q. Thus: q[0]=:math:`q`, global coordinates, q[1]= :math:`\dot q` , velocity, q[2]= :math:`\ddot q`, acceleration. The following operators (and their jacobians) can be plugged, in the usual way (see User Guide, 'User-defined plugins') - :math:`M(q)` (computeMass()) - :math:`F_{gyr}(v, q, z)` (computeFGyr()) - :math:`F_{int}(v , q , t, z)` (computeFInt()) - :math:`F_{ext}(t, z)` (computeFExt()) If required (e.g. for Event-Driven like simulation), formulation as a first-order system is also available, and writes: - :math:`n= 2 ndof` - :math:`x = \left[\begin{array}{c}q \\ \dot q\end{array}\right]` - rhs given by: .. math:: \dot x = \left[\begin{array}{c} \dot q\\ \ddot q = M^{-1}(q)\left[F(v, q , t, z) + p \right]\\ \end{array}\right] ndverbatim - jacobian of the rhs, with respect to x .. math:: \nabla_{x}rhs(x,t) = \left[\begin{array}{cc} 0 & I \\ \nabla_{q}(M^{-1}(q)F(v, q , t, z)) & \nabla_{\dot q}(M^{-1}(q)F(v, q , t, z)) \\ \end{array}\right] with the input due to the non smooth law: .. math:: \left[\begin{array}{c} 0 \\ p \end{array}\right] In that case, use the following methods: - initRhs() to allocate/initialize memory for these new operators, - rhs() to get the rhs vector - computeRhs(), computeJacobianRhsx() ..., to update the content of rhs, its jacobians ... """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def _init(self, position: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void": r""" Common code for constructors should be replaced in C++11 by delegating constructors :type position: :py:class:`SiconosVector` :param position: vector of initial positions :type velocity: :py:class:`SiconosVector` :param velocity: vector of initial velocities """ return _sicpykernel.LagrangianDS__init(self, position, velocity) _q = property(_sicpykernel.LagrangianDS__q_get, _sicpykernel.LagrangianDS__q_set, doc=r""" state of the system. See details on top of page.""") _velocity0 = property(_sicpykernel.LagrangianDS__velocity0_get, _sicpykernel.LagrangianDS__velocity0_set, doc=r""" initial velocity of the system""") _qMemory = property(_sicpykernel.LagrangianDS__qMemory_get, doc=r""" memory of previous coordinates of the system""") _velocityMemory = property(_sicpykernel.LagrangianDS__velocityMemory_get, doc=r""" memory of previous velocities of the system""") _fInt = property(_sicpykernel.LagrangianDS__fInt_get, _sicpykernel.LagrangianDS__fInt_set, doc=r""" internal forces applied to the system""") _jacobianFIntq = property(_sicpykernel.LagrangianDS__jacobianFIntq_get, _sicpykernel.LagrangianDS__jacobianFIntq_set, doc=r""" jacobian_q FInt""") _jacobianFIntqDot = property(_sicpykernel.LagrangianDS__jacobianFIntqDot_get, _sicpykernel.LagrangianDS__jacobianFIntqDot_set, doc=r""" jacobian_{qDot} FInt""") _fExt = property(_sicpykernel.LagrangianDS__fExt_get, _sicpykernel.LagrangianDS__fExt_set, doc=r""" external forces applied to the system""") _hasConstantFExt = property(_sicpykernel.LagrangianDS__hasConstantFExt_get, _sicpykernel.LagrangianDS__hasConstantFExt_set, doc=r""" boolean if _fext is constant (set thanks to setFExtPtr for instance) false by default """) _fGyr = property(_sicpykernel.LagrangianDS__fGyr_get, _sicpykernel.LagrangianDS__fGyr_set, doc=r""" non-linear inertia term of the system""") _jacobianFGyrq = property(_sicpykernel.LagrangianDS__jacobianFGyrq_get, _sicpykernel.LagrangianDS__jacobianFGyrq_set, doc=r""" jacobian_q FGyrq""") _jacobianFGyrqDot = property(_sicpykernel.LagrangianDS__jacobianFGyrqDot_get, _sicpykernel.LagrangianDS__jacobianFGyrqDot_set, doc=r""" jacobian_{qDot} FGyrq""") _forces = property(_sicpykernel.LagrangianDS__forces_get, _sicpykernel.LagrangianDS__forces_set, doc=r""" forces(q[0],q[1],t)= fExt - fInt -FGyr""") _jacobianqForces = property(_sicpykernel.LagrangianDS__jacobianqForces_get, _sicpykernel.LagrangianDS__jacobianqForces_set, doc=r""" jacobian_q forces""") _jacobianqDotForces = property(_sicpykernel.LagrangianDS__jacobianqDotForces_get, _sicpykernel.LagrangianDS__jacobianqDotForces_set, doc=r""" jacobian_{qDot} forces""") _forcesMemory = property(_sicpykernel.LagrangianDS__forcesMemory_get, doc=r""" memory of previous forces of the system""") _rhsMatrices = property(_sicpykernel.LagrangianDS__rhsMatrices_get, _sicpykernel.LagrangianDS__rhsMatrices_set, doc=r""" A container of matrices to save matrices that are involed in first order from of LagrangianDS system values (jacobianXBloc10, jacobianXBloc11, zeroMatrix, idMatrix) No get-set functions at the time. Only used as a protected member. """) _pluginMass = property(_sicpykernel.LagrangianDS__pluginMass_get, _sicpykernel.LagrangianDS__pluginMass_set, doc=r""" LagrangianDS plug-in to compute mass(q,t) - id = "mass" :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param mass: : pointer to the first element of mass :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginFInt = property(_sicpykernel.LagrangianDS__pluginFInt_get, _sicpykernel.LagrangianDS__pluginFInt_set, doc=r""" LagrangianDS plug-in to compute internal forces :math:`F_{int}(t,q,\dot q)` - id = "fInt" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param fInt: : pointer to the first element of fInt :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginFExt = property(_sicpykernel.LagrangianDS__pluginFExt_get, _sicpykernel.LagrangianDS__pluginFExt_set, doc=r""" LagrangianDS plug-in to compute external forces :math:`F_{Ext}(t)` , id = "fExt" :param time: : current time :param sizeOfq: : size of vector q :param fExt: : pointer to the first element of fExt :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginFGyr = property(_sicpykernel.LagrangianDS__pluginFGyr_get, _sicpykernel.LagrangianDS__pluginFGyr_set, doc=r""" LagrangianDS plug-in to compute :math:`FGyr(\dot q, q)` , id = "FGyr" :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param FGyr: : pointer to the first element of FGyr :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJacqFInt = property(_sicpykernel.LagrangianDS__pluginJacqFInt_get, _sicpykernel.LagrangianDS__pluginJacqFInt_set, doc=r""" LagrangianDS plug-in to compute :math:`\nabla_qF_{Int}(\dot q, q, t)` , id = "jacobianFIntq" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJacqDotFInt = property(_sicpykernel.LagrangianDS__pluginJacqDotFInt_get, _sicpykernel.LagrangianDS__pluginJacqDotFInt_set, doc=r""" LagrangianDS plug-in to compute :math:`\nabla_{\dot q}F_{Int}(\dot q, q, t)` , id = "jacobianFIntqDot" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJacqFGyr = property(_sicpykernel.LagrangianDS__pluginJacqFGyr_get, _sicpykernel.LagrangianDS__pluginJacqFGyr_set, doc=r""" LagrangianDS plug-in to compute :math:`\nabla_qFGyr(\dot q, q)` , id = "jacobianFGyrq" :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJacqDotFGyr = property(_sicpykernel.LagrangianDS__pluginJacqDotFGyr_get, _sicpykernel.LagrangianDS__pluginJacqDotFGyr_set, doc=r""" LagrangianDS plug-in to compute :math:`\nabla_{\dot q}FGyr(\dot q, q)` , id = "jacobianFGyrqDot" :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param velocity: : pointer to the first element of velocity :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) def _zeroPlugin(self) -> "void": r""" build all _plugin... PluggedObject""" return _sicpykernel.LagrangianDS__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor from initial state only, :math:`dv = p` :type position: :py:class:`SiconosVector` :param position: SiconosVector : initial coordinates of this DynamicalSystem :type velocity: :py:class:`SiconosVector` :param velocity: SiconosVector : initial velocity of this DynamicalSystem | *Overload 3:* constructor from initial state and mass, :math:`Mdv = p` :type position: :py:class:`SiconosVector` :param position: SiconosVector : initial coordinates of this DynamicalSystem :type velocity: :py:class:`SiconosVector` :param velocity: SiconosVector : initial velocity of this DynamicalSystem :type mass: :py:class:`SiconosMatrix` :param mass: SiconosMatrix : mass matrix | *Overload 4:* constructor from initial state and mass (plugin) :math:`Mdv = p` :type position: :py:class:`SiconosVector` :param position: SiconosVector : initial coordinates of this DynamicalSystem :type velocity: :py:class:`SiconosVector` :param velocity: SiconosVector : initial velocity of this DynamicalSystem :type plugin: string :param plugin: std::string: plugin path to compute mass matrix """ if self.__class__ == LagrangianDS: _self = None else: _self = self _sicpykernel.LagrangianDS_swiginit(self, _sicpykernel.new_LagrangianDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianDS
[docs] def resetToInitialState(self) -> "void": r""" reset the state to the initial state""" return _sicpykernel.LagrangianDS_resetToInitialState(self)
[docs] def initRhs(self, time: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type time: float :param time: of initialization """ return _sicpykernel.LagrangianDS_initRhs(self, time)
[docs] def initializeNonSmoothInput(self, level: "unsigned int") -> "void": r""" set nonsmooth input to zero :type level: int :param level: input-level to be initialized. """ return _sicpykernel.LagrangianDS_initializeNonSmoothInput(self, level)
[docs] def computeRhs(self, time: "double") -> "void": r""" update right-hand side for the current state :type time: float :param time: of interest """ return _sicpykernel.LagrangianDS_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" update :math:`\nabla_x rhs` for the current state :type time: float :param time: of interest """ return _sicpykernel.LagrangianDS_computeJacobianRhsx(self, time)
[docs] def resetAllNonSmoothParts(self) -> "void": r""" reset non-smooth part of the rhs (i.e. p), for all 'levels'""" return _sicpykernel.LagrangianDS_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" set nonsmooth part of the rhs (i.e. p) to zero for a given level :type level: int :param level: """ return _sicpykernel.LagrangianDS_resetNonSmoothPart(self, level)
[docs] def setRhs(self, newValue: "SiconosVector") -> "void": r""" set the value of the right-hand side, :math:`\dot x` :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.LagrangianDS_setRhs(self, newValue)
[docs] def setRhsPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set right-hand side, :math:`\dot x` (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: SP::SiconosVector """ return _sicpykernel.LagrangianDS_setRhsPtr(self, newPtr)
[docs] def computeForces(self, time: "double", q: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void": r""" Compute :math:`F(v,q,t,z)` :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: SP::SiconosVector: pointers on q :type velocity: :py:class:`SiconosVector` :param velocity: SP::SiconosVector: pointers on velocity """ return _sicpykernel.LagrangianDS_computeForces(self, time, q, velocity)
[docs] def computeJacobianqForces(self, time: "double") -> "void": r""" Compute :math:`\nabla_qF(v,q,t,z)` for current :math:`q,v` Default function to compute forces :type time: float :param time: the current time """ return _sicpykernel.LagrangianDS_computeJacobianqForces(self, time)
[docs] def computeJacobianqDotForces(self, time: "double") -> "void": r""" Compute :math:`\nabla_{\dot q}F(v,q,t,z)` for current :math:`q,v` :type time: float :param time: the current time """ return _sicpykernel.LagrangianDS_computeJacobianqDotForces(self, time)
[docs] def computeJacobianvForces(self, time: "double") -> "void": r""" Compute :math:`\nabla_{\dot q}F(v,q,t,z)` for current :math:`q,v` :type time: float :param time: the current time """ return _sicpykernel.LagrangianDS_computeJacobianvForces(self, time)
[docs] def q(self) -> "SP::SiconosVector": r""" generalized coordinates of the system (vector of size dimension()) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianDS_q(self)
[docs] def setQ(self, newValue: "SiconosVector") -> "void": r""" set value of generalized coordinates vector (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.LagrangianDS_setQ(self, newValue)
[docs] def setQPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set value of generalized coordinates vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.LagrangianDS_setQPtr(self, newPtr)
[docs] def setQ0(self, newValue: "SiconosVector") -> "void": r""" set initial state (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.LagrangianDS_setQ0(self, newValue)
[docs] def setQ0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial state (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.LagrangianDS_setQ0Ptr(self, newPtr)
[docs] def velocity(self) -> "SP::SiconosVector": r""" get velocity vector (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianDS_velocity(self)
[docs] def setVelocity(self, newValue: "SiconosVector") -> "void": r""" set velocity vector (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.LagrangianDS_setVelocity(self, newValue)
[docs] def setVelocityPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set velocity vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.LagrangianDS_setVelocityPtr(self, newPtr)
[docs] def velocity0(self) -> "SP::SiconosVector": r""" get initial velocity (pointer) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianDS_velocity0(self)
[docs] def setVelocity0(self, newValue: "SiconosVector") -> "void": r""" set initial velocity (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.LagrangianDS_setVelocity0(self, newValue)
[docs] def setVelocity0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial velocity (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.LagrangianDS_setVelocity0Ptr(self, newPtr)
[docs] def acceleration(self) -> "SP::SiconosVector": r""" get acceleration (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianDS_acceleration(self)
[docs] def fInt(self) -> "SP::SiconosVector": r""" get $F_{int}$ (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.LagrangianDS_fInt(self)
[docs] def setFIntPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set $F_{int}$ (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to plugged vector """ return _sicpykernel.LagrangianDS_setFIntPtr(self, newPtr)
[docs] def fExt(self) -> "SP::SiconosVector": r""" get :math:`F_{ext}` , (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.LagrangianDS_fExt(self)
[docs] def setFExtPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set :math:`F_{ext}` , (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to a Simple vector """ return _sicpykernel.LagrangianDS_setFExtPtr(self, newPtr)
[docs] def fGyr(self) -> "SP::SiconosVector": r""" get :math:`F_{gyr}` , (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.LagrangianDS_fGyr(self)
[docs] def setFGyrPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set :math:`F_{gyr}` , (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to plugged vector """ return _sicpykernel.LagrangianDS_setFGyrPtr(self, newPtr)
[docs] def jacobianFIntq(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_qF_{int}` , (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianFIntq(self)
[docs] def jacobianFIntqDot(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{\dot q}F_{int}` , (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianFIntqDot(self)
def allocateMass(self) -> "void": return _sicpykernel.LagrangianDS_allocateMass(self) def allocateJacobianFIntq(self) -> "void": return _sicpykernel.LagrangianDS_allocateJacobianFIntq(self) def allocateJacobianFIntqDot(self) -> "void": return _sicpykernel.LagrangianDS_allocateJacobianFIntqDot(self) def allocateFInt(self) -> "void": return _sicpykernel.LagrangianDS_allocateFInt(self) def allocateFExt(self) -> "void": return _sicpykernel.LagrangianDS_allocateFExt(self)
[docs] def setJacobianFIntqPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set :math:`\nabla_{q}F_{int}` , (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: a pointer to a SiconosMatrix """ return _sicpykernel.LagrangianDS_setJacobianFIntqPtr(self, newPtr)
[docs] def setJacobianFIntqDotPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set :math:`\nabla_{\dot q}F_{int}` , (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: a pointer to a SiconosMatrix """ return _sicpykernel.LagrangianDS_setJacobianFIntqDotPtr(self, newPtr)
[docs] def jacobianFGyrq(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{q}F_{gyr}` , (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianFGyrq(self)
[docs] def jacobianFGyrqDot(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{\dot q}F_{gyr}` , (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianFGyrqDot(self)
[docs] def setJacobianFGyrqPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" get :math:`\nabla_{q}F_{gyr}` , (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: a SP SiconosMatrix """ return _sicpykernel.LagrangianDS_setJacobianFGyrqPtr(self, newPtr)
[docs] def setJacobianFGyrqDotPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" get :math:`\nabla_{\dot q}F_{gyr}` , (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: a SP SiconosMatrix """ return _sicpykernel.LagrangianDS_setJacobianFGyrqDotPtr(self, newPtr)
[docs] def forces(self) -> "SP::SiconosVector": r""" get :math:`F(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianDS_forces(self)
[docs] def jacobianqForces(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_qF(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianqForces(self)
[docs] def jacobianvForces(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{\dot q}F(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianDS_jacobianvForces(self)
[docs] def qMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector q stored in memory. note: not const due to SchatzmanPaoliOSI::initializeWorkVectorsForDS :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.LagrangianDS_qMemory(self)
[docs] def velocityMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector velocity stored in memory. note: not const due to SchatzmanPaoliOSI::initializeWorkVectorsForDS :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.LagrangianDS_velocityMemory(self)
[docs] def pMemory(self, level: "unsigned int") -> "SiconosMemory const &": r""" get all the values of the state vector p stored in memory :type level: int :param level: :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.LagrangianDS_pMemory(self, level)
[docs] def forcesMemory(self) -> "SiconosMemory const &": r""" get forces in memory buff :rtype: :py:class:`SiconosMemory` :return: pointer on a SiconosMemory """ return _sicpykernel.LagrangianDS_forcesMemory(self)
[docs] def initMemory(self, size: "unsigned int") -> "void": r""" initialize the SiconosMemory objects with a positive size. :type size: int :param size: the size of the SiconosMemory. must be >= 0 """ return _sicpykernel.LagrangianDS_initMemory(self, size)
[docs] def swapInMemory(self) -> "void": r""" push the current values of x, q and r in the stored previous values xMemory, qMemory, rMemory, TODO: Modify the function swapIn Memory with the new Object Memory """ return _sicpykernel.LagrangianDS_swapInMemory(self)
[docs] def setComputeMassFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the mass :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute Mass :type fct: FPtr7 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeMassFunction(self, *args)
[docs] def setComputeFIntFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute FInt :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute fInt :type fct: FPtr6 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeFIntFunction(self, *args)
[docs] def setComputeFExtFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute Fext :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute fExt :type fct: VectorFunctionOfTime :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeFExtFunction(self, *args)
[docs] def setComputeFGyrFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the inertia :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute FGyr :type fct: FPtr5 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeFGyrFunction(self, *args)
[docs] def setComputeJacobianFIntqFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian w.r.t q of the internal forces :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following q of the FInt :type fct: FPtr6 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeJacobianFIntqFunction(self, *args)
[docs] def setComputeJacobianFIntqDotFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian of the internal forces w.r.t. q :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following qDot of the FInt :type fct: FPtr6 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeJacobianFIntqDotFunction(self, *args)
[docs] def setComputeJacobianFGyrqFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian w.r.t q of the the external forces :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute the jacobian following q of FGyr :type fct: FPtr5 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeJacobianFGyrqFunction(self, *args)
[docs] def setComputeJacobianFGyrqDotFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian w.r.t qDot of the the external strength :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute the jacobian following qDot of FGyr :type fct: FPtr5 :param fct: a pointer on the plugin function """ return _sicpykernel.LagrangianDS_setComputeJacobianFGyrqDotFunction(self, *args)
[docs] def computeMass(self, *args) -> "void": r""" *Overload 1:* default function to compute the mass | *Overload 2:* function to compute the mass :type position: :py:class:`SiconosVector` :param position: value used to evaluate the mass matrix """ return _sicpykernel.LagrangianDS_computeMass(self, *args)
[docs] def computeFInt(self, *args) -> "void": r""" *Overload 1:* default function to compute the internal strengths :type time: float :param time: the current time | *Overload 2:* function to compute the internal strengths with some specific values for position and velocity (ie not those of the current state). :type time: float :param time: the current time, :type position: :py:class:`SiconosVector` :param position: value used to evaluate the internal forces :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the internal forces """ return _sicpykernel.LagrangianDS_computeFInt(self, *args)
[docs] def computeFExt(self, time: "double") -> "void": r""" default function to compute the external strengths :type time: float :param time: the current time """ return _sicpykernel.LagrangianDS_computeFExt(self, time)
[docs] def computeFGyr(self, *args) -> "void": r""" *Overload 1:* default function to compute the inertia | *Overload 2:* function to compute the inertia with some specific values for q and velocity (ie not those of the current state). :type position: :py:class:`SiconosVector` :param position: value used to evaluate the inertia forces :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the inertia forces """ return _sicpykernel.LagrangianDS_computeFGyr(self, *args)
[docs] def computeJacobianFIntq(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: the current time | *Overload 2:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: the current time :type position: :py:class:`SiconosVector` :param position: value used to evaluate the jacobian :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the jacobian """ return _sicpykernel.LagrangianDS_computeJacobianFIntq(self, *args)
[docs] def computeJacobianFIntqDot(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t qDot of the internal forces :type time: float :param time: the current time | *Overload 2:* To compute the jacobian w.r.t. qDot of the internal forces :type time: float :param time: the current time :type position: :py:class:`SiconosVector` :param position: value used to evaluate the jacobian :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the jacobian """ return _sicpykernel.LagrangianDS_computeJacobianFIntqDot(self, *args)
[docs] def computeJacobianFGyrq(self, *args) -> "void": r""" *Overload 1:* function to compute the jacobian w.r.t. q of the inertia forces | *Overload 2:* function to compute the jacobian w.r.t. q of the inertia forces :type position: :py:class:`SiconosVector` :param position: value used to evaluate the jacobian :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the jacobian """ return _sicpykernel.LagrangianDS_computeJacobianFGyrq(self, *args)
[docs] def computeJacobianFGyrqDot(self, *args) -> "void": r""" *Overload 1:* function to compute the jacobian w.r.t. qDot of the inertia forces | *Overload 2:* function to compute the jacobian w.r.t. qDot of the inertia forces :type position: :py:class:`SiconosVector` :param position: value used to evaluate the jacobian :type velocity: :py:class:`SiconosVector` :param velocity: value used to evaluate the jacobian """ return _sicpykernel.LagrangianDS_computeJacobianFGyrqDot(self, *args)
[docs] def updatePlugins(self, time: "double") -> "void": r""" default function to update the plugins functions using a new time: :type time: float :param time: the current time """ return _sicpykernel.LagrangianDS_updatePlugins(self, time)
[docs] def computeKineticEnergy(self) -> "double": r""" To compute the kinetic energy""" return _sicpykernel.LagrangianDS_computeKineticEnergy(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data of the dynamical system on the standard output""" return _sicpykernel.LagrangianDS_display(self, brief)
[docs] def computePostImpactVelocity(self) -> "void": r""" Computes post-impact velocity, using pre-impact velocity and impulse (p) value. Used in EventDriven (LsodarOSI->updateState) """ return _sicpykernel.LagrangianDS_computePostImpactVelocity(self)
[docs] def init_generalized_coordinates(self, level: "unsigned int") -> "void": r""" Allocate memory for q[level], level > 1 Useful for some integrators that need q[2] or other coordinates vectors. :type level: int :param level: the required level """ return _sicpykernel.LagrangianDS_init_generalized_coordinates(self, level)
[docs] def init_inverse_mass(self) -> "void": r""" Allocate memory for the lu factorization of the mass of the system. Useful for some integrators with system inversion involving the mass """ return _sicpykernel.LagrangianDS_init_inverse_mass(self)
[docs] def update_inverse_mass(self) -> "void": r""" Update the content of the lu factorization of the mass of the system, if required. """ return _sicpykernel.LagrangianDS_update_inverse_mass(self)
[docs] def init_forces(self) -> "void": r""" Allocate memory for forces and its jacobian.""" return _sicpykernel.LagrangianDS_init_forces(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianDS(self) return weakref.proxy(self)
# Register LagrangianDS in _sicpykernel: _sicpykernel.LagrangianDS_swigregister(LagrangianDS)
[docs] class LagrangianLinearTIDS(LagrangianDS): r""" Lagrangian Linear Systems with time invariant coefficients - :math:`M\dot v + Cv + Kq = F_{ext}(t,z) + p` The class LagrangianLinearTIDS allows to define and compute a generic ndof-dimensional Lagrangian Linear Time Invariant Dynamical System of the form: .. math:: M \ddot q + C \dot q + K q = F_{ext}(t,z) + p, where - :math:`q \in R^{ndof}` is the set of the generalized coordinates, - :math:`\dot q \in R^{ndof}` the velocity, i. e. the time derivative of the generalized coordinates. - :math:`\ddot q \in R^{ndof}` the acceleration, i. e. the second time derivative of the generalized coordinates. - :math:`p \in R^{ndof}` the forces due to the Non Smooth Interaction. In particular case of Non Smooth evolution, the variable p contains the impulse and not the force. - :math:`M \in R^{ndof \times ndof}` is the Mass matrix (access : mass() method). - :math:`K \in R^{ndof \times ndof}` is the stiffness matrix (access : K() method). - :math:`C \in R^{ndof \times ndof}` is the viscosity matrix (access : C() method). - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discret state. The equation of motion is also shortly denoted as: .. math:: M(q,z) \dot v = F(v, q, t, z) + p where - :math:`F(v, q, t, z) \in R^{ndof}` collects the total forces acting on the system, that is :math:`F(v, q, t, z) = F_{ext}(t, z) - Cv - Kq`. This vector is saved and may be accessed using forces() method. If required (e.g. for Event-Driven like simulation), reformulation as a first-order system is also available, and writes: - :math:`n= 2 ndof` - :math:`x = \left[\begin{array}{c}q \\ \dot q\end{array}\right]` - rhs given by: .. math:: rhs(x,t,z) = \left[\begin{array}{c} \dot q \\ \ddot q = M^{-1}\left[F_{ext}(t, z) - C \dot q - K q + p \right] \\ \end{array}\right] Its jacobian is: .. math:: \nabla_{x}rhs(x,t) = \left[\begin{array}{cc} 0 & I \\ -M^{-1}K & -M^{-1}C \\ \end{array}\right] with the input due to the non smooth law: .. math:: r = \left[\begin{array}{c}0 \\ p \end{array}\right] """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _K = property(_sicpykernel.LagrangianLinearTIDS__K_get, _sicpykernel.LagrangianLinearTIDS__K_set, doc=r""" stiffness matrix""") _C = property(_sicpykernel.LagrangianLinearTIDS__C_get, _sicpykernel.LagrangianLinearTIDS__C_set, doc=r""" damping matrix""") def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from initial state and all matrix operators. :type q0: :py:class:`SiconosVector` :param q0: initial coordinates :type v0: :py:class:`SiconosVector` :param v0: initial velocity :type M: :py:class:`SiconosMatrix` :param M: mass matrix :type K: :py:class:`SiconosMatrix` :param K: stiffness matrix :type C: :py:class:`SiconosMatrix` :param C: damping matrix | *Overload 3:* constructor from initial state and mass matrix only. Leads to :math:`M\dot v = F_{ext}(t,z) + p` . :type q0: :py:class:`SiconosVector` :param q0: initial coordinates :type v0: :py:class:`SiconosVector` :param v0: initial velocity :type M: :py:class:`SiconosMatrix` :param M: mass matrix """ if self.__class__ == LagrangianLinearTIDS: _self = None else: _self = self _sicpykernel.LagrangianLinearTIDS_swiginit(self, _sicpykernel.new_LagrangianLinearTIDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianLinearTIDS
[docs] def initRhs(self, t: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type t: float :param t: time of initialization """ return _sicpykernel.LagrangianLinearTIDS_initRhs(self, t)
[docs] def computeForces(self, time: "double", q: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void": r""" Compute :math:`F(v,q,t,z)` :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: SP::SiconosVector: pointers on q :type velocity: :py:class:`SiconosVector` :param velocity: SP::SiconosVector: pointers on velocity """ return _sicpykernel.LagrangianLinearTIDS_computeForces(self, time, q, velocity)
[docs] def getK(self) -> "SimpleMatrix const": r""" get a copy of the stiffness matrix :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.LagrangianLinearTIDS_getK(self)
[docs] def K(self) -> "SP::SiconosMatrix": r""" get stiffness matrix (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianLinearTIDS_K(self)
[docs] def setK(self, K: "SiconosMatrix") -> "void": r""" set (copy) the value of the stiffness matrix :type K: :py:class:`SiconosMatrix` :param K: new stiffness matrix """ return _sicpykernel.LagrangianLinearTIDS_setK(self, K)
[docs] def setKPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set stiffness matrix (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: pointer to the new Stiffness matrix """ return _sicpykernel.LagrangianLinearTIDS_setKPtr(self, newPtr)
[docs] def getC(self) -> "SimpleMatrix const": r""" get a copy of the damping matrix :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.LagrangianLinearTIDS_getC(self)
[docs] def C(self) -> "SP::SiconosMatrix": r""" get damping matrix (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianLinearTIDS_C(self)
[docs] def setC(self, C: "SiconosMatrix") -> "void": r""" set (copy) the value of the damping matrix :type C: :py:class:`SiconosMatrix` :param C: new damping matrix """ return _sicpykernel.LagrangianLinearTIDS_setC(self, C)
[docs] def setCPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set damping matrix (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: pointer to the new damping matrix """ return _sicpykernel.LagrangianLinearTIDS_setCPtr(self, newPtr)
[docs] def jacobianqForces(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_qF(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianLinearTIDS_jacobianqForces(self)
[docs] def jacobianvForces(self) -> "SP::SiconosMatrix": r""" get :math:`\nabla_{\dot q}F(v,q,t,z)` (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.LagrangianLinearTIDS_jacobianvForces(self)
[docs] def isLinear(self) -> "bool": r""" :rtype: boolean :return: true if the Dynamical system is linear. """ return _sicpykernel.LagrangianLinearTIDS_isLinear(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data onto the screen""" return _sicpykernel.LagrangianLinearTIDS_display(self, brief)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianLinearTIDS(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" build all _plugin... PluggedObject""" return _sicpykernel.LagrangianLinearTIDS__zeroPlugin(self)
# Register LagrangianLinearTIDS in _sicpykernel: _sicpykernel.LagrangianLinearTIDS_swigregister(LagrangianLinearTIDS)
[docs] class LagrangianLinearDiagonalDS(LagrangianDS): r""" Lagrangian Linear Systems with time invariant and diagonal coefficients - :math:`M\dot v + Cv + Kq = F_{ext}(t,z) + p` where - :math:`q \in R^{ndof}` is the set of the generalized coordinates, - :math:`\dot q = v \in R^{ndof}` the velocity, i. e. the time derivative of the generalized coordinates. - :math:`\ddot q \in R^{ndof}` the acceleration, i. e. the second time derivative of the generalized coordinates. - :math:`p \in R^{ndof}` the forces due to the nonsmooth interaction. In the particular case of a nonsmooth evolution, the variable p contains the impulse and not the force. - :math:`M \in R^{ndof \times ndof}` is the mass matrix (access : mass() method). - :math:`K \in R^{ndof \times ndof}` is the stiffness matrix (access : stiffness() method). - :math:`C \in R^{ndof \times ndof}` is the viscosity matrix (access : damping() method). - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discret state. Remind that the specificity of this class is that all matrices are diagonal (and hence only diagonal coefficients are saved in memory). For details about dynamical systems in Siconos, please read user's guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _stiffness = property(_sicpykernel.LagrangianLinearDiagonalDS__stiffness_get, _sicpykernel.LagrangianLinearDiagonalDS__stiffness_set, doc=r""" stiffness matrix""") _damping = property(_sicpykernel.LagrangianLinearDiagonalDS__damping_get, _sicpykernel.LagrangianLinearDiagonalDS__damping_set, doc=r""" damping matrix""") _mu = property(_sicpykernel.LagrangianLinearDiagonalDS__mu_get, _sicpykernel.LagrangianLinearDiagonalDS__mu_set, doc=r""" mass density""") def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from initial state and all operators. :type q0: :py:class:`SiconosVector` :param q0: initial coordinates :type v0: :py:class:`SiconosVector` :param v0: initial velocity :type stiffness: :py:class:`SiconosVector` :param stiffness: diagonal of the stiffness matrix :type damping: :py:class:`SiconosVector` :param damping: diagonal of the damping matrix :type mass: :py:class:`SiconosVector` :param mass: diagonal of the mass matrix | *Overload 3:* constructor for complete system with identity mass matrix :type q0: :py:class:`SiconosVector` :param q0: initial coordinates :type v0: :py:class:`SiconosVector` :param v0: initial velocity :type stiffness: :py:class:`SiconosVector` :param stiffness: diagonal of the stiffness matrix :type damping: :py:class:`SiconosVector` :param damping: diagonal of the damping matrix | *Overload 4:* constructor for undamped system and identity mass matrix :type q0: :py:class:`SiconosVector` :param q0: initial coordinates :type v0: :py:class:`SiconosVector` :param v0: initial velocity :type stiffness: :py:class:`SiconosVector` :param stiffness: diagonal of the stiffness matrix """ if self.__class__ == LagrangianLinearDiagonalDS: _self = None else: _self = self _sicpykernel.LagrangianLinearDiagonalDS_swiginit(self, _sicpykernel.new_LagrangianLinearDiagonalDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianLinearDiagonalDS
[docs] def get_stiffness(self) -> "SiconosVector const": r""" get a copy of the stiffness matrix (diagonal only) :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.LagrangianLinearDiagonalDS_get_stiffness(self)
[docs] def stiffness(self) -> "SP::SiconosVector": r""" get stiffness matrix (diagonal only, pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianLinearDiagonalDS_stiffness(self)
[docs] def get_damping(self) -> "SiconosVector const": r""" get a copy of the damping matrix (diagonal only) :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.LagrangianLinearDiagonalDS_get_damping(self)
[docs] def damping(self) -> "SP::SiconosVector": r""" get damping matrix (diagonal only, pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LagrangianLinearDiagonalDS_damping(self)
[docs] def initRhs(self, t: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type t: float :param t: time of initialization """ return _sicpykernel.LagrangianLinearDiagonalDS_initRhs(self, t)
[docs] def computeForces(self, time: "double", q: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void": r""" Compute :math:`F(v,q,t,z)` :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: generalized coordinates :type velocity: :py:class:`SiconosVector` :param velocity: time derivative of the generalized coordinates """ return _sicpykernel.LagrangianLinearDiagonalDS_computeForces(self, time, q, velocity)
[docs] def isLinear(self) -> "bool": r""" :rtype: boolean :return: true if the Dynamical system is linear. """ return _sicpykernel.LagrangianLinearDiagonalDS_isLinear(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data of the dynamical system on the standard output""" return _sicpykernel.LagrangianLinearDiagonalDS_display(self, brief)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianLinearDiagonalDS(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" build all _plugin... PluggedObject""" return _sicpykernel.LagrangianLinearDiagonalDS__zeroPlugin(self)
# Register LagrangianLinearDiagonalDS in _sicpykernel: _sicpykernel.LagrangianLinearDiagonalDS_swigregister(LagrangianLinearDiagonalDS) def computeT(q: "SP::SiconosVector", T: "SP::SimpleMatrix") -> "void": return _sicpykernel.computeT(q, T)
[docs] def computeExtForceAtPos(q: "SP::SiconosVector", isMextExpressedInInertialFrame: "bool", force: "SP::SiconosVector", forceAbsRef: "bool", pos: "SP::SiconosVector", posAbsRef: "bool", fExt: "SP::SiconosVector", mExt: "SP::SiconosVector", accumulate: "bool") -> "void": r""" Compute the force and moment vectors applied to a body with state q from a force vector at a given position. """ return _sicpykernel.computeExtForceAtPos(q, isMextExpressedInInertialFrame, force, forceAbsRef, pos, posAbsRef, fExt, mExt, accumulate)
[docs] class NewtonEulerDS(SecondOrderDS): r""" NewtonEuler non linear dynamical systems The equations of motion in the Newton-Euler formalism can be stated as .. math:: \left\{\begin{array}{rcl} M \dot v + F_{int}(q,v, \Omega, t)&=& F_{ext}(t), \\ I \dot \Omega + \Omega \wedge I\Omega + M_{int}(q,v, \Omega, t) &=& M_{ext}(t), \\ \dot q &=& T(q) [ v, \Omega] \\ \dot R &=& R \tilde \Omega,\quad R^{-1}=R^T,\quad \det(R)=1 . \end{array}\right. with - :math:`x_G,v_G` position and velocity of the center of mass expressed in a inertial frame of reference (world frame) - :math:`\Omega` angular velocity vector expressed in the body-fixed frame (frame attached to the object) - :math:`R` rotation matrix form the inertial frame to the body-fixed frame :math:`R^{-1}=R^T, \det(R)=1`, i.e :math:`R\in SO^+(3)` - :math:`M=m\,I_{3\times 3}` diagonal mass matrix with :math:`m \in \mathbb{R}` the scalar mass - :math:`I` constant inertia matrix - :math:`F_{ext}` and :math:`M_{ext}` are the external applied forces and moment In the current implementation, :math:`R` is parametrized by a unit quaternion. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def _init(self) -> "void": r""" Common code for constructors should be replaced in C++11 by delegating constructors """ return _sicpykernel.NewtonEulerDS__init(self) _twist = property(_sicpykernel.NewtonEulerDS__twist_get, _sicpykernel.NewtonEulerDS__twist_set, doc=r""" _twist contains the twist of the Newton Euler dynamical system. _twist[0:2] : :math:`v_G \in \RR^3` velocity of the center of mass in the inertial frame of reference (world frame). _twist[3:5] : :math:`\Omega\in\RR^3` angular velocity expressed in the body-fixed frame """) _twist0 = property(_sicpykernel.NewtonEulerDS__twist0_get, _sicpykernel.NewtonEulerDS__twist0_set, doc=r""" Initial twist""") _q = property(_sicpykernel.NewtonEulerDS__q_get, _sicpykernel.NewtonEulerDS__q_set, doc=r""" _q contains the representation of the system In the current implementation, we have _q[0:2] : the coordinates of the center of mass expressed in the inertial frame of reference (world frame) _q[3:6] : an unit quaternion representing the orientation of the solid. This unit quaternion encodes the rotation mapping from the inertial frame of reference to the body-fixed frame """) _qDim = property(_sicpykernel.NewtonEulerDS__qDim_get, _sicpykernel.NewtonEulerDS__qDim_set, doc=r""" Dimension of _q, is not necessary equal to _ndof. In our case, _qDim = 7 and _ndof =6 """) _dotq = property(_sicpykernel.NewtonEulerDS__dotq_get, _sicpykernel.NewtonEulerDS__dotq_set, doc=r""" The time derivative of :math:`q` , :math:`\dot q`""") _acceleration = property(_sicpykernel.NewtonEulerDS__acceleration_get, _sicpykernel.NewtonEulerDS__acceleration_set, doc=r""" _acceleration contains the time derivative of the twist""") _twistMemory = property(_sicpykernel.NewtonEulerDS__twistMemory_get, doc=r""" Memory vectors that stores the values within the time--step""") _qMemory = property(_sicpykernel.NewtonEulerDS__qMemory_get) _forcesMemory = property(_sicpykernel.NewtonEulerDS__forcesMemory_get) _dotqMemory = property(_sicpykernel.NewtonEulerDS__dotqMemory_get) _I = property(_sicpykernel.NewtonEulerDS__I_get, _sicpykernel.NewtonEulerDS__I_set, doc=r""" Inertial matrix""") _scalarMass = property(_sicpykernel.NewtonEulerDS__scalarMass_get, _sicpykernel.NewtonEulerDS__scalarMass_set, doc=r""" Scalar mass of the system""") _T = property(_sicpykernel.NewtonEulerDS__T_get, _sicpykernel.NewtonEulerDS__T_set, doc=r""" Matrix depending on the parametrization of the orientation :math:`v = T(q) \dot q` """) _Tdot = property(_sicpykernel.NewtonEulerDS__Tdot_get, _sicpykernel.NewtonEulerDS__Tdot_set, doc=r""" Time derivative of T. :math:`\dot v = \dot T(q) \dot q + T(q) \ddot q` """) _fExt = property(_sicpykernel.NewtonEulerDS__fExt_get, _sicpykernel.NewtonEulerDS__fExt_set, doc=r""" external forces of the system""") _hasConstantFExt = property(_sicpykernel.NewtonEulerDS__hasConstantFExt_get, _sicpykernel.NewtonEulerDS__hasConstantFExt_set, doc=r""" boolean if _fext is constant (set thanks to setFExtPtr for instance) false by default """) _fInt = property(_sicpykernel.NewtonEulerDS__fInt_get, _sicpykernel.NewtonEulerDS__fInt_set, doc=r""" internal forces of the system""") _mExt = property(_sicpykernel.NewtonEulerDS__mExt_get, _sicpykernel.NewtonEulerDS__mExt_set, doc=r""" external moment expressed in the inertial frame""") _hasConstantMExt = property(_sicpykernel.NewtonEulerDS__hasConstantMExt_get, _sicpykernel.NewtonEulerDS__hasConstantMExt_set, doc=r""" boolean if _mext is constant (set thanks to setMExtPtr for instance) false by default """) _isMextExpressedInInertialFrame = property(_sicpykernel.NewtonEulerDS__isMextExpressedInInertialFrame_get, _sicpykernel.NewtonEulerDS__isMextExpressedInInertialFrame_set, doc=r""" if true, we assume that mExt is given in inertial frame (default false)""") _mInt = property(_sicpykernel.NewtonEulerDS__mInt_get, _sicpykernel.NewtonEulerDS__mInt_set, doc=r""" external moment expressed in the body-fixed frame internal moment of the forces""") _jacobianFIntq = property(_sicpykernel.NewtonEulerDS__jacobianFIntq_get, _sicpykernel.NewtonEulerDS__jacobianFIntq_set, doc=r""" jacobian_q FInt w.r.t q""") _jacobianFInttwist = property(_sicpykernel.NewtonEulerDS__jacobianFInttwist_get, _sicpykernel.NewtonEulerDS__jacobianFInttwist_set, doc=r""" jacobian_twist FInt w.r.t the twist""") _jacobianMIntq = property(_sicpykernel.NewtonEulerDS__jacobianMIntq_get, _sicpykernel.NewtonEulerDS__jacobianMIntq_set, doc=r""" jacobian_q MInt w.r.t q""") _jacobianMInttwist = property(_sicpykernel.NewtonEulerDS__jacobianMInttwist_get, _sicpykernel.NewtonEulerDS__jacobianMInttwist_set, doc=r""" jacobian_twist MInt w.r.t the twist""") _jacobianMExtq = property(_sicpykernel.NewtonEulerDS__jacobianMExtq_get, _sicpykernel.NewtonEulerDS__jacobianMExtq_set, doc=r""" jacobian_q MExt w.r.t q""") _mGyr = property(_sicpykernel.NewtonEulerDS__mGyr_get, _sicpykernel.NewtonEulerDS__mGyr_set, doc=r""" gyroscpical moment""") _jacobianMGyrtwist = property(_sicpykernel.NewtonEulerDS__jacobianMGyrtwist_get, _sicpykernel.NewtonEulerDS__jacobianMGyrtwist_set, doc=r""" jacobian_twist of mGyr w.r.t the twist""") _wrench = property(_sicpykernel.NewtonEulerDS__wrench_get, _sicpykernel.NewtonEulerDS__wrench_set, doc=r""" wrench (q,twist,t)= [ fExt - fInt ; mExtBodyFrame - mGyr - mInt ]^T""") _jacobianWrenchq = property(_sicpykernel.NewtonEulerDS__jacobianWrenchq_get, _sicpykernel.NewtonEulerDS__jacobianWrenchq_set, doc=r""" jacobian_q forces""") _jacobianWrenchTwist = property(_sicpykernel.NewtonEulerDS__jacobianWrenchTwist_get, _sicpykernel.NewtonEulerDS__jacobianWrenchTwist_set, doc=r""" jacobian_{twist} forces""") _nullifyMGyr = property(_sicpykernel.NewtonEulerDS__nullifyMGyr_get, _sicpykernel.NewtonEulerDS__nullifyMGyr_set, doc=r""" if true, we set the gyroscopic forces equal to 0 (default false) *""") _computeJacobianFIntqByFD = property(_sicpykernel.NewtonEulerDS__computeJacobianFIntqByFD_get, _sicpykernel.NewtonEulerDS__computeJacobianFIntqByFD_set, doc=r""" If true, we compute the missing Jacobian by forward finite difference""") _computeJacobianFInttwistByFD = property(_sicpykernel.NewtonEulerDS__computeJacobianFInttwistByFD_get, _sicpykernel.NewtonEulerDS__computeJacobianFInttwistByFD_set, doc=r""" If true, we compute the missing Jacobian by forward finite difference""") _computeJacobianMIntqByFD = property(_sicpykernel.NewtonEulerDS__computeJacobianMIntqByFD_get, _sicpykernel.NewtonEulerDS__computeJacobianMIntqByFD_set, doc=r""" If true, we compute the missing Jacobian by forward finite difference""") _computeJacobianMInttwistByFD = property(_sicpykernel.NewtonEulerDS__computeJacobianMInttwistByFD_get, _sicpykernel.NewtonEulerDS__computeJacobianMInttwistByFD_set, doc=r""" If true, we compute the missing Jacobian by forward finite difference""") _epsilonFD = property(_sicpykernel.NewtonEulerDS__epsilonFD_get, _sicpykernel.NewtonEulerDS__epsilonFD_set, doc=r""" value of the step in finite difference""") _pluginFExt = property(_sicpykernel.NewtonEulerDS__pluginFExt_get, _sicpykernel.NewtonEulerDS__pluginFExt_set, doc=r""" Plugin to compute strength of external forces""") _pluginMExt = property(_sicpykernel.NewtonEulerDS__pluginMExt_get, _sicpykernel.NewtonEulerDS__pluginMExt_set, doc=r""" Plugin to compute the external moment expressed in the inertial frame""") _pluginFInt = property(_sicpykernel.NewtonEulerDS__pluginFInt_get, _sicpykernel.NewtonEulerDS__pluginFInt_set, doc=r""" Plugin to compute strength of internal forces""") _pluginMInt = property(_sicpykernel.NewtonEulerDS__pluginMInt_get, _sicpykernel.NewtonEulerDS__pluginMInt_set, doc=r""" Plugin to compute moments of internal forces""") _pluginJacqFInt = property(_sicpykernel.NewtonEulerDS__pluginJacqFInt_get, _sicpykernel.NewtonEulerDS__pluginJacqFInt_set, doc=r""" The following code is commented because the jacobian of _mInt and _fInt are not yet used by the numerical scheme. Will be needed by a fully implicit scheme for instance. NewtonEulerDS plug-in to compute :math:`\nabla_qF_{Int}(\dot q, q, t)`, id = "jacobianFIntq" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param twist: : pointer to the first element of twist :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJactwistFInt = property(_sicpykernel.NewtonEulerDS__pluginJactwistFInt_get, _sicpykernel.NewtonEulerDS__pluginJactwistFInt_set, doc=r""" NewtonEulerDS plug-in to compute :math:`\nabla_{\dot q}F_{Int}(\dot q, q, t)`, id = "jacobianFIntTwist" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param twist: : pointer to the first element of twist :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJacqMInt = property(_sicpykernel.NewtonEulerDS__pluginJacqMInt_get, _sicpykernel.NewtonEulerDS__pluginJacqMInt_set, doc=r""" NewtonEulerDS plug-in to compute :math:`\nabla_qM_{Int}(\dot q, q, t)`, id = "jacobianMInttwist" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param twist: : pointer to the first element of twist :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _pluginJactwistMInt = property(_sicpykernel.NewtonEulerDS__pluginJactwistMInt_get, _sicpykernel.NewtonEulerDS__pluginJactwistMInt_set, doc=r""" NewtonEulerDS plug-in to compute :math:`\nabla_{\dot q}M_{Int}(\dot q, q, t)`, id = "jacobianMInttwist" :param time: : current time :param sizeOfq: : size of vector q :param q: : pointer to the first element of q :param twist: : pointer to the first element of twist :param jacob: : pointer to the first element of the jacobian :param size: of vector z :param z: : a vector of user-defined parameters """) _rhsMatrices = property(_sicpykernel.NewtonEulerDS__rhsMatrices_get, _sicpykernel.NewtonEulerDS__rhsMatrices_set, doc=r""" A container of matrices to save matrices that are involed in first order from of NewtonEulerDS system values (jacobianXBloc10, jacobianXBloc11, zeroMatrix, idMatrix) No get-set functions at the time. Only used as a protected member. """) def _zeroPlugin(self) -> "void": r""" build all _plugin... PluggedObject""" return _sicpykernel.NewtonEulerDS__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor from a minimum set of data :type position: :py:class:`SiconosVector` :param position: initial coordinates of this DynamicalSystem :type twist: :py:class:`SiconosVector` :param twist: initial twist of this DynamicalSystem :type mass: float :param mass: the mass :type inertia: :py:class:`SiconosMatrix` :param inertia: the inertia matrix """ if self.__class__ == NewtonEulerDS: _self = None else: _self = self _sicpykernel.NewtonEulerDS_swiginit(self, _sicpykernel.new_NewtonEulerDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NewtonEulerDS
[docs] def resetToInitialState(self) -> "void": r""" reset the state to the initial state""" return _sicpykernel.NewtonEulerDS_resetToInitialState(self)
[docs] def initRhs(self, time: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type time: float :param time: of initialization """ return _sicpykernel.NewtonEulerDS_initRhs(self, time)
[docs] def initializeNonSmoothInput(self, level: "unsigned int") -> "void": r""" set nonsmooth input to zero :type level: int :param level: input-level to be initialized. """ return _sicpykernel.NewtonEulerDS_initializeNonSmoothInput(self, level)
[docs] def computeRhs(self, time: "double") -> "void": r""" update right-hand side for the current state :type time: float :param time: of interest """ return _sicpykernel.NewtonEulerDS_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" update :math:`\nabla_x rhs` for the current state :type time: float :param time: of interest """ return _sicpykernel.NewtonEulerDS_computeJacobianRhsx(self, time)
[docs] def resetAllNonSmoothParts(self) -> "void": r""" reset non-smooth part of the rhs (i.e. p), for all 'levels'""" return _sicpykernel.NewtonEulerDS_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" set nonsmooth part of the rhs (i.e. p) to zero for a given level :type level: int :param level: """ return _sicpykernel.NewtonEulerDS_resetNonSmoothPart(self, level)
[docs] def forces(self) -> "SP::SiconosVector": r""" get forces :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.NewtonEulerDS_forces(self)
[docs] def jacobianqForces(self) -> "SP::SiconosMatrix": r""" get JacobianqForces :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.NewtonEulerDS_jacobianqForces(self)
[docs] def jacobianvForces(self) -> "SP::SiconosMatrix": r""" get JacobianvForces :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.NewtonEulerDS_jacobianvForces(self)
[docs] def getqDim(self) -> "unsigned int": r""" Returns dimension of vector q""" return _sicpykernel.NewtonEulerDS_getqDim(self)
[docs] def q(self) -> "SP::SiconosVector": r""" get q (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.NewtonEulerDS_q(self)
[docs] def setQ(self, newValue: "SiconosVector") -> "void": r""" set value of generalized coordinates vector (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.NewtonEulerDS_setQ(self, newValue)
[docs] def setQPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set value of generalized coordinates vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.NewtonEulerDS_setQPtr(self, newPtr)
[docs] def setQ0(self, newValue: "SiconosVector") -> "void": r""" set initial state (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.NewtonEulerDS_setQ0(self, newValue)
[docs] def setQ0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial state (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.NewtonEulerDS_setQ0Ptr(self, newPtr)
[docs] def twist(self) -> "SP::SiconosVector": r""" get twist :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.NewtonEulerDS_twist(self)
[docs] def velocity(self) -> "SP::SiconosVector": r""" get twist :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector this accessor is left to get a uniform access to velocity. This should be removed with MechanicalDS class """ return _sicpykernel.NewtonEulerDS_velocity(self)
def twist0(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEulerDS_twist0(self)
[docs] def velocity0(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEulerDS_velocity0(self)
[docs] def setVelocity(self, newValue: "SiconosVector") -> "void": r""" set velocity (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.NewtonEulerDS_setVelocity(self, newValue)
[docs] def setVelocityPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set velocity (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.NewtonEulerDS_setVelocityPtr(self, newPtr)
[docs] def setVelocity0(self, newValue: "SiconosVector") -> "void": r""" set initial velocity (copy) :type newValue: :py:class:`SiconosVector` :param newValue: """ return _sicpykernel.NewtonEulerDS_setVelocity0(self, newValue)
[docs] def setVelocity0Ptr(self, newPtr: "SP::SiconosVector") -> "void": r""" set initial velocity (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: """ return _sicpykernel.NewtonEulerDS_setVelocity0Ptr(self, newPtr)
[docs] def acceleration(self) -> "SP::SiconosVector": r""" get acceleration (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.NewtonEulerDS_acceleration(self)
[docs] def computeMass(self, *args) -> "void": r""" *Overload 1:* default function to compute the mass | *Overload 2:* function to compute the mass :type position: :py:class:`SiconosVector` :param position: value used to evaluate the mass matrix """ return _sicpykernel.NewtonEulerDS_computeMass(self, *args)
[docs] def linearVelocity(self, *args) -> "void": r""" *Overload 1:* Get the linear velocity in the absolute (inertial) or relative (body) frame of reference. :type absoluteRef: boolean :param absoluteRef: If true, velocity is returned in the inertial frame, otherwise velocity is returned in the body frame. :rtype: :py:class:`SiconosVector` :return: A SiconosVector of size 3 containing the linear velocity of this dynamical system. | *Overload 2:* Fill a SiconosVector with the linear velocity in the absolute (inertial) or relative (body) frame of reference. :type absoluteRef: boolean :param absoluteRef: If true, velocity is returned in the inertial frame, otherwise velocity is returned in the body frame. :type v: :py:class:`SiconosVector` :param v: A SiconosVector of size 3 to receive the linear velocity. """ return _sicpykernel.NewtonEulerDS_linearVelocity(self, *args)
[docs] def angularVelocity(self, *args) -> "void": r""" *Overload 1:* Get the angular velocity in the absolute (inertial) or relative (body) frame of reference. :type absoluteRef: boolean :param absoluteRef: If true, velocity is returned in the inertial frame, otherwise velocity is returned in the body frame. :rtype: :py:class:`SiconosVector` :return: A SiconosVector of size 3 containing the angular velocity of this dynamical system. | *Overload 2:* Fill a SiconosVector with the angular velocity in the absolute (inertial) or relative (body) frame of reference. :type absoluteRef: boolean :param absoluteRef: If true, velocity is returned in the inertial frame, otherwise velocity is returned in the body frame. :type w: :py:class:`SiconosVector` :param w: A SiconosVector of size 3 to receive the angular velocity. """ return _sicpykernel.NewtonEulerDS_angularVelocity(self, *args)
[docs] def scalarMass(self) -> "double": r""" get mass value :rtype: float :return: a double """ return _sicpykernel.NewtonEulerDS_scalarMass(self)
[docs] def setScalarMass(self, mass: "double") -> "void": r""" Modify the scalar mass""" return _sicpykernel.NewtonEulerDS_setScalarMass(self, mass)
[docs] def inertia(self) -> "SP::SiconosMatrix": r""" :rtype: :py:class:`SiconosMatrix` :return: the inertia matrix """ return _sicpykernel.NewtonEulerDS_inertia(self)
[docs] def setInertia(self, *args) -> "void": r""" *Overload 1:* Modify the inertia matrix (pointer link) :type newInertia: :py:class:`SiconosMatrix` :param newInertia: the new inertia matrix | *Overload 2:* Modify the inertia matrix. :type ix: float :param ix: x component :type iy: float :param iy: y component :type iz: float :param iz: z component """ return _sicpykernel.NewtonEulerDS_setInertia(self, *args)
[docs] def updateMassMatrix(self) -> "void": r""" to be called after scalar mass or inertia matrix have changed""" return _sicpykernel.NewtonEulerDS_updateMassMatrix(self)
[docs] def fExt(self) -> "SP::SiconosVector": r""" get fExt :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.NewtonEulerDS_fExt(self)
[docs] def setFExtPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set fExt to pointer newPtr :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to a Simple vector """ return _sicpykernel.NewtonEulerDS_setFExtPtr(self, newPtr)
[docs] def mExt(self) -> "SP::SiconosVector": r""" get mExt :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.NewtonEulerDS_mExt(self)
[docs] def setMExtPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set mExt to pointer newPtr :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to a Simple vector """ return _sicpykernel.NewtonEulerDS_setMExtPtr(self, newPtr)
[docs] def mGyr(self) -> "SP::SiconosVector": r""" get mGyr :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.NewtonEulerDS_mGyr(self)
def T(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerDS_T(self) def Tdot(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerDS_Tdot(self) def dotq(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEulerDS_dotq(self)
[docs] def qMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector q stored in memory :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.NewtonEulerDS_qMemory(self)
[docs] def twistMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector twist stored in memory :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.NewtonEulerDS_twistMemory(self)
[docs] def velocityMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector twist stored in memory :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.NewtonEulerDS_velocityMemory(self)
[docs] def initMemory(self, steps: "unsigned int") -> "void": r""" initialize the SiconosMemory objects with a positive size. :type steps: int :param steps: the size of the SiconosMemory (i) """ return _sicpykernel.NewtonEulerDS_initMemory(self, steps)
[docs] def swapInMemory(self) -> "void": r""" push the current values of x, q and r in the stored previous values xMemory, qMemory, rMemory, TODO: Modify the function swapIn Memory with the new Object Memory """ return _sicpykernel.NewtonEulerDS_swapInMemory(self)
[docs] def forcesMemory(self) -> "SiconosMemory const &": return _sicpykernel.NewtonEulerDS_forcesMemory(self)
def dotqMemory(self) -> "SiconosMemory const &": return _sicpykernel.NewtonEulerDS_dotqMemory(self)
[docs] def computeKineticEnergy(self) -> "double": r""" To compute the kinetic energy""" return _sicpykernel.NewtonEulerDS_computeKineticEnergy(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data to the screen""" return _sicpykernel.NewtonEulerDS_display(self, brief)
def setIsMextExpressedInInertialFrame(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setIsMextExpressedInInertialFrame(self, value) def setNullifyMGyr(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setNullifyMGyr(self, value) def normalizeq(self) -> "void": return _sicpykernel.NewtonEulerDS_normalizeq(self)
[docs] def init_inverse_mass(self) -> "void": r""" Allocate memory for the lu factorization of the mass of the system. Useful for some integrators with system inversion involving the mass """ return _sicpykernel.NewtonEulerDS_init_inverse_mass(self)
[docs] def update_inverse_mass(self) -> "void": r""" Update the content of the lu factorization of the mass of the system, if required. """ return _sicpykernel.NewtonEulerDS_update_inverse_mass(self)
def setComputeJacobianFIntqByFD(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setComputeJacobianFIntqByFD(self, value) def setComputeJacobianFIntvByFD(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setComputeJacobianFIntvByFD(self, value) def setComputeJacobianMIntqByFD(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setComputeJacobianMIntqByFD(self, value) def setComputeJacobianMIntvByFD(self, value: "bool") -> "void": return _sicpykernel.NewtonEulerDS_setComputeJacobianMIntvByFD(self, value)
[docs] def setComputeFExtFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute _fExt :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute _fExt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeFExtFunction(self, *args)
[docs] def setComputeMExtFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute _mExt :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute _mExt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeMExtFunction(self, *args)
[docs] def setComputeFIntFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute _fInt :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute _fInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeFIntFunction(self, *args)
[docs] def setComputeMIntFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute _mInt :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute _mInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeMIntFunction(self, *args)
[docs] def setComputeJacobianFIntqFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian w.r.t q of the internal forces :type pluginPath: string :param pluginPath: std::string : the complete path to the plugin :type functionName: string :param functionName: std::string : the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following q of the FInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeJacobianFIntqFunction(self, *args)
[docs] def setComputeJacobianFIntvFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian following v of the internal forces w.r.t. :type pluginPath: string :param pluginPath:: the complete path to the plugin :type functionName: string :param functionName:: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following v of the FInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeJacobianFIntvFunction(self, *args)
[docs] def setComputeJacobianMIntqFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian w.r.t q of the internal forces :type pluginPath: string :param pluginPath:: the complete path to the plugin :type functionName: string :param functionName:: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following q of the FInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeJacobianMIntqFunction(self, *args)
[docs] def setComputeJacobianMIntvFunction(self, *args) -> "void": r""" *Overload 1:* allow to set a specified function to compute the jacobian following v of the internal forces w.r.t. :type pluginPath: string :param pluginPath:: the complete path to the plugin :type functionName: string :param functionName:: the name of the function to use in this plugin | *Overload 2:* set a specified function to compute jacobian following v of the FInt :type fct: void :param fct: a pointer on the plugin function """ return _sicpykernel.NewtonEulerDS_setComputeJacobianMIntvFunction(self, *args)
[docs] def computeFExt(self, *args) -> "void": r""" *Overload 1:* function to compute the external forces :type time: float :param time: the current time | *Overload 2:* default function to compute the external forces :type time: float :param time: the current time :type fExt: :py:class:`SiconosVector` :param fExt: the computed external force (in-out param) """ return _sicpykernel.NewtonEulerDS_computeFExt(self, *args)
def computeMExt(self, *args) -> "void": return _sicpykernel.NewtonEulerDS_computeMExt(self, *args)
[docs] def addExtForceAtPos(self, *args) -> "void": r""" Adds a force/torque impulse to a body's FExt and MExt vectors in either absolute (inertial) or relative (body) frame. Modifies contents of _fExt and _mExt! Therefore these must have been set as constant vectors using setFExtPtr and setMExtPtr prior to calling this function. Adjustments to _mExt will take into account the value of _isMextExpressedInInertialFrame. :type force: :py:class:`SiconosVector` :param force: A force vector to be added. :type forceAbsRef: boolean :param forceAbsRef: If true, force is in inertial frame, otherwise it is in body frame. :type pos: :py:class:`SiconosVector`, optional :param pos: A position at which force should be applied. If nullptr, the center of mass is assumed. :type posAbsRef: boolean, optional :param posAbsRef: If true, pos is in inertial frame, otherwise it is in body frame. """ return _sicpykernel.NewtonEulerDS_addExtForceAtPos(self, *args)
def computeJacobianMExtqExpressedInInertialFrameByFD(self, time: "double", q: "SP::SiconosVector") -> "void": return _sicpykernel.NewtonEulerDS_computeJacobianMExtqExpressedInInertialFrameByFD(self, time, q) def computeJacobianMExtqExpressedInInertialFrame(self, time: "double", q: "SP::SiconosVector") -> "void": return _sicpykernel.NewtonEulerDS_computeJacobianMExtqExpressedInInertialFrame(self, time, q)
[docs] def computeFInt(self, *args) -> "void": r""" *Overload 1:* default function to compute the internal forces :type time: float :param time: the current time function to compute the internal forces :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: :type v: :py:class:`SiconosVector` :param v: | *Overload 2:* default function to compute the internal forces :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: :type v: :py:class:`SiconosVector` :param v: :type fInt: :py:class:`SiconosVector` :param fInt: the computed internal force vector """ return _sicpykernel.NewtonEulerDS_computeFInt(self, *args)
[docs] def computeMInt(self, *args) -> "void": r""" *Overload 1:* default function to compute the internal moments :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: :type v: :py:class:`SiconosVector` :param v: | *Overload 2:* default function to compute the internal moments :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: :type v: :py:class:`SiconosVector` :param v: :type mInt: :py:class:`SiconosVector` :param mInt: the computed internal moment vector """ return _sicpykernel.NewtonEulerDS_computeMInt(self, *args)
[docs] def updatePlugins(self, time: "double") -> "void": r""" default function to update the plugins functions using a new time: :type time: float :param time: the current time """ return _sicpykernel.NewtonEulerDS_updatePlugins(self, time)
[docs] def init_forces(self) -> "void": r""" Allocate memory for forces and its jacobian.""" return _sicpykernel.NewtonEulerDS_init_forces(self)
[docs] def computeForces(self, *args) -> "void": r""" *Overload 1:* Default function to compute forces :type time: float :param time: double, the current time | *Overload 2:* function to compute forces with some specific values for q and twist (ie not those of the current state). :type time: float :param time: double : the current time :type q: :py:class:`SiconosVector` :param q: SP::SiconosVector: pointers on q :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector: pointers on twist """ return _sicpykernel.NewtonEulerDS_computeForces(self, *args)
[docs] def computeJacobianqForces(self, time: "double") -> "void": r""" Default function to compute the jacobian w.r.t. q of forces :type time: float :param time: double, the current time """ return _sicpykernel.NewtonEulerDS_computeJacobianqForces(self, time)
[docs] def computeJacobianvForces(self, time: "double") -> "void": r""" Default function to compute the jacobian w.r.t. v of forces :type time: float :param time: double, the current time """ return _sicpykernel.NewtonEulerDS_computeJacobianvForces(self, time)
[docs] def computeMGyr(self, *args) -> "void": r""" *Overload 1:* function to compute gyroscopic forces with some specific values for q and twist (ie not those of the current state). :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector: pointers on twist vector | *Overload 2:* function to compute gyroscopic forces with some specific values for q and twist (ie not those of the current state). :type twist: :py:class:`SiconosVector` :param twist: pointer to twist vector :type mGyr: :py:class:`SiconosVector` :param mGyr: pointer to gyroscopic forces """ return _sicpykernel.NewtonEulerDS_computeMGyr(self, *args)
[docs] def computeJacobianMGyrtwist(self, time: "double") -> "void": r""" Default function to compute the jacobian following q of mGyr :type time: float :param time: the current time """ return _sicpykernel.NewtonEulerDS_computeJacobianMGyrtwist(self, time)
[docs] def computeJacobianMGyrtwistByFD(self, time: "double", q: "SP::SiconosVector", twist: "SP::SiconosVector") -> "void": r""" Default function to compute the jacobian following q of mGyr by forward finite difference :type time: float :param time: the current time :type q: :py:class:`SiconosVector` :param q: current state :type twist: :py:class:`SiconosVector` :param twist: pointer to twist vector """ return _sicpykernel.NewtonEulerDS_computeJacobianMGyrtwistByFD(self, time, q, twist)
[docs] def computeJacobianFIntq(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: double : the current time | *Overload 2:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: double :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianFIntq(self, *args)
[docs] def computeJacobianFIntqByFD(self, time: "double", position: "SP::SiconosVector", twist: "SP::SiconosVector") -> "void": r""" To compute the jacobian w.r.t q of the internal forces by forward finite difference :type time: float :param time: double :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianFIntqByFD(self, time, position, twist)
[docs] def computeJacobianFIntv(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t v of the internal forces :type time: float :param time: double : the current time | *Overload 2:* To compute the jacobian w.r.t. v of the internal forces :type time: float :param time: double: the current time :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianFIntv(self, *args)
[docs] def computeJacobianFIntvByFD(self, time: "double", position: "SP::SiconosVector", twist: "SP::SiconosVector") -> "void": r""" To compute the jacobian w.r.t v of the internal forces by forward finite difference :type time: float :param time: double :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianFIntvByFD(self, time, position, twist)
[docs] def computeJacobianMIntq(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: double : the current time | *Overload 2:* To compute the jacobian w.r.t q of the internal forces :type time: float :param time: double : the current time, :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianMIntq(self, *args)
[docs] def computeJacobianMIntqByFD(self, time: "double", position: "SP::SiconosVector", twist: "SP::SiconosVector") -> "void": r""" To compute the jacobian w.r.t q of the internal moments by forward finite difference :type time: float :param time: double :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianMIntqByFD(self, time, position, twist)
[docs] def computeJacobianMIntv(self, *args) -> "void": r""" *Overload 1:* To compute the jacobian w.r.t v of the internal forces :type time: float :param time: double : the current time | *Overload 2:* To compute the jacobian w.r.t. v of the internal forces :type time: float :param time: double: the current time :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianMIntv(self, *args)
[docs] def computeJacobianMIntvByFD(self, time: "double", position: "SP::SiconosVector", twist: "SP::SiconosVector") -> "void": r""" To compute the jacobian w.r.t v of the internal moments by forward finite difference :type time: float :param time: double :type position: :py:class:`SiconosVector` :param position: SP::SiconosVector :type twist: :py:class:`SiconosVector` :param twist: SP::SiconosVector """ return _sicpykernel.NewtonEulerDS_computeJacobianMIntvByFD(self, time, position, twist)
def computeT(self) -> "void": return _sicpykernel.NewtonEulerDS_computeT(self) def computeTdot(self) -> "void": return _sicpykernel.NewtonEulerDS_computeTdot(self) def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonEulerDS(self) return weakref.proxy(self)
# Register NewtonEulerDS in _sicpykernel: _sicpykernel.NewtonEulerDS_swigregister(NewtonEulerDS)
[docs] class FirstOrderNonLinearDS(DynamicalSystem): r""" General First Order Non Linear Dynamical Systems This class defines and computes a generic n-dimensional dynamical system of the form : .. math:: M \dot x = f(x,t,z) + r, \quad x(t_0) = x_0 where - :math:`x \in R^{n}` is the state. - :math:`M \in R^{n\times n}` a "mass matrix" - :math:`r \in R^{n}` the input due to the Non Smooth Interaction. - :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some sort of discret state. For example, z may be used to set some perturbation parameters, to control the system (z set by actuators) and so on. - :math:`f : R^{n} \times R \mapsto R^{n}` the vector field. By default, the DynamicalSystem is considered to be an Initial Value Problem (IVP) and the initial conditions are given by .. math:: x(t_0)=x_0 To define a Boundary Value Problem, a pointer on a BoundaryCondition must be set. The right-hand side and its jacobian (from base class) are defined as .. math:: rhs &=& \dot x = M^{-1}(f(x,t,z)+ r) \\ jacobianRhsx &=& \nabla_x rhs(x,t,z) = M^{-1}\nabla_x f(x,t,z) The following operators can be plugged, in the usual way (see User Guide) - :math:`f(x,t,z)` - :math:`\nabla_x f(x,t,z)` - :math:`M(t)` """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def _init(self, initial_state: "SP::SiconosVector") -> "void": r""" Common code for constructors should be replaced in C++11 by delegating constructors :type initial_state: :py:class:`SiconosVector` :param initial_state: vector of initial values for state """ return _sicpykernel.FirstOrderNonLinearDS__init(self, initial_state) _M = property(_sicpykernel.FirstOrderNonLinearDS__M_get, _sicpykernel.FirstOrderNonLinearDS__M_set, doc=r""" Matrix coefficient of :math:`\dot x`""") _f = property(_sicpykernel.FirstOrderNonLinearDS__f_get, _sicpykernel.FirstOrderNonLinearDS__f_set, doc=r""" value of f(x,t,z)""") _fold = property(_sicpykernel.FirstOrderNonLinearDS__fold_get, _sicpykernel.FirstOrderNonLinearDS__fold_set, doc=r""" to store f(x_k,t_k,z_k)""") _jacobianfx = property(_sicpykernel.FirstOrderNonLinearDS__jacobianfx_get, _sicpykernel.FirstOrderNonLinearDS__jacobianfx_set, doc=r""" Gradient of :math:`f(x,t,z)` with respect to :math:`x`""") _pluginf = property(_sicpykernel.FirstOrderNonLinearDS__pluginf_get, _sicpykernel.FirstOrderNonLinearDS__pluginf_set, doc=r""" DynamicalSystem plug-in to compute f(x,t,z) :param current: time :param size: of the vector _x :param pointer: to the first element of the vector _x :param the: pointer to the first element of the vector _f :param the: size of the vector _z :param a: vector of parameters _z """) _pluginJacxf = property(_sicpykernel.FirstOrderNonLinearDS__pluginJacxf_get, _sicpykernel.FirstOrderNonLinearDS__pluginJacxf_set, doc=r""" DynamicalSystem plug-in to compute the gradient of f(x,t,z) with respect to the state: :math:`\nabla_x f: (x,t,z) \in R^{n} \times R \mapsto R^{n \times n}` :param time: current time :param sizeOfX: size of vector x :param x: pointer to the first element of x :param jacob: pointer to the first element of jacobianfx matrix :param the: size of the vector z :param a: vector of parameters, z """) _pluginM = property(_sicpykernel.FirstOrderNonLinearDS__pluginM_get, _sicpykernel.FirstOrderNonLinearDS__pluginM_set) _rMemory = property(_sicpykernel.FirstOrderNonLinearDS__rMemory_get, doc=r""" the previous r vectors""") _invM = property(_sicpykernel.FirstOrderNonLinearDS__invM_get, _sicpykernel.FirstOrderNonLinearDS__invM_set, doc=r""" Copy of M Matrix, LU-factorized, used to solve systems like Mx = b with LU-factorization. (Warning: may not exist, used if we need to avoid factorization in place of M) """) def _zeroPlugin(self) -> "void": r""" Reset the PluggedObjects""" return _sicpykernel.FirstOrderNonLinearDS__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from initial state, leads to :math:`\dot x = r` :type newX0: :py:class:`SiconosVector` :param newX0: initial state Warning: you need to set explicitely the plugin for f and its jacobian if needed (e.g. if used with an EventDriven scheme) | *Overload 3:* constructor from initial state and f (plugins), :math:`\dot x = f(x, t, z) + r` :type newX0: :py:class:`SiconosVector` :param newX0: initial state :type fPlugin: string :param fPlugin: name of the plugin function to be used for f(x,t,z) :type jacobianfxPlugin: string :param jacobianfxPlugin: name of the plugin to be used for the jacobian of f(x,t,z) | *Overload 4:* Copy constructor :type FONLDS: :py:class:`FirstOrderNonLinearDS` :param FONLDS: the FirstOrderNonLinearDS to copy """ if self.__class__ == FirstOrderNonLinearDS: _self = None else: _self = self _sicpykernel.FirstOrderNonLinearDS_swiginit(self, _sicpykernel.new_FirstOrderNonLinearDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderNonLinearDS
[docs] def initRhs(self, time: "double") -> "void": r""" allocate (if needed) and compute rhs and its jacobian. :type time: float :param time: of initialization """ return _sicpykernel.FirstOrderNonLinearDS_initRhs(self, time)
[docs] def initializeNonSmoothInput(self, level: "unsigned int") -> "void": r""" set nonsmooth input to zero :type level: int :param level: input-level to be initialized. """ return _sicpykernel.FirstOrderNonLinearDS_initializeNonSmoothInput(self, level)
[docs] def resetToInitialState(self) -> "void": r""" reset the state to the initial state""" return _sicpykernel.FirstOrderNonLinearDS_resetToInitialState(self)
[docs] def computeRhs(self, time: "double") -> "void": r""" update right-hand side for the current state :type time: float :param time: of interest """ return _sicpykernel.FirstOrderNonLinearDS_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" update :math:`\nabla_x rhs` for the current state :type time: float :param time: of interest """ return _sicpykernel.FirstOrderNonLinearDS_computeJacobianRhsx(self, time)
[docs] def resetAllNonSmoothParts(self) -> "void": r""" reset non-smooth part of the rhs (i.e. r), for all 'levels'""" return _sicpykernel.FirstOrderNonLinearDS_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" set nonsmooth part of the rhs (i.e. r) to zero for a given level :type level: int :param level: """ return _sicpykernel.FirstOrderNonLinearDS_resetNonSmoothPart(self, level)
[docs] def M(self) -> "SP::SiconosMatrix": r""" returns a pointer to M, matrix coeff. on left-hand side""" return _sicpykernel.FirstOrderNonLinearDS_M(self)
[docs] def setMPtr(self, newM: "SP::SiconosMatrix") -> "void": r""" set M, matrix coeff of left-hand side (pointer link) :type newM: :py:class:`SiconosMatrix` :param newM: the new M matrix """ return _sicpykernel.FirstOrderNonLinearDS_setMPtr(self, newM)
[docs] def getInvM(self) -> "SimpleMatrix const": r""" get a copy of the LU factorisation of M operator :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.FirstOrderNonLinearDS_getInvM(self)
[docs] def invM(self) -> "SP::SiconosMatrix": r""" get the inverse of LU fact. of M operator (pointer link) :rtype: :py:class:`SiconosMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.FirstOrderNonLinearDS_invM(self)
[docs] def f(self) -> "SP::SiconosVector": r""" returns f(x,t,z) (pointer link)""" return _sicpykernel.FirstOrderNonLinearDS_f(self)
[docs] def setFPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set f(x,t,z) (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP::SiconosVector """ return _sicpykernel.FirstOrderNonLinearDS_setFPtr(self, newPtr)
[docs] def jacobianfx(self) -> "SP::SiconosMatrix": r""" get jacobian of f(x,t,z) with respect to x (pointer link) :rtype: :py:class:`SiconosMatrix` :return: SP::SiconosMatrix """ return _sicpykernel.FirstOrderNonLinearDS_jacobianfx(self)
[docs] def setJacobianfxPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set jacobian of f(x,t,z) with respect to x (pointer link) :type newPtr: :py:class:`SiconosMatrix` :param newPtr: the new value """ return _sicpykernel.FirstOrderNonLinearDS_setJacobianfxPtr(self, newPtr)
[docs] def rMemory(self) -> "SiconosMemory const &": r""" get all the values of the state vector r stored in memory :rtype: :py:class:`SiconosMemory` :return: a memory vector """ return _sicpykernel.FirstOrderNonLinearDS_rMemory(self)
[docs] def fold(self) -> "SP::SiconosVector": r""" returns previous value of rhs -->OSI Related!!""" return _sicpykernel.FirstOrderNonLinearDS_fold(self)
[docs] def initMemory(self, steps: "unsigned int") -> "void": r""" initialize the SiconosMemory objects: reserve memory for i vectors in memory and reset all to zero. :type steps: int :param steps: the size of the SiconosMemory (i) """ return _sicpykernel.FirstOrderNonLinearDS_initMemory(self, steps)
[docs] def swapInMemory(self) -> "void": r""" push the current values of x and r in memory (index 0 of memory is the last inserted vector) xMemory and rMemory, """ return _sicpykernel.FirstOrderNonLinearDS_swapInMemory(self)
[docs] def updatePlugins(self, time: "double") -> "void": r""" Call all plugged-function to initialize plugged-object values :type time: float :param time: value """ return _sicpykernel.FirstOrderNonLinearDS_updatePlugins(self, time)
[docs] def setComputeMFunction(self, *args) -> "void": r""" *Overload 1:* to set a specified function to compute M :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: function name to use in this library | *Overload 2:* set a specified function to compute M :type fct: FPtr1 :param fct: a pointer on the plugin function """ return _sicpykernel.FirstOrderNonLinearDS_setComputeMFunction(self, *args)
[docs] def setComputeFFunction(self, *args) -> "void": r""" *Overload 1:* to set a specified function to compute f(x,t) :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this library | *Overload 2:* set a specified function to compute the vector f :type fct: FPtr1 :param fct: a pointer on the plugin function """ return _sicpykernel.FirstOrderNonLinearDS_setComputeFFunction(self, *args)
[docs] def setComputeJacobianfxFunction(self, *args) -> "void": r""" *Overload 1:* to set a specified function to compute jacobianfx :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: function name to use in this library | *Overload 2:* set a specified function to compute jacobianfx :type fct: FPtr1 :param fct: a pointer on the plugin function """ return _sicpykernel.FirstOrderNonLinearDS_setComputeJacobianfxFunction(self, *args)
[docs] def computeM(self, time: "double") -> "void": r""" Default function to compute :math:`M: (x,t)` :type time: float :param time: time instant used in the computations """ return _sicpykernel.FirstOrderNonLinearDS_computeM(self, time)
[docs] def computef(self, time: "double", state: "SP::SiconosVector") -> "void": r""" Default function to compute :math:`f: (x,t)` :type time: float :param time: time instant used in the computations function to compute :math:`f: (x,t)` :type time: float :param time: time instant used in the computations :type state: :py:class:`SiconosVector` :param state: x value """ return _sicpykernel.FirstOrderNonLinearDS_computef(self, time, state)
[docs] def computeJacobianfx(self, time: "double", state: "SP::SiconosVector") -> "void": r""" Default function to compute :math:`\nabla_x f: (x,t) \in R^{n} \times R \mapsto R^{n \times n}` with x different from current saved state. :type time: float :param time: instant used in the computations :type state: :py:class:`SiconosVector` :param state: a SiconosVector to store the resuting value """ return _sicpykernel.FirstOrderNonLinearDS_computeJacobianfx(self, time, state)
[docs] def getPluginF(self) -> "SP::PluggedObject": r""" Get _pluginf :rtype: SP::PluggedObject :return: a SP::PluggedObject """ return _sicpykernel.FirstOrderNonLinearDS_getPluginF(self)
[docs] def getPluginJacxf(self) -> "SP::PluggedObject": r""" Get _pluginJacxf :rtype: SP::PluggedObject :return: a SP::PluggedObject """ return _sicpykernel.FirstOrderNonLinearDS_getPluginJacxf(self)
[docs] def getPluginM(self) -> "SP::PluggedObject": r""" Get _pluginM :rtype: SP::PluggedObject :return: a SP::PluggedObject """ return _sicpykernel.FirstOrderNonLinearDS_getPluginM(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data of the dynamical system on the standard output""" return _sicpykernel.FirstOrderNonLinearDS_display(self, brief)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderNonLinearDS(self) return weakref.proxy(self)
# Register FirstOrderNonLinearDS in _sicpykernel: _sicpykernel.FirstOrderNonLinearDS_swigregister(FirstOrderNonLinearDS)
[docs] class FirstOrderLinearDS(FirstOrderNonLinearDS): r""" First Order Linear Systems - :math:`M(t) \dot x = A(t)x(t)+ b(t) + r, \quad x(t_0)=x_0`. This class represents first order linear systems of the form: .. math:: M(t) \dot x = A(t)x(t)+ b(t) + r, x(t_0)=x_0 where - :math:`x \in R^{n}` is the state, - :math:`r \in R^{n}` the input due to the Non Smooth Interaction. - :math:`M \in R^{n\times n}` is an invertible matrix - :math:`A \in R^{n\times n}` - :math:`b \in R^{n}` The following operators can be plugged, in the usual way (see User Guide) - :math:`A(t)` - :math:`b(t)` - :math:`M(t)` """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _A = property(_sicpykernel.FirstOrderLinearDS__A_get, _sicpykernel.FirstOrderLinearDS__A_set, doc=r""" matrix specific to the FirstOrderLinearDS :math:`A \in R^{n \times n}`""") _b = property(_sicpykernel.FirstOrderLinearDS__b_get, _sicpykernel.FirstOrderLinearDS__b_set, doc=r""" vector specific to the FirstOrderLinearDS""") _pluginA = property(_sicpykernel.FirstOrderLinearDS__pluginA_get, _sicpykernel.FirstOrderLinearDS__pluginA_set, doc=r""" FirstOrderLinearDS plug-in to compute A(t,z), id = "A" :param time: : current time :param sizeOfA: : size of square-matrix A :param A: : pointer to the first element of A :param size: of vector z :param z: a vector of user-defined parameters """) _pluginb = property(_sicpykernel.FirstOrderLinearDS__pluginb_get, _sicpykernel.FirstOrderLinearDS__pluginb_set, doc=r""" FirstOrderLinearDS plug-in to compute b(t,z), id = "b" :param time: : current time :param sizeOfB: : size of vector b :param b: : pointer to the first element of b :param size: of vector z :param param: : a vector of user-defined parameters """) _hasConstantA = property(_sicpykernel.FirstOrderLinearDS__hasConstantA_get, _sicpykernel.FirstOrderLinearDS__hasConstantA_set, doc=r""" boolean if _A is constant (set thanks to setBPtr for instance) false by default """) _hasConstantB = property(_sicpykernel.FirstOrderLinearDS__hasConstantB_get, _sicpykernel.FirstOrderLinearDS__hasConstantB_set, doc=r""" boolean if _b is constant (set thanks to setBPtr for instance) false by default """) def _zeroPlugin(self) -> "void": r""" Reset all the plugins""" return _sicpykernel.FirstOrderLinearDS__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from initial state and plugins :type newX0: :py:class:`SiconosVector` :param newX0: the initial state of this DynamicalSystem :type APlugin: string :param APlugin: plugin for A :type bPlugin: string :param bPlugin: plugin for b | *Overload 3:* constructor from initial state and plugin for A :type newX0: :py:class:`SiconosVector` :param newX0: the initial state of this DynamicalSystem :type newA: :py:class:`SiconosMatrix` :param newA: matrix A | *Overload 4:* constructor from initial state :type newX0: :py:class:`SiconosVector` :param newX0: the initial state of this DynamicalSystem | *Overload 5:* constructor from a initial state and constant matrices :type newX0: :py:class:`SiconosVector` :param newX0: the initial state of this DynamicalSystem :type newA: :py:class:`SiconosMatrix` :param newA: matrix A :type newB: :py:class:`SiconosVector` :param newB: b | *Overload 6:* Copy constructor :type FOLDS: :py:class:`FirstOrderLinearDS` :param FOLDS: the original FirstOrderLinearDS we want to copy """ if self.__class__ == FirstOrderLinearDS: _self = None else: _self = self _sicpykernel.FirstOrderLinearDS_swiginit(self, _sicpykernel.new_FirstOrderLinearDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderLinearDS
[docs] def initRhs(self, time: "double") -> "void": r""" Initialization function for the rhs and its jacobian. :type time: float :param time: time of initialization. """ return _sicpykernel.FirstOrderLinearDS_initRhs(self, time)
[docs] def computeRhs(self, time: "double") -> "void": r""" update right-hand side for the current state :type time: float :param time: of interest """ return _sicpykernel.FirstOrderLinearDS_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" update :math:`\nabla_x rhs` for the current state :type time: float :param time: of interest """ return _sicpykernel.FirstOrderLinearDS_computeJacobianRhsx(self, time)
[docs] def A(self) -> "SP::SiconosMatrix": r""" get the matrix :math:`A` :rtype: :py:class:`SiconosMatrix` :return: pointer (SP) on a matrix """ return _sicpykernel.FirstOrderLinearDS_A(self)
[docs] def jacobianfx(self) -> "SP::SiconosMatrix": r""" get jacobian of f(x,t,z) with respect to x (pointer link) :rtype: :py:class:`SiconosMatrix` :return: SP::SiconosMatrix """ return _sicpykernel.FirstOrderLinearDS_jacobianfx(self)
[docs] def setAPtr(self, newA: "SP::SiconosMatrix") -> "void": r""" set A to pointer newPtr :type newA: :py:class:`SiconosMatrix` :param newA: the new A matrix """ return _sicpykernel.FirstOrderLinearDS_setAPtr(self, newA)
[docs] def setA(self, newA: "SiconosMatrix") -> "void": r""" set A to a new matrix :type newA: :py:class:`SiconosMatrix` :param newA: the new A matrix """ return _sicpykernel.FirstOrderLinearDS_setA(self, newA)
[docs] def b(self) -> "SP::SiconosVector": r""" get b vector (pointer link) :rtype: :py:class:`SiconosVector` :return: a SP::SiconosVector """ return _sicpykernel.FirstOrderLinearDS_b(self)
[docs] def setbPtr(self, b: "SP::SiconosVector") -> "void": r""" set b vector (pointer link) :type b: :py:class:`SiconosVector` :param b: a SiconosVector """ return _sicpykernel.FirstOrderLinearDS_setbPtr(self, b)
[docs] def setb(self, b: "SiconosVector") -> "void": r""" set b vector (copy) :type b: :py:class:`SiconosVector` :param b: a SiconosVector """ return _sicpykernel.FirstOrderLinearDS_setb(self, b)
def hasConstantA(self) -> "bool": return _sicpykernel.FirstOrderLinearDS_hasConstantA(self) def hasConstantB(self) -> "bool": return _sicpykernel.FirstOrderLinearDS_hasConstantB(self)
[docs] def updatePlugins(self, time: "double") -> "void": r""" Call all plugged-function to initialize plugged-object values :type time: float :param time: value """ return _sicpykernel.FirstOrderLinearDS_updatePlugins(self, time)
[docs] def setComputeAFunction(self, *args) -> "void": r""" *Overload 1:* set a specified function to compute the matrix A => same action as setComputeJacobianfxFunction :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin | *Overload 2:* set a specified function to compute the matrix A :type fct: void :param fct: a pointer on a function """ return _sicpykernel.FirstOrderLinearDS_setComputeAFunction(self, *args)
[docs] def setComputebFunction(self, *args) -> "void": r""" *Overload 1:* set a specified function to compute the vector b :type pluginPath: string :param pluginPath: the complete path to the plugin file :type functionName: string :param functionName: the function name to use in this plugin | *Overload 2:* set a specified function to compute the vector b :type fct: void :param fct: a pointer on a function """ return _sicpykernel.FirstOrderLinearDS_setComputebFunction(self, *args)
def clearComputebFunction(self) -> "void": return _sicpykernel.FirstOrderLinearDS_clearComputebFunction(self)
[docs] def computeA(self, time: "double") -> "void": r""" default function to compute matrix A => same action as computeJacobianfx :type time: float :param time: time instant used to compute A """ return _sicpykernel.FirstOrderLinearDS_computeA(self, time)
[docs] def computeb(self, time: "double") -> "void": r""" default function to compute vector b :type time: float :param time: time instant used to compute b """ return _sicpykernel.FirstOrderLinearDS_computeb(self, time)
[docs] def getPluginA(self) -> "SP::PluggedObject": r""" Get _pluginA :rtype: SP::PluggedObject :return: the plugin for A """ return _sicpykernel.FirstOrderLinearDS_getPluginA(self)
[docs] def getPluginB(self) -> "SP::PluggedObject": r""" Get _pluginb :rtype: SP::PluggedObject :return: the plugin for b """ return _sicpykernel.FirstOrderLinearDS_getPluginB(self)
[docs] def setPluginA(self, newPluginA: "SP::PluggedObject") -> "void": r""" Set _pluginA :type newPluginA: SP::PluggedObject :param newPluginA: the new plugin """ return _sicpykernel.FirstOrderLinearDS_setPluginA(self, newPluginA)
[docs] def setPluginB(self, newPluginB: "SP::PluggedObject") -> "void": r""" Set _pluginb :type newPluginB: SP::PluggedObject :param newPluginB: the new plugin """ return _sicpykernel.FirstOrderLinearDS_setPluginB(self, newPluginB)
[docs] def display(self, brief: "bool"=True) -> "void": r""" data display on screen""" return _sicpykernel.FirstOrderLinearDS_display(self, brief)
[docs] def isLinear(self) -> "bool": r""" True if the system is linear. :rtype: boolean :return: a boolean """ return _sicpykernel.FirstOrderLinearDS_isLinear(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderLinearDS(self) return weakref.proxy(self)
# Register FirstOrderLinearDS in _sicpykernel: _sicpykernel.FirstOrderLinearDS_swigregister(FirstOrderLinearDS)
[docs] class FirstOrderLinearTIDS(FirstOrderLinearDS): r""" First order linear and time-invariant coeff systems - :math:`M \dot x = Ax(t)+ b + r, x(t_0)=x_0` . This class represents first order linear systems of the form: .. math:: M\dot x(t) = A x(t) + b + r, x(t_0)=x_0 where - :math:`x \in R^{n}` is the state, - :math:`r \in R^{n}` the input due to the Non Smooth Interaction. - :math:`M \in R^{n\times n}` is a constant invertible matrix - :math:`A \in R^{n\times n}` - :math:`b \in R^{n}` No plugged operators for this class. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* initial state and constant A matrix :type x0: :py:class:`SiconosVector` :param x0: the initial state vector :type A: :py:class:`SiconosMatrix` :param A: the A matrix | *Overload 2:* initial state, constant A matrix, constant b vector :type x0: :py:class:`SiconosVector` :param x0: the initial state vector :type A: :py:class:`SiconosMatrix` :param A: matrix :type b: :py:class:`SiconosVector` :param b: vector | *Overload 3:* Copy constructor :type FOLTIDS: :py:class:`FirstOrderLinearTIDS` :param FOLTIDS: the FirstOrderLinearTIDS to copy """ if self.__class__ == FirstOrderLinearTIDS: _self = None else: _self = self _sicpykernel.FirstOrderLinearTIDS_swiginit(self, _sicpykernel.new_FirstOrderLinearTIDS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderLinearTIDS
[docs] def initRhs(self, time: "double") -> "void": r""" Initialization function for the rhs and its jacobian. :type time: float :param time: of initialization. """ return _sicpykernel.FirstOrderLinearTIDS_initRhs(self, time)
[docs] def computeRhs(self, time: "double") -> "void": r""" Default function to the right-hand side term :type time: float :param time: current time """ return _sicpykernel.FirstOrderLinearTIDS_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void": r""" Default function to jacobian of the right-hand side term according to x :type time: float :param time: current time """ return _sicpykernel.FirstOrderLinearTIDS_computeJacobianRhsx(self, time)
[docs] def display(self, brief: "bool"=True) -> "void": r""" data display on screen""" return _sicpykernel.FirstOrderLinearTIDS_display(self, brief)
[docs] def updatePlugins(self, time: "double") -> "void": r""" Dumb function, there is no plugin here :type time: float :param time: unused """ return _sicpykernel.FirstOrderLinearTIDS_updatePlugins(self, time)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderLinearTIDS(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" Reset all the plugins""" return _sicpykernel.FirstOrderLinearTIDS__zeroPlugin(self)
# Register FirstOrderLinearTIDS in _sicpykernel: _sicpykernel.FirstOrderLinearTIDS_swigregister(FirstOrderLinearTIDS)
[docs] class Relation(object): r""" General Non Linear Relation (Abstract Base class for Relations). The present class is an interface to all relations and provides tools to define and describe them. A relation is a link between global variables of the Dynamical Systems and some local ones, named y and lambda; belonging to one and only one Interaction. All relations are specified by their type (First order or Lagrangian) accessed by getType() and their sub-type (linear, scleronomous ...), returned by getSubType(). A relation provides functions to compute: - a function computeOutput() that updates y using dynamical systems global variables, - a function computeInput() that updates non-smooth dynamical systems parts (e.g. r or p) using :math:`\lambda` . """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _pluginh = property(_sicpykernel.Relation__pluginh_get, _sicpykernel.Relation__pluginh_set, doc=r""" Plug-in to compute h(...)""") _pluginJachx = property(_sicpykernel.Relation__pluginJachx_get, _sicpykernel.Relation__pluginJachx_set, doc=r""" Plug-in to compute :math:`\nabla_x h(..)`""") _pluginJachz = property(_sicpykernel.Relation__pluginJachz_get, _sicpykernel.Relation__pluginJachz_set, doc=r""" Plug-in to compute :math:`\nabla_z h(..)`""") _pluginJachlambda = property(_sicpykernel.Relation__pluginJachlambda_get, _sicpykernel.Relation__pluginJachlambda_set, doc=r""" Plug-in to compute :math:`\nabla_{\lambda} h(..)`""") _pluging = property(_sicpykernel.Relation__pluging_get, _sicpykernel.Relation__pluging_set, doc=r""" Plug-in to compute g(...)""") _pluginJacglambda = property(_sicpykernel.Relation__pluginJacglambda_get, _sicpykernel.Relation__pluginJacglambda_set, doc=r""" Plug-in to compute :math:`\nabla_\lambda g`""") _pluginJacgx = property(_sicpykernel.Relation__pluginJacgx_get, _sicpykernel.Relation__pluginJacgx_set, doc=r""" Plug-in to compute :math:`\nabla_x g`""") _pluginf = property(_sicpykernel.Relation__pluginf_get, _sicpykernel.Relation__pluginf_set, doc=r""" Plug-in to compute f""") _plugine = property(_sicpykernel.Relation__plugine_get, _sicpykernel.Relation__plugine_set, doc=r""" Plug-in to compute e""") def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.Relation__zeroPlugin(self) _relationType = property(_sicpykernel.Relation__relationType_get, _sicpykernel.Relation__relationType_set, doc=r""" type of the Relation: FirstOrder or Lagrangian""") _subType = property(_sicpykernel.Relation__subType_get, _sicpykernel.Relation__subType_set, doc=r""" sub-type of the Relation (exple: LinearTIR or ScleronomousR ...)""") def __init__(self, *args): if self.__class__ == Relation: _self = None else: _self = self _sicpykernel.Relation_swiginit(self, _sicpykernel.new_Relation(_self, *args)) __swig_destroy__ = _sicpykernel.delete_Relation
[docs] def getType(self) -> "RELATION::TYPES": r""" :rtype: int :return: the type of the Relation (FirstOrder or Lagrangian) """ return _sicpykernel.Relation_getType(self)
[docs] def getSubType(self) -> "RELATION::SUBTYPES": r""" :rtype: int :return: the subType of the Relation """ return _sicpykernel.Relation_getSubType(self)
[docs] def setComputehFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute output function h :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputehFunction(self, pluginPath, functionName)
[docs] def setComputeJachxFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute :math:`\nabla_x h(..)` :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeJachxFunction(self, pluginPath, functionName)
[docs] def setComputeJachzFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute :math:`\nabla_z h(..)` :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeJachzFunction(self, pluginPath, functionName)
[docs] def setComputeJachlambdaFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute :math:`\nabla_{\lambda} h(..)` :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeJachlambdaFunction(self, pluginPath, functionName)
[docs] def setComputegFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute input function g :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputegFunction(self, pluginPath, functionName)
[docs] def setComputeFFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute input function F :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeFFunction(self, pluginPath, functionName)
[docs] def setComputeEFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute input function E :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeEFunction(self, pluginPath, functionName)
[docs] def setComputeJacgxFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute the jacobian of :math:`g` w.r.t. x :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeJacgxFunction(self, pluginPath, functionName)
[docs] def setComputeJacglambdaFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" To set a plug-in function to compute the jacobian of :math:`g` w.r.t. :math:`\lambda` :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.Relation_setComputeJacglambdaFunction(self, pluginPath, functionName)
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.Relation_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.Relation_checkSize(self, inter)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the H Jacobian :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.Relation_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the G Jacobian :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :param interProp: """ return _sicpykernel.Relation_computeJacg(self, time, inter)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" default function to compute y :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :type derivativeNumber: int, optional :param derivativeNumber: number of the derivative to compute (optional, default = 0) """ return _sicpykernel.Relation_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :type level: int, optional :param level: the input "derivative" order of lambda used to compute input """ return _sicpykernel.Relation_computeInput(self, time, inter, level)
def C(self) -> "SP::SimpleMatrix": return _sicpykernel.Relation_C(self) def H(self) -> "SP::SimpleMatrix": return _sicpykernel.Relation_H(self)
[docs] def isLinear(self) -> "bool": r""" return true if the relation is linear. :rtype: boolean :return: bool """ return _sicpykernel.Relation_isLinear(self)
[docs] def requireResidu(self) -> "bool": r""" return true if the relation requires the computation of residu :rtype: boolean :return: true if residu are required, false otherwise """ return _sicpykernel.Relation_requireResidu(self)
[docs] def display(self) -> "void": r""" main relation members display""" return _sicpykernel.Relation_display(self)
[docs] def getPluginh(self) -> "SP::PluggedObject": r""" Get _pluginh :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluginh(self)
[docs] def getPluginJachx(self) -> "SP::PluggedObject": r""" Get _pluginJachx :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluginJachx(self)
[docs] def getPluginJachlambda(self) -> "SP::PluggedObject": r""" Get _pluginJachlambda :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluginJachlambda(self)
[docs] def getPluging(self) -> "SP::PluggedObject": r""" Get _pluging :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluging(self)
[docs] def getPluginJacLg(self) -> "SP::PluggedObject": r""" Get _pluginJacglambda :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluginJacLg(self)
[docs] def getPluginf(self) -> "SP::PluggedObject": r""" Get _pluginf :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPluginf(self)
[docs] def getPlugine(self) -> "SP::PluggedObject": r""" Get _plugine :rtype: SP::PluggedObject :return: a shared pointer to the plugin """ return _sicpykernel.Relation_getPlugine(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_Relation(self) return weakref.proxy(self)
# Register Relation in _sicpykernel: _sicpykernel.Relation_swigregister(Relation)
[docs] class LagrangianR(Relation): r""" Lagrangian Non Linear Relation (generic interface) This class is an interface for specific Lagrangian Relations used for Lagrangian dynamical systems. - :math:`y = h(t,q,\dot q,\ldots)` describes the constraint (the relation) - The Jacobian of the constraints with respect to the coodinates :math:`q` i.e. :math:`\nabla^T_q h(t,q,\dot q,\ldots)` , is accessed with jachq(). This Jacobian is mainly used for Newton linearization and to compute the time-derivative of the constraint, :math:`y = h(q,\ldots)` that is :math:`\dot y (t) = \nabla^T_q h(t,q,\dot q,\ldots) (q) \dot q +\ldots` This object can also store more general linearized part of the gap function. If :math:`y=h(q)` models a gap function, then the time derivative can be generically written as :math:`\dot y (t) = H(q,\ldots) \dot q +\ldots.` The matrix :math:`H(q,\ldots)` can also be accessed using jachq(). - The Jacobian of the constraints with respect to the generalized velocities :math:`\dot q` i.e. :math:`\nabla^\top_{\dot q} h(t,q,\dot q,\ldots)` is accessed using jachqDot(). - The time-derivative of Jacobian of the constraints with respect to the generalized coordinates :math:`q` i.e. :math:`\frac{d}{dt} \nabla^\top_{q} h(t,q,\dot q,\ldots).` , is accessed using dotJachq(). This value is useful to compute the second-order time--derivative of the constraints with respect to time. All these operators can be defined with user-defined plugins. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr z = _sicpykernel.LagrangianR_z q0 = _sicpykernel.LagrangianR_q0 q1 = _sicpykernel.LagrangianR_q1 q2 = _sicpykernel.LagrangianR_q2 p0 = _sicpykernel.LagrangianR_p0 p1 = _sicpykernel.LagrangianR_p1 p2 = _sicpykernel.LagrangianR_p2 DSlinkSize = _sicpykernel.LagrangianR_DSlinkSize _jachlambda = property(_sicpykernel.LagrangianR__jachlambda_get, _sicpykernel.LagrangianR__jachlambda_set, doc=r""" Jacobian matrices of :math:`y = h(t,q,\dot q,\ldots)`""") _jachq = property(_sicpykernel.LagrangianR__jachq_get, _sicpykernel.LagrangianR__jachq_set, doc=r""" The Jacobian of the constraints with respect to the generalized coodinates :math:`q` i.e. :math:`\nabla^\top_q h(t,q,\dot q,\ldots)` """) _jachqDot = property(_sicpykernel.LagrangianR__jachqDot_get, _sicpykernel.LagrangianR__jachqDot_set, doc=r""" The Jacobian of the constraints with respect to the generalized velocities :math:`\dot q` i.e. :math:`\nabla^\top_{\dot q} h(t,q,\dot q,\ldots)` """) _dotjachq = property(_sicpykernel.LagrangianR__dotjachq_get, _sicpykernel.LagrangianR__dotjachq_set, doc=r""" The time-derivative of Jacobian of the constraints with respect to the generalized coordinates :math:`q` i.e. :math:`\frac{d}{dt} \nabla^\top_{ q} h(t,q,\dot q,\ldots).` This value is useful to compute the second-order time--derivative of the constraints with respect to time. """) _pluginJachq = property(_sicpykernel.LagrangianR__pluginJachq_get, _sicpykernel.LagrangianR__pluginJachq_set) def __init__(self, lagType: "RELATION::SUBTYPES"): r""" basic constructor :type lagType: int :param lagType: the sub-type of the relation """ if self.__class__ == LagrangianR: _self = None else: _self = self _sicpykernel.LagrangianR_swiginit(self, _sicpykernel.new_LagrangianR(_self, lagType)) def _zeroPlugin(self) -> "void": return _sicpykernel.LagrangianR__zeroPlugin(self) __swig_destroy__ = _sicpykernel.delete_LagrangianR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.LagrangianR_initialize(self, inter)
[docs] def jachq(self) -> "SP::SimpleMatrix": r""" get a pointer on matrix Jach[index] :rtype: :py:class:`SimpleMatrix` :return: a pointer on a SimpleMatrix """ return _sicpykernel.LagrangianR_jachq(self)
def jachqDot(self) -> "SP::SimpleMatrix": return _sicpykernel.LagrangianR_jachqDot(self) def dotJachq(self) -> "SP::SimpleMatrix": return _sicpykernel.LagrangianR_dotJachq(self) def jachlambda(self) -> "SP::SimpleMatrix": return _sicpykernel.LagrangianR_jachlambda(self)
[docs] def setJachqPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set Jach[index] to pointer newPtr (pointer link) :type newPtr: :py:class:`SimpleMatrix` :param newPtr: the new matrix """ return _sicpykernel.LagrangianR_setJachqPtr(self, newPtr)
def C(self) -> "SP::SimpleMatrix": return _sicpykernel.LagrangianR_C(self) def H(self) -> "SP::SimpleMatrix": return _sicpykernel.LagrangianR_H(self)
[docs] def display(self) -> "void": r""" main relation members display""" return _sicpykernel.LagrangianR_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianR(self) return weakref.proxy(self)
# Register LagrangianR in _sicpykernel: _sicpykernel.LagrangianR_swigregister(LagrangianR)
[docs] class LagrangianLinearTIR(LagrangianR): r""" Lagrangian Linear Relation. Lagrangian Relation with: :math:`y= Cq + e + Fz` :math:`p = C^t \lambda` C is the only required input to built a LagrangianLinearTIR. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _F = property(_sicpykernel.LagrangianLinearTIR__F_get, _sicpykernel.LagrangianLinearTIR__F_set, doc=r""" F matrix, coefficient of z""") _e = property(_sicpykernel.LagrangianLinearTIR__e_get, _sicpykernel.LagrangianLinearTIR__e_set, doc=r""" e""") def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the matrix C | *Overload 3:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the matrix C :type F: :py:class:`SimpleMatrix` :param F: the matrix F :type e: :py:class:`SiconosVector` :param e: the vector e | *Overload 4:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the matrix C :type e: :py:class:`SiconosVector` :param e: the vector e """ if self.__class__ == LagrangianLinearTIR: _self = None else: _self = self _sicpykernel.LagrangianLinearTIR_swiginit(self, _sicpykernel.new_LagrangianLinearTIR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianLinearTIR
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.LagrangianLinearTIR_checkSize(self, inter)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" default function to compute y :type time: float :param time: not used :type inter: :py:class:`Interaction` :param inter: the Interaction we want to update :type derivativeNumber: int, optional :param derivativeNumber: the derivative of y we want to compute """ return _sicpykernel.LagrangianLinearTIR_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r :type time: float :param time: not used :type inter: :py:class:`Interaction` :param inter: the Interaction we want to update :type level: int, optional :param level: the derivative of lambda we want to compute """ return _sicpykernel.LagrangianLinearTIR_computeInput(self, time, inter, level)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the H Jacobian :type time: float :param time: not used :type inter: :py:class:`Interaction` :param inter: the Interaction we want to update :param interProp: interaction properties """ return _sicpykernel.LagrangianLinearTIR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the G Jacobian :type time: float :param time: not used :type inter: :py:class:`Interaction` :param inter: the Interaction we want to update :param interProp: interaction properties """ return _sicpykernel.LagrangianLinearTIR_computeJacg(self, time, inter)
[docs] def C(self) -> "SP::SimpleMatrix": r""" :rtype: :py:class:`SimpleMatrix` :return: pointer on a plugged matrix """ return _sicpykernel.LagrangianLinearTIR_C(self)
[docs] def setCPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set C to pointer newPtr :type newPtr: :py:class:`SimpleMatrix` :param newPtr: a SP to plugged matrix """ return _sicpykernel.LagrangianLinearTIR_setCPtr(self, newPtr)
[docs] def D(self) -> "SP::SimpleMatrix": r""" :rtype: :py:class:`SimpleMatrix` :return: pointer on a plugged matrix """ return _sicpykernel.LagrangianLinearTIR_D(self)
[docs] def setDPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set D to pointer newPtr :type newPtr: :py:class:`SimpleMatrix` :param newPtr: a SP to plugged matrix """ return _sicpykernel.LagrangianLinearTIR_setDPtr(self, newPtr)
[docs] def F(self) -> "SP::SimpleMatrix": r""" :rtype: :py:class:`SimpleMatrix` :return: pointer on a plugged matrix """ return _sicpykernel.LagrangianLinearTIR_F(self)
[docs] def setFPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set F to pointer newPtr :type newPtr: :py:class:`SimpleMatrix` :param newPtr: a SP to plugged matrix """ return _sicpykernel.LagrangianLinearTIR_setFPtr(self, newPtr)
[docs] def e(self) -> "SP::SiconosVector": r""" :rtype: :py:class:`SiconosVector` :return: pointer on a plugged vector """ return _sicpykernel.LagrangianLinearTIR_e(self)
[docs] def setEPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set e to pointer newPtr :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP to plugged vector """ return _sicpykernel.LagrangianLinearTIR_setEPtr(self, newPtr)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.LagrangianLinearTIR_display(self)
[docs] def isLinear(self) -> "bool": r""" :rtype: boolean :return: true if the relation is linear. """ return _sicpykernel.LagrangianLinearTIR_isLinear(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianLinearTIR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": return _sicpykernel.LagrangianLinearTIR__zeroPlugin(self)
# Register LagrangianLinearTIR in _sicpykernel: _sicpykernel.LagrangianLinearTIR_swigregister(LagrangianLinearTIR)
[docs] class LagrangianRheonomousR(LagrangianR): r""" Lagrangian (Non Linear) Rheonomous Relation This class provides tools to describe non linear relation of the type: .. math:: y = h(q,t,z) \\ \dot y = \nabla^\top_q(q,t,z)\dot q + \frac{\partial }{\partial t}h(q,t,z) \\ or more generally .. math:: \dot y = H(q,t,z)\dot q + \frac{\partial }{\partial t}h(q,t,z) and by duality .. math:: p = H^\top(q,t,z)\lambda The following operators (and their jacobians) can be plugged, in the usual way (see User Guide, 'User-defined plugins') - :math:`h(q,t,z)` - :math:`\nabla_q h(q,t,z)` - :math:`\dot h(q,t,z)` The plugin functions must fit with the following signature (FPtr4): void func(unsigned int qsize, double* q, double time, unsigned int ysize, double* buffer , unsigned int sizez, double* z) buffer being either :math:`y` , :math:`\dot h` or :math:`\nabla_qh` . """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _hDot = property(_sicpykernel.LagrangianRheonomousR__hDot_get, _sicpykernel.LagrangianRheonomousR__hDot_set, doc=r""" plugged vector used to compute hDot""") _pluginhDot = property(_sicpykernel.LagrangianRheonomousR__pluginhDot_get, _sicpykernel.LagrangianRheonomousR__pluginhDot_set, doc=r""" LagrangianRheonomousR plug-in to compute hDot(q,t,z)""") def _zeroPlugin(self) -> "void": r""" reset all plugins""" return _sicpykernel.LagrangianRheonomousR__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from a set of data :type pluginh: string :param pluginh: name of the plugin to compute h. Its signature must be "void userPluginH(unsigned int, double*, double, unsigned int, double*, unsigned int, double*)" :type pluginJacobianhq: string :param pluginJacobianhq: name of the plugin to compute jacobian h according to q. Its signature must be "void userPluginG0(unsigned int, double*, double, unsigned int, double*, unsigned int, double*)" :type pluginDoth: string :param pluginDoth: name of the plugin to compute hDot. Its signature must be "void userPluginHDot(unsigned int, double*,double, unsigned int, double*, unsigned int, double*) """ if self.__class__ == LagrangianRheonomousR: _self = None else: _self = self _sicpykernel.LagrangianRheonomousR_swiginit(self, _sicpykernel.new_LagrangianRheonomousR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianRheonomousR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize G matrices or components specific to derived classes. :type inter: :py:class:`Interaction` :param inter: the Interaction """ return _sicpykernel.LagrangianRheonomousR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.LagrangianRheonomousR_checkSize(self, inter)
[docs] def hDot(self) -> "SP::SiconosVector": r""" get a pointer on vector hDot :rtype: :py:class:`SiconosVector` :return: a smart pointer on a SiconosVector """ return _sicpykernel.LagrangianRheonomousR_hDot(self)
[docs] def setComputehDotFunction(self, pluginpath: "std::string const &", name: "std::string const &") -> "void": r""" to set a specified function to compute function hDot :type pluginpath: string :param pluginpath: the complete path to the plugin :type name: string :param name: the name of the function to use in this plugin """ return _sicpykernel.LagrangianRheonomousR_setComputehDotFunction(self, pluginpath, name)
[docs] def computeh(self, time: "double", q: "BlockVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,q,z) of the Relation :type time: float :param time: current time value :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.LagrangianRheonomousR_computeh(self, time, q, z, y)
[docs] def computehDot(self, time: "double", q: "BlockVector", z: "BlockVector") -> "void": r""" to compute the time-derivative of the output y = h(t,q,z), saved in attribute _hDot (access: hDot()) :type time: float :param time: current time value :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) """ return _sicpykernel.LagrangianRheonomousR_computehDot(self, time, q, z)
[docs] def computeJachq(self, time: "double", q: "BlockVector", z: "BlockVector") -> "void": r""" to compute the jacobian of h(...). Set attribute _jachq (access: jacqhq()) :type time: float :param time: current time value :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) """ return _sicpykernel.LagrangianRheonomousR_computeJachq(self, time, q, z)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the H Jacobian""" return _sicpykernel.LagrangianRheonomousR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the G Jacobian""" return _sicpykernel.LagrangianRheonomousR_computeJacg(self, time, inter)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" to compute output :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the Interaction :type derivativeNumber: int, optional :param derivativeNumber: number of the derivative to compute, optional, default = 0. """ return _sicpykernel.LagrangianRheonomousR_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" to compute p :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the Interaction :type level: int, optional :param level: "derivative" order of lambda used to compute input """ return _sicpykernel.LagrangianRheonomousR_computeInput(self, time, inter, level)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianRheonomousR(self) return weakref.proxy(self)
# Register LagrangianRheonomousR in _sicpykernel: _sicpykernel.LagrangianRheonomousR_swigregister(LagrangianRheonomousR)
[docs] class LagrangianScleronomousR(LagrangianR): r""" Scleronomic Lagrangian (Non Linear) Relations .. math:: y = h(q,z) .. math:: \dot y = \nabla^\top_q h(q,z) \dot q or more generally .. math:: \dot y = H(q,z) \dot q and by duality .. math:: p = \nabla_q h(q,z)\lambda or more generally .. math:: p = H^\top(q,z)\lambda with .. math:: H^\top(q,z) = \nabla_q h(q,z) is the pure Lagrangian setting. y (or its discrete approximation) is stored in y[0] :math:`\dot y` (or its discrete approximation) is stored in y[1] higher level y[i] can be used for storing higher levels of derivatives. Jacobians and h are connected to plug-in functions. The plugin function to compute h(q,z) needs the following parameters: --> sizeQ: size of q = sum of the sizes of all the DynamicalSystems involved in the interaction --> q : pointer to the first element of q --> sizeY : size of vector y (ie of the interaction) --> [in,out] y : pointer to the first element of y --> sizeZ : size of vector z --> [in,out] z: pointer to z vector(s) from DS. Its signature must be "void plugin(unsigned int, double*, unsigned int, double*, unsigned int, double*)" The plugin function to compute G0(q,z), gradient of h according to q, needs the following parameters: --> sizeQ: size of q = sum of the sizes of all the DynamicalSystems involved in the interaction --> q : pointer to the first element of q --> sizeY : size of vector y (ie of the intercation) --> [in,out] H : pointer to the first element of H (sizeY X sizeDS matrix) --> sizeZ : size of vector z -->[in,out] z: pointer to z vector(s) from DS. Its signature must be "void plugin(unsigned int, double*, unsigned int, double*, unsigned int, double*)" """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _plugindotjacqh = property(_sicpykernel.LagrangianScleronomousR__plugindotjacqh_get, _sicpykernel.LagrangianScleronomousR__plugindotjacqh_set, doc=r""" Plugin object for the time--derivative of Jacobian i.e. :math:`\frac{d}{dt} \nabla^T_{q} h(t,q,\dot q,\ldots).` stored in _dotjachq """) _dotjacqhXqdot = property(_sicpykernel.LagrangianScleronomousR__dotjacqhXqdot_get, _sicpykernel.LagrangianScleronomousR__dotjacqhXqdot_set, doc=r""" Product of the time--derivative of Jacobian with the velocity qdot""") def _zeroPlugin(self) -> "void": r""" reset all plugins""" return _sicpykernel.LagrangianScleronomousR__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* basic constructor | *Overload 2:* constructor from a set of data :type pluginh: string :param pluginh: the name of the plugin to compute h(q,z). The signature of the plugged function must be: "void pluginH(unsigned int, double*, unsigned int, double*, unsigned int, double*)" :type pluginJacobianhq: string :param pluginJacobianhq: the name of the plugin to compute jacobian h according to q. The signature of the plugged function must be: "void pluginG0(unsigned int, double*, unsigned int, double*, unsigned int, double*)" | *Overload 3:* constructor from a set of data used for EventDriven Scheme :type pluginh: string :param pluginh: the name of the plugin to compute h(q,z). The signature of the plugged function must be: "void pluginH(unsigned int, double*, unsigned int, double*, unsigned int, double*)" :type pluginJacobianhq: string :param pluginJacobianhq: the name of the plugin to compute jacobian h according to q. The signature of the plugged function must be: "void pluginG0(unsigned int, double*, unsigned int, double*, unsigned int, double*)" :type pluginDotJacobianhq: string :param pluginDotJacobianhq: the name of the plugin to compute the derivative of H Jacobian with respect to time The signature of the plugged function must be: "void pluginS0(unsigned int, double*,unsigned int, double*, unsigned int, double*, unsigned int, double*)" """ if self.__class__ == LagrangianScleronomousR: _self = None else: _self = self _sicpykernel.LagrangianScleronomousR_swiginit(self, _sicpykernel.new_LagrangianScleronomousR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianScleronomousR
[docs] def initialize(self, inter: "Interaction") -> "void": return _sicpykernel.LagrangianScleronomousR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.LagrangianScleronomousR_checkSize(self, inter)
[docs] def dotjacqhXqdot(self) -> "SP::SiconosVector": r""" :rtype: :py:class:`SiconosVector` :return: the product of the time--derivative of Jacobian with the velocity qdot """ return _sicpykernel.LagrangianScleronomousR_dotjacqhXqdot(self)
[docs] def computeh(self, q: "BlockVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(q,z) of the Relation :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.LagrangianScleronomousR_computeh(self, q, z, y)
[docs] def computeJachq(self, q: "BlockVector", z: "BlockVector") -> "void": r""" to compute the jacobian of h(...). Set attribute _jachq (access: jacqhq()) :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) """ return _sicpykernel.LagrangianScleronomousR_computeJachq(self, q, z)
[docs] def computeDotJachq(self, q: "BlockVector", z: "BlockVector", qDot: "BlockVector") -> "void": r""" to compute the time derivative of the Jacobian. Result in _dotjachq (access: dotjachq()) :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :param time: derivatives of q """ return _sicpykernel.LagrangianScleronomousR_computeDotJachq(self, q, z, qDot)
[docs] def computedotjacqhXqdot(self, time: "double", inter: "Interaction", DSlink: "VectorOfBlockVectors") -> "void": r""" to compute the product of the time--derivative of Jacobian with the velocity qdot :type time: float :param time: double, current time :type inter: :py:class:`Interaction` :param inter: interaction :type DSlink: :py:class:`VectorOfBlockVectors` :param DSlink: """ return _sicpykernel.LagrangianScleronomousR_computedotjacqhXqdot(self, time, inter, DSlink)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the H Jacobian :type time: float :param time: double, current time :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :param interProp: """ return _sicpykernel.LagrangianScleronomousR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the G Jacobian :type time: float :param time: double, current time :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :param interProp: """ return _sicpykernel.LagrangianScleronomousR_computeJacg(self, time, inter)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" to compute output :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type derivativeNumber: int, optional :param derivativeNumber: number of the derivative to compute, optional, default = 0. """ return _sicpykernel.LagrangianScleronomousR_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" to compute p :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type level: int, optional :param level: "derivative" order of lambda used to compute input """ return _sicpykernel.LagrangianScleronomousR_computeInput(self, time, inter, level)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianScleronomousR(self) return weakref.proxy(self)
# Register LagrangianScleronomousR in _sicpykernel: _sicpykernel.LagrangianScleronomousR_swigregister(LagrangianScleronomousR)
[docs] class LagrangianCompliantR(LagrangianR): r""" Lagrangian Compliant Relation: Scleronomous, Non-Holonomic (function of lambda) :math:`Y[0] = y = h(q,\lambda(t),z)` :math:`Y[1] = \dot y = G0(q,\lambda(t),z)\dot q + G1((q,\lambda(t),z)\dot\lambda(t)` :math:`p = G0^t(q,\lambda(t),z)\lambda(t)` with :math:`G0(q,\lambda(t),z) = \nabla_q h(q,\lambda(t),z)` :math:`G1(q,\lambda(t),z) = \nabla_{\lambda}h(q,\lambda(t),z)` h, G0 and G1 are connected to user-defined functions. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _pluginJachlambda = property(_sicpykernel.LagrangianCompliantR__pluginJachlambda_get, _sicpykernel.LagrangianCompliantR__pluginJachlambda_set, doc=r""" LagrangianR plug-in to compute h(q,lambda,z) :param sizeDS: : sum of the sizes of all the DynamicalSystems involved in the interaction :param q: : pointer to the first element of q :param sizeY: : size of vector y (ie of lambda and of the interaction) :param lambda: : pointer to lambda of the interaction :param y: : pointer to the first element of y :param sizeZ: : size of vector z. :param z: : a vector of user-defined parameters """)
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize G matrices or components specific to derived classes :type inter: :py:class:`Interaction` :param inter: : the Interaction """ return _sicpykernel.LagrangianCompliantR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.LagrangianCompliantR_checkSize(self, inter)
def _zeroPlugin(self) -> "void": return _sicpykernel.LagrangianCompliantR__zeroPlugin(self) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from a set of data :type pluginh: string :param pluginh: the name of the plugin to compute h :type pluginJacobianhq: string :param pluginJacobianhq: the name of the plugin to compute the gradient of h w.r.t q :type pluginJacobianhlambda: string :param pluginJacobianhlambda: the name of the plugin to compute the gradient of h w.r.t :math:`\lambda` """ if self.__class__ == LagrangianCompliantR: _self = None else: _self = self _sicpykernel.LagrangianCompliantR_swiginit(self, _sicpykernel.new_LagrangianCompliantR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LagrangianCompliantR
[docs] def computeh(self, time: "double", q: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(q,z) of the Relation :type time: float :param time: current time value :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.LagrangianCompliantR_computeh(self, time, q, lambda_, z, y)
[docs] def computeJachq(self, time: "double", q: "BlockVector", lambda_: "SiconosVector", z: "BlockVector") -> "void": r""" to compute the jacobian of h(...). Set attribute _jachq (access: jacqhq()) :type time: float :param time: current time value :type q: :py:class:`BlockVector` :param q: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) """ return _sicpykernel.LagrangianCompliantR_computeJachq(self, time, q, lambda_, z)
[docs] def computeJachlambda(self, time: "double", q0: "BlockVector", lambda_: "SiconosVector", z: "BlockVector") -> "void": r""" compute the jacobian of h w.r.t. :math:`\lambda` . Set attribute _jachlambda (access: jacqhlambda()) :type time: float :param time: current time value :param q: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters """ return _sicpykernel.LagrangianCompliantR_computeJachlambda(self, time, q0, lambda_, z)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" to compute output :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the Interaction owning y :type derivativeNumber: int, optional :param derivativeNumber: the number of the derivative to compute, optional, default = 0. """ return _sicpykernel.LagrangianCompliantR_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" to compute the input :type time: float :param time: the current time :type inter: :py:class:`Interaction` :param inter: the Interaction owning lambda :type level: int, optional :param level: "derivative" order of lambda used to compute input """ return _sicpykernel.LagrangianCompliantR_computeInput(self, time, inter, level)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the H Jacobian""" return _sicpykernel.LagrangianCompliantR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the G Jacobian""" return _sicpykernel.LagrangianCompliantR_computeJacg(self, time, inter)
def __disown__(self): self.this.disown() _sicpykernel.disown_LagrangianCompliantR(self) return weakref.proxy(self)
# Register LagrangianCompliantR in _sicpykernel: _sicpykernel.LagrangianCompliantR_swigregister(LagrangianCompliantR)
[docs] class NewtonEulerR(Relation): r""" NewtonEuler (Non Linear) Relation (generic interface) Relations for NewtonEuler Dynamical Systems. This class is only an interface for specific (Linear, Scleronomous ...) NewtonEuler Relations (see derived classes). Class name = type+subType. If y = h(...), all the gradients of are handled by G object. For example, G[0] = :math:`\nabla_q h(q,...)`. In corresponding derived classes, h and Gi are connected to plug-in functions (user-defined). For more details, see the DevNotes.pdf, chapter NewtonEuler. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr z = _sicpykernel.NewtonEulerR_z q0 = _sicpykernel.NewtonEulerR_q0 velocity = _sicpykernel.NewtonEulerR_velocity dotq = _sicpykernel.NewtonEulerR_dotq p0 = _sicpykernel.NewtonEulerR_p0 p1 = _sicpykernel.NewtonEulerR_p1 p2 = _sicpykernel.NewtonEulerR_p2 DSlinkSize = _sicpykernel.NewtonEulerR_DSlinkSize _jachq = property(_sicpykernel.NewtonEulerR__jachq_get, _sicpykernel.NewtonEulerR__jachq_set, doc=r""" The Jacobian of the constraints with respect to the generalized coodinates :math:`q` i.e... math:: \nabla^T_q h(t,q,\dot q,\ldots) """) _jachqDot = property(_sicpykernel.NewtonEulerR__jachqDot_get, _sicpykernel.NewtonEulerR__jachqDot_set, doc=r""" The Jacobian of the constraints with respect to the generalized velocities :math:`\dot q` i.e... math:: \nabla^T_{\dot q} h(t,q,\dot q,\ldots) """) _dotjachq = property(_sicpykernel.NewtonEulerR__dotjachq_get, _sicpykernel.NewtonEulerR__dotjachq_set, doc=r""" The time-derivative of Jacobian of the constraints with respect to the generalized coordinates :math:`q` i.e... math:: \frac{d}{dt} \nabla^T_{q} h(t,q,\dot q,\ldots). This value is useful to compute the second-order time--derivative of the constraints with respect to time. """) _jachlambda = property(_sicpykernel.NewtonEulerR__jachlambda_get, _sicpykernel.NewtonEulerR__jachlambda_set) _jacglambda = property(_sicpykernel.NewtonEulerR__jacglambda_get, _sicpykernel.NewtonEulerR__jacglambda_set) _e = property(_sicpykernel.NewtonEulerR__e_get, _sicpykernel.NewtonEulerR__e_set, doc=r""" vector e""") _contactForce = property(_sicpykernel.NewtonEulerR__contactForce_get, _sicpykernel.NewtonEulerR__contactForce_set, doc=r""" vector of contact forces, ie: _contactForce = B lambda. Useful for the end user.""") _jachqT = property(_sicpykernel.NewtonEulerR__jachqT_get, _sicpykernel.NewtonEulerR__jachqT_set, doc=r""" updated in computeJachqT: In the case of the bilateral constrains, it is _jachq._T. In the case of a local frame, _jachqT is built from the geometrical datas(local frame, point of contact). """) _T = property(_sicpykernel.NewtonEulerR__T_get, _sicpykernel.NewtonEulerR__T_set, doc=r""" local storage of _T as working vector to compute JachqT from q""") def __init__(self, *args): r""" *Overload 1:* basic constructor :type lagType: int :param lagType: the sub-type of the relation | *Overload 2:* Default constructor """ if self.__class__ == NewtonEulerR: _self = None else: _self = self _sicpykernel.NewtonEulerR_swiginit(self, _sicpykernel.new_NewtonEulerR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_NewtonEulerR
[docs] def jachq(self) -> "SP::SimpleMatrix": r""" get a pointer on matrix Jach[index] :rtype: :py:class:`SimpleMatrix` :return: a pointer on a SimpleMatrix """ return _sicpykernel.NewtonEulerR_jachq(self)
def setJachq(self, newJachq: "SP::SimpleMatrix") -> "void": return _sicpykernel.NewtonEulerR_setJachq(self, newJachq) def jachqDot(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_jachqDot(self) def dotJachq(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_dotJachq(self) def secondOrderTimeDerivativeTerms(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEulerR_secondOrderTimeDerivativeTerms(self) def jachlambda(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_jachlambda(self) def jacglambda(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_jacglambda(self) def setE(self, newE: "SP::SiconosVector") -> "void": return _sicpykernel.NewtonEulerR_setE(self, newE) def jachqT(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_jachqT(self) def setJachqT(self, newJachqT: "SP::SimpleMatrix") -> "void": return _sicpykernel.NewtonEulerR_setJachqT(self, newJachqT) def H(self) -> "SP::SimpleMatrix": return _sicpykernel.NewtonEulerR_H(self)
[docs] def setJachqPtr(self, newPtr: "SP::SimpleMatrix") -> "void": r""" set Jach[index] to pointer newPtr (pointer link) :type newPtr: :py:class:`SimpleMatrix` :param newPtr: the new matrix """ return _sicpykernel.NewtonEulerR_setJachqPtr(self, newPtr)
_plugindotjacqh = property(_sicpykernel.NewtonEulerR__plugindotjacqh_get, _sicpykernel.NewtonEulerR__plugindotjacqh_set, doc=r""" Plugin object for the time--derivative of Jacobian i.e. :math:`\frac{d}{dt} \nabla^T_{q} h(t,q,\dot q,\ldots)` stored in _dotjachq """) _secondOrderTimeDerivativeTerms = property(_sicpykernel.NewtonEulerR__secondOrderTimeDerivativeTerms_get, _sicpykernel.NewtonEulerR__secondOrderTimeDerivativeTerms_set, doc=r""" the additional terms of the second order time derivative of y :math:`\nabla_q h(q) \dot T v + \frac{d}{dt}(\nabla_q h(q) ) T v` """)
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize components specific to derived classes. :type inter: :py:class:`Interaction` :param inter: Interaction associated with the Relation """ return _sicpykernel.NewtonEulerR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.NewtonEulerR_checkSize(self, inter)
[docs] def computeh(self, time: "double", q0: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,q,z) of the Relation :type time: float :param time: current time value :param q: coordinates of the dynamical systems involved in the relation :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.NewtonEulerR_computeh(self, time, q0, y)
[docs] def computeJachlambda(self, time: "double", inter: "Interaction") -> "void": r""" default function to compute jacobianH :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJachlambda(self, time, inter)
[docs] def computeJachq(self, time: "double", inter: "Interaction", q0: "SP::BlockVector") -> "void": r""" compute the jacobian of h w.r.t. q :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :type q0: :py:class:`BlockVector` :param q0: the container of the block vector to the dynamical system """ return _sicpykernel.NewtonEulerR_computeJachq(self, time, inter, q0)
[docs] def computeJachqDot(self, time: "double", inter: "Interaction") -> "void": r""" compute the jacobian of h w.r.t. :math:`\dot{q}` :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJachqDot(self, time, inter)
def computeDotJachq(self, time: "double", workQ: "BlockVector", workZ: "BlockVector", workQdot: "BlockVector") -> "void": return _sicpykernel.NewtonEulerR_computeDotJachq(self, time, workQ, workZ, workQdot)
[docs] def computeJacglambda(self, time: "double", inter: "Interaction") -> "void": r""" compute the jacobian of h w.r.t. :math:`\dot{q}` :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJacglambda(self, time, inter)
[docs] def computeJacgq(self, time: "double", inter: "Interaction") -> "void": r""" compute the jacobian of h w.r.t. :math:`\dot{q}` :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJacgq(self, time, inter)
[docs] def computeJacgqDot(self, time: "double", inter: "Interaction") -> "void": r""" compute the jacobian of h w.r.t. :math:`\dot{q}` :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJacgqDot(self, time, inter)
[docs] def computeJachqT(self, inter: "Interaction", q0: "SP::BlockVector") -> "void": r""" default implementation consists in multiplying jachq and T in this implementation we use _T which is consitent which directly computed with computeT(q) when q is given this one in more consistent with the notion of function of q :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type q0: :py:class:`BlockVector` :param q0: the block vector to the dynamical system position """ return _sicpykernel.NewtonEulerR_computeJachqT(self, inter, q0)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": r""" compute all the jacobian of h :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": r""" compute all the jacobian of g :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEulerR_computeJacg(self, time, inter)
[docs] def computeSecondOrderTimeDerivativeTerms(self, time: "double", inter: "Interaction", DSlink: "VectorOfBlockVectors", ds1: "SP::DynamicalSystem", ds2: "SP::DynamicalSystem") -> "void": r""" To compute the terms of the second order time derivative of y :math:`\nabla_q h(q) \dot T v + \frac{d}{dt}(\nabla_q h(q) ) T v` :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type DSlink: :py:class:`VectorOfBlockVectors` :param DSlink: the container of the link to DynamicalSystem attributes :type ds1: :py:class:`DynamicalSystem` :param ds1: dynamical system linked to this interaction (source) :type ds2: :py:class:`DynamicalSystem` :param ds2: second ds linked to this interaction (target). If there is only one ds in the inter, call this function with ..., ds, ds) """ return _sicpykernel.NewtonEulerR_computeSecondOrderTimeDerivativeTerms(self, time, inter, DSlink, ds1, ds2)
[docs] def computeOutput(self, time: "double", inter: "Interaction", derivativeNumber: "unsigned int"=0) -> "void": r""" to compute output :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :type derivativeNumber: int, optional :param derivativeNumber: number of the derivative to compute, optional, default = 0. """ return _sicpykernel.NewtonEulerR_computeOutput(self, time, inter, derivativeNumber)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" to compute the input :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: the interaction using this relation :type level: int, optional :param level: number of the derivative to compute, optional, default = 0. """ return _sicpykernel.NewtonEulerR_computeInput(self, time, inter, level)
[docs] def C(self) -> "SP::SimpleMatrix": r""" return a SP on the C matrix. The matrix C in the linear case, else it returns Jacobian of the output with respect to x. """ return _sicpykernel.NewtonEulerR_C(self)
[docs] def D(self) -> "SP::SimpleMatrix": r""" return a SP on the D matrix. The matrix D in the linear case, else it returns Jacobian of the output with respect to lambda. """ return _sicpykernel.NewtonEulerR_D(self)
[docs] def B(self) -> "SP::SimpleMatrix": r""" return a SP on the B matrix. The matrix B in the linear case, else it returns Jacobian of the input with respect to lambda. """ return _sicpykernel.NewtonEulerR_B(self)
[docs] def contactForce(self) -> "SP::SiconosVector": r""" A buffer containing the forces due to this. It is an output unused for the computation. Fix : is it usefull ? :rtype: :py:class:`SiconosVector` :return: SP::SiconosVector """ return _sicpykernel.NewtonEulerR_contactForce(self)
[docs] def display(self) -> "void": return _sicpykernel.NewtonEulerR_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonEulerR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.NewtonEulerR__zeroPlugin(self)
# Register NewtonEulerR in _sicpykernel: _sicpykernel.NewtonEulerR_swigregister(NewtonEulerR)
[docs] class NewtonEuler1DR(NewtonEulerR): r""" This class is an interface for a relation with impact. It implements the computation of the jacoboian of h from the points of contacts and the normal. Use this class consists in overloading the method computeh, by setting the member pc1, pc2, nc and y. The matrix jachq is used both for the building of the OSNSP (with T) and for the predictor of activation of deactivation of the Interaction. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _Pc1 = property(_sicpykernel.NewtonEuler1DR__Pc1_get, _sicpykernel.NewtonEuler1DR__Pc1_set, doc=r""" Current Contact Points, may be updated within Newton loop based on _relPc1, _relPc2. """) _Pc2 = property(_sicpykernel.NewtonEuler1DR__Pc2_get, _sicpykernel.NewtonEuler1DR__Pc2_set) _relPc1 = property(_sicpykernel.NewtonEuler1DR__relPc1_get, _sicpykernel.NewtonEuler1DR__relPc1_set, doc=r""" Contact Points in coordinates relative to attached DS->q. Set these if _Pc1/_Pc2 are not calculated within the Newton loop. """) _relPc2 = property(_sicpykernel.NewtonEuler1DR__relPc2_get, _sicpykernel.NewtonEuler1DR__relPc2_set) _Nc = property(_sicpykernel.NewtonEuler1DR__Nc_get, _sicpykernel.NewtonEuler1DR__Nc_set, doc=r""" Inward Normal at the contact. TODO: The meaning of "Inward" has to be explained carefully. """) _relNc = property(_sicpykernel.NewtonEuler1DR__relNc_get, _sicpykernel.NewtonEuler1DR__relNc_set, doc=r""" _Nc must be calculated relative to q2""") _rotationAbsoluteToContactFrame = property(_sicpykernel.NewtonEuler1DR__rotationAbsoluteToContactFrame_get, _sicpykernel.NewtonEuler1DR__rotationAbsoluteToContactFrame_set, doc=r""" Rotation matrix converting the absolute coordinate to the contact frame coordinate. This matrix contains the unit vector(s)of the contact frame in row. """) _rotationBodyToAbsoluteFrame = property(_sicpykernel.NewtonEuler1DR__rotationBodyToAbsoluteFrame_get, _sicpykernel.NewtonEuler1DR__rotationBodyToAbsoluteFrame_set, doc=r""" Matrix converting""") _NPG1 = property(_sicpykernel.NewtonEuler1DR__NPG1_get, _sicpykernel.NewtonEuler1DR__NPG1_set, doc=r""" Cross product matrices that correspond the lever arm from contact point to center of mass """) _NPG2 = property(_sicpykernel.NewtonEuler1DR__NPG2_get, _sicpykernel.NewtonEuler1DR__NPG2_set) _AUX1 = property(_sicpykernel.NewtonEuler1DR__AUX1_get, _sicpykernel.NewtonEuler1DR__AUX1_set) _AUX2 = property(_sicpykernel.NewtonEuler1DR__AUX2_get, _sicpykernel.NewtonEuler1DR__AUX2_set)
[docs] def setpc1(self, npc: "SP::SiconosVector") -> "void": r""" Set the coordinates of first contact point. Must only be done in a computeh() override. :type npc: :py:class:`SiconosVector` :param npc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setpc1(self, npc)
[docs] def setpc2(self, npc: "SP::SiconosVector") -> "void": r""" Set the coordinates of second contact point. Must only be done in a computeh() override. :type npc: :py:class:`SiconosVector` :param npc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setpc2(self, npc)
[docs] def setnc(self, nnc: "SP::SiconosVector") -> "void": r""" Set the coordinates of inside normal vector at the contact point. Must only be done in a computeh() override. :type nnc: :py:class:`SiconosVector` :param nnc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setnc(self, nnc)
_isOnContact = property(_sicpykernel.NewtonEuler1DR__isOnContact_get, _sicpykernel.NewtonEuler1DR__isOnContact_set, doc=r""" V.A. boolean _isOnCOntact ?? Why is it public members ? seems parametrize the projection algorithm the projection is done on the surface :math:`y=0` or on :math:`y \geq 0` """) def __init__(self): r""" constructor""" if self.__class__ == NewtonEuler1DR: _self = None else: _self = self _sicpykernel.NewtonEuler1DR_swiginit(self, _sicpykernel.new_NewtonEuler1DR(_self, )) __swig_destroy__ = _sicpykernel.delete_NewtonEuler1DR
[docs] def computeJachq(self, time: "double", inter: "Interaction", q0: "SP::BlockVector") -> "void": return _sicpykernel.NewtonEuler1DR_computeJachq(self, time, inter, q0)
[docs] def initialize(self, inter: "Interaction") -> "void": return _sicpykernel.NewtonEuler1DR_initialize(self, inter)
[docs] def computeJachqT(self, inter: "Interaction", q0: "SP::BlockVector") -> "void": r""" Default implementation consists in multiplying jachq and T (see NewtonEulerR::computeJachqT) but here we compute the operator from the the contact point locations and the local frame at contact :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type q0: :py:class:`BlockVector` :param q0: the block vector to the dynamical system position """ return _sicpykernel.NewtonEuler1DR_computeJachqT(self, inter, q0)
[docs] def computeh(self, time: "double", q0: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,q,z) of the Relation :type time: float :param time: current time value :param q: coordinates of the dynamical systems involved in the relation :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.NewtonEuler1DR_computeh(self, time, q0, y)
[docs] def computehFromRelativeContactPoints(self, time: "double", q0: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,q,z) of the Relation with the relative contact points :type time: float :param time: current time value :param q: coordinates of the dynamical systems involved in the relation :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.NewtonEuler1DR_computehFromRelativeContactPoints(self, time, q0, y)
[docs] def distance(self) -> "double": r""" Return the distance between pc1 and pc, with sign according to normal""" return _sicpykernel.NewtonEuler1DR_distance(self)
def pc1(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_pc1(self) def pc2(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_pc2(self) def nc(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_nc(self) def relPc1(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_relPc1(self) def relPc2(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_relPc2(self) def relNc(self) -> "SP::SiconosVector": return _sicpykernel.NewtonEuler1DR_relNc(self)
[docs] def setRelPc1(self, npc: "SP::SiconosVector") -> "void": r""" Set the coordinates of first contact point in ds1 frame. It will be used to compute _Pc1 during computeh(). :type npc: :py:class:`SiconosVector` :param npc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setRelPc1(self, npc)
[docs] def setRelPc2(self, npc: "SP::SiconosVector") -> "void": r""" Set the coordinates of second contact point in ds2 frame It will be used to compute _Pc2 during computeh(). :type npc: :py:class:`SiconosVector` :param npc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setRelPc2(self, npc)
[docs] def setRelNc(self, nnc: "SP::SiconosVector") -> "void": r""" Set the coordinates of inside normal vector at the contact point in ds2 frame. It will be used to compute _Nc during computeh(). :type nnc: :py:class:`SiconosVector` :param nnc: new coordinates """ return _sicpykernel.NewtonEuler1DR_setRelNc(self, nnc)
[docs] def display(self) -> "void": return _sicpykernel.NewtonEuler1DR_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonEuler1DR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.NewtonEuler1DR__zeroPlugin(self)
# Register NewtonEuler1DR in _sicpykernel: _sicpykernel.NewtonEuler1DR_swigregister(NewtonEuler1DR)
[docs] class NewtonEuler3DR(NewtonEuler1DR): r""" This class is an interface for relation with impact and FC3D. From NewtonEuler1DR, it inherits to the computation of the jacobian, this operator is use for the predictor of activation and deactivation of the Interaction. The OSNSP is build using the matrix jachqT, that is computed from the point if contact pc1, pc2 and Nc. Use this class consists in overload the method computeh, and children class has to set the menber pc1, pc2 and nc. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): if self.__class__ == NewtonEuler3DR: _self = None else: _self = self _sicpykernel.NewtonEuler3DR_swiginit(self, _sicpykernel.new_NewtonEuler3DR(_self, )) __swig_destroy__ = _sicpykernel.delete_NewtonEuler3DR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize components specific to derived classes. :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEuler3DR_initialize(self, inter)
[docs] def computeJachqT(self, inter: "Interaction", q0: "SP::BlockVector") -> "void": r""" Default implementation consists in multiplying jachq and T (see NewtonEulerR::computeJachqT) but here we compute the operator from the the contact point locations and the local frame at contact :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type q0: :py:class:`BlockVector` :param q0: the block vector to the dynamical system position """ return _sicpykernel.NewtonEuler3DR_computeJachqT(self, inter, q0)
[docs] def display(self) -> "void": return _sicpykernel.NewtonEuler3DR_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonEuler3DR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.NewtonEuler3DR__zeroPlugin(self)
# Register NewtonEuler3DR in _sicpykernel: _sicpykernel.NewtonEuler3DR_swigregister(NewtonEuler3DR)
[docs] class NewtonEuler5DR(NewtonEuler1DR): r""" This class is an interface for relation with impact and RFC3D. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): if self.__class__ == NewtonEuler5DR: _self = None else: _self = self _sicpykernel.NewtonEuler5DR_swiginit(self, _sicpykernel.new_NewtonEuler5DR(_self, )) __swig_destroy__ = _sicpykernel.delete_NewtonEuler5DR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize components specific to derived classes. :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.NewtonEuler5DR_initialize(self, inter)
[docs] def computeJachqT(self, inter: "Interaction", q0: "SP::BlockVector") -> "void": r""" Default implementation consists in multiplying jachq and T (see NewtonEulerR::computeJachqT) but here we compute the operator from the the contact point locations and the local frame at contact :type inter: :py:class:`Interaction` :param inter: interaction that owns the relation :type q0: :py:class:`BlockVector` :param q0: the block vector to the dynamical system position """ return _sicpykernel.NewtonEuler5DR_computeJachqT(self, inter, q0)
def __disown__(self): self.this.disown() _sicpykernel.disown_NewtonEuler5DR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.NewtonEuler5DR__zeroPlugin(self)
# Register NewtonEuler5DR in _sicpykernel: _sicpykernel.NewtonEuler5DR_swigregister(NewtonEuler5DR)
[docs] class FirstOrderR(Relation): r""" FirstOrder Relation This is an abstract class for all relation operating on first order systems. The following subclasses can be used: - FirstOrderNonlinearR: for fully nonlinear relations: :math:`y = h(t, X, \lambda, Z)` , :math:`R = g(t, X, \lambda, Z)` . - FirstOrderType2R: specialization with :math:`y = h(t, X, \lambda, Z)` , :math:`R = g(t, \lambda, Z)` . - FirstOrderType1R: further specialization with :math:`y = h(t, X, Z)` , :math:`R = g(t, \lambda, Z)` . - FirstOrderLinearR: linear case: :math:`y = C(t)x + D(t)\lambda + F(t) z + e` , :math:`R = B(t)\lambda` . - FirstOrderLinearTIR: time-invariant linear case: :math:`y = Cx + D\lambda + F z + e` , :math:`R = B\lambda` . If the relation involves only one DynamicalSystem, then :math:`R = r` , :math:`X = x` , and :math:`Z = z` . With two, then :math:`R = [r_1, r_2]`, :math:`X = [x_1 x_2]`, and :math:`Z = [z_1 z_2]` . Remember that :math:`y` and :math:`\lambda` are relation from the Interaction, and have the same size. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr x = _sicpykernel.FirstOrderR_x z = _sicpykernel.FirstOrderR_z r = _sicpykernel.FirstOrderR_r DSlinkSize = _sicpykernel.FirstOrderR_DSlinkSize e = _sicpykernel.FirstOrderR_e relationVectorsSize = _sicpykernel.FirstOrderR_relationVectorsSize mat_C = _sicpykernel.FirstOrderR_mat_C mat_D = _sicpykernel.FirstOrderR_mat_D mat_F = _sicpykernel.FirstOrderR_mat_F mat_B = _sicpykernel.FirstOrderR_mat_B mat_K = _sicpykernel.FirstOrderR_mat_K relationMatricesSize = _sicpykernel.FirstOrderR_relationMatricesSize def __init__(self, newType: "RELATION::SUBTYPES"): r""" basic constructor :type newType: int :param newType: the type of the relation """ if self.__class__ == FirstOrderR: _self = None else: _self = self _sicpykernel.FirstOrderR_swiginit(self, _sicpykernel.new_FirstOrderR(_self, newType)) _C = property(_sicpykernel.FirstOrderR__C_get, _sicpykernel.FirstOrderR__C_set, doc=r""" A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t X""") _D = property(_sicpykernel.FirstOrderR__D_get, _sicpykernel.FirstOrderR__D_set, doc=r""" A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t lambda""") _F = property(_sicpykernel.FirstOrderR__F_get, _sicpykernel.FirstOrderR__F_set, doc=r""" A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t Z""") _B = property(_sicpykernel.FirstOrderR__B_get, _sicpykernel.FirstOrderR__B_set, doc=r""" A matrix to store the constant Jacobian of g(t, X, lambda, Z) w.r.t lambda""") _K = property(_sicpykernel.FirstOrderR__K_get, _sicpykernel.FirstOrderR__K_set, doc=r""" A matrix to store the constant Jacobian of g(t, X, lambda, Z) w.r.t X""") __swig_destroy__ = _sicpykernel.delete_FirstOrderR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.FirstOrderR_initialize(self, inter)
[docs] def setCPtr(self, newC: "SP::SimpleMatrix") -> "void": r""" set C to pointer newC :type newC: :py:class:`SimpleMatrix` :param newC: the C matrix """ return _sicpykernel.FirstOrderR_setCPtr(self, newC)
[docs] def setBPtr(self, newB: "SP::SimpleMatrix") -> "void": r""" set B to pointer newB :type newB: :py:class:`SimpleMatrix` :param newB: the B matrix """ return _sicpykernel.FirstOrderR_setBPtr(self, newB)
[docs] def setDPtr(self, newD: "SP::SimpleMatrix") -> "void": r""" set D to pointer newPtr :type newD: :py:class:`SimpleMatrix` :param newD: the D matrix """ return _sicpykernel.FirstOrderR_setDPtr(self, newD)
[docs] def setFPtr(self, newF: "SP::SimpleMatrix") -> "void": r""" set F to pointer newPtr :type newF: :py:class:`SimpleMatrix` :param newF: the F matrix """ return _sicpykernel.FirstOrderR_setFPtr(self, newF)
[docs] def C(self) -> "SP::SimpleMatrix": r""" get C :rtype: :py:class:`SimpleMatrix` :return: C matrix """ return _sicpykernel.FirstOrderR_C(self)
[docs] def H(self) -> "SP::SimpleMatrix": r""" get H :rtype: :py:class:`SimpleMatrix` :return: C matrix """ return _sicpykernel.FirstOrderR_H(self)
[docs] def D(self) -> "SP::SimpleMatrix": r""" get D :rtype: :py:class:`SimpleMatrix` :return: D matrix """ return _sicpykernel.FirstOrderR_D(self)
[docs] def F(self) -> "SP::SimpleMatrix": r""" get F :rtype: :py:class:`SimpleMatrix` :return: F matrix """ return _sicpykernel.FirstOrderR_F(self)
[docs] def B(self) -> "SP::SimpleMatrix": r""" get B :rtype: :py:class:`SimpleMatrix` :return: B matrix """ return _sicpykernel.FirstOrderR_B(self)
[docs] def K(self) -> "SP::SimpleMatrix": r""" get K :rtype: :py:class:`SimpleMatrix` :return: K matrix """ return _sicpykernel.FirstOrderR_K(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderR__zeroPlugin(self)
# Register FirstOrderR in _sicpykernel: _sicpykernel.FirstOrderR_swigregister(FirstOrderR)
[docs] class FirstOrderNonLinearR(FirstOrderR): r""" FirstOrder Non Linear Relation. This is the most generic relation for First Order Dynamical Systems, with: .. math:: y &=& h(X,t,\lambda,Z) \\ R &=& g(X,t,\lambda,Z) where X, Z, and R corresponds to DynamicalSystem variables. If more than 2 DynamicalSystem are involved in the Interaction, then X = [x1 x2], Z=[z1 z2] R = [r1 r2]. :math:`y` and :math:`\lambda` are specific variables of the Interaction (see this class for more details). Let us define the following jacobians: .. math:: C &=& \nabla_x h\\ B &=& \nabla_{\lambda} g\\ D &=& \nabla_{\lambda} h\\ K &=& \nabla_x g. There are 2 ways to define this relation: - by using the plugin mechanism of calling C functions - by using the inheritance mechanism (of C++ or Python) and overloading methods. For the plugins, the following definitions are mandatory: - A function to compute :math:`h` with signature .. code-block:: c++ (double time, unsigned x_size, double *x, unsigned size_lambda, double* lambda, double *y, unsigned z_size, double *z) - A function to compute :math:`g` with signature .. code-block:: c++ (double time, unsigned x_size, double *x, unsigned size_lambda, double* lambda, double *r, unsigned z_size, double *z) Note that the size of :math:`y` is the same as :math:`\lambda`, and the size of :math:`R` is the same as :math:`X` . Thus those are not specified in the plugin function signatures. For the various jacobians, there are two possibilities: If one is constant, the value may directly be set: for instance, if :math:`C` is constant, then one can use setCPtr to fix the value. A word of cautions: whenever a jacobian matrix is fixed using this call, then the corresponding C++ function (and not plugin) is not called anymore. A small example: if :math:`C` is fixed via setCPtr, then computeJachx is never called again. The other option is to use the plugin mechanism. They all share the same signature: .. code-block:: c++ (double time, unsigned x_size, double *x, unsigned size_lambda, double* lambda, double *mat, unsigned z_size, double *z) where mat is the pointer to the array of values for each Jacobian. This implies that only dense matrix are supported. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r""" basic constructor""" if self.__class__ == FirstOrderNonLinearR: _self = None else: _self = self _sicpykernel.FirstOrderNonLinearR_swiginit(self, _sicpykernel.new_FirstOrderNonLinearR(_self, )) __swig_destroy__ = _sicpykernel.delete_FirstOrderNonLinearR
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction using this relation """ return _sicpykernel.FirstOrderNonLinearR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.FirstOrderNonLinearR_checkSize(self, inter)
[docs] def computeh(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" default function to compute :math:`h` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variable :type y: :py:class:`SiconosVector`, out :param y: output value """ return _sicpykernel.FirstOrderNonLinearR_computeh(self, time, x, lambda_, z, y)
[docs] def computeg(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", r: "BlockVector") -> "void": r""" default function to compute :math:`g` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variable :type r: :py:class:`BlockVector`, out :param r: input value """ return _sicpykernel.FirstOrderNonLinearR_computeg(self, time, x, lambda_, z, r)
[docs] def computeJachx(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", C: "SimpleMatrix") -> "void": r""" default function to compute :math:`C = \nabla_x h` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variable :type C: :py:class:`SimpleMatrix`, out :param C: jacobian matrix """ return _sicpykernel.FirstOrderNonLinearR_computeJachx(self, time, x, lambda_, z, C)
[docs] def computeJachlambda(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", D: "SimpleMatrix") -> "void": r""" default function to compute :math:`D = \nabla_{\lambda} h` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variables :type D: :py:class:`SimpleMatrix`, out :param D: jacobian matrix """ return _sicpykernel.FirstOrderNonLinearR_computeJachlambda(self, time, x, lambda_, z, D)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderNonLinearR_computeJach(self, time, inter)
[docs] def computeJacglambda(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", B: "SimpleMatrix") -> "void": r""" default function to compute :math:`B = \nabla_{\lambda}g` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variables :type B: :py:class:`SimpleMatrix`, out :param B: jacobian matrix """ return _sicpykernel.FirstOrderNonLinearR_computeJacglambda(self, time, x, lambda_, z, B)
[docs] def computeJacgx(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", K: "SimpleMatrix") -> "void": r""" default function to compute :math:`K = \nabla_{\lambda}g` :type time: float :param time: current time :type x: :py:class:`BlockVector` :param x: current state variables :type lambda: :py:class:`SiconosVector` :param lambda: current nonsmooth variables :type z: :py:class:`BlockVector` :param z: current auxiliary variables :type K: :py:class:`SimpleMatrix`, out :param K: jacobian matrix """ return _sicpykernel.FirstOrderNonLinearR_computeJacgx(self, time, x, lambda_, z, K)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderNonLinearR_computeJacg(self, time, inter)
[docs] def computeOutput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute y, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderNonLinearR_computeOutput(self, time, inter, level)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderNonLinearR_computeInput(self, time, inter, level)
[docs] def requireResidu(self) -> "bool": r""" return true if the relation requires the computation of residu :rtype: boolean :return: true if residu are required, false otherwise """ return _sicpykernel.FirstOrderNonLinearR_requireResidu(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderNonLinearR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderNonLinearR__zeroPlugin(self)
# Register FirstOrderNonLinearR in _sicpykernel: _sicpykernel.FirstOrderNonLinearR_swigregister(FirstOrderNonLinearR)
[docs] class FirstOrderType1R(FirstOrderR): r""" FirstOrder Non Linear Relation. Derived from FirstOrderR - See this class for more comments. Relation for First Order Dynamical Systems, with: .. math:: y &= h(x,z)\\ r &= g(\lambda,z) Operators (and their corresponding plug-in): - h: saved in Interaction as y (plug-in: output[0]) - :math:`\nabla_x h`: jacobianH[0] ( output[1] ) - g: saved in DS as r ( input[0]) - :math:`\nabla_\lambda g`: jacobianG[0] ( input[1] ) """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* build from plugin for :math:`h(x,z)` and :math:`g(\lambda, z)` :type pluginh: string :param pluginh: the plugin to compute h :type pluging: string :param pluging: the plugin to compute g | *Overload 3:* build from plugin for :math:`h(x,z)` , :math:`g(\lambda, z)` and their gradients :type pluginh: string :param pluginh: the plugin to compute h :type pluging: string :param pluging: the plugin to compute g :type pluginJachx: string :param pluginJachx: the plugin to compute :math:`\nabla_x h` :type pluginJacglambda: string :param pluginJacglambda: the plugin to compute :math:`\nabla_{\lambda} g` """ if self.__class__ == FirstOrderType1R: _self = None else: _self = self _sicpykernel.FirstOrderType1R_swiginit(self, _sicpykernel.new_FirstOrderType1R(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderType1R
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction that owns this relation """ return _sicpykernel.FirstOrderType1R_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.FirstOrderType1R_checkSize(self, inter)
[docs] def computeh(self, time: "double", x: "BlockVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,x,...) of the Relation :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.FirstOrderType1R_computeh(self, time, x, z, y)
[docs] def computeg(self, time: "double", lambda_: "SiconosVector", z: "BlockVector", r: "BlockVector") -> "void": r""" to compute the nonsmooth input r = g(t,x,...) of the Relation :type time: float :param time: current time value :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type r: :py:class:`BlockVector` :param r: the resulting vector """ return _sicpykernel.FirstOrderType1R_computeg(self, time, lambda_, z, r)
[docs] def computeJachx(self, time: "double", x: "BlockVector", z: "BlockVector", C: "SimpleMatrix") -> "void": r""" to compute :math:`C = \nabla_x h` :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type C: :py:class:`SimpleMatrix`, out :param C: the resulting matrix """ return _sicpykernel.FirstOrderType1R_computeJachx(self, time, x, z, C)
[docs] def computeJachz(self, time: "double", x: "BlockVector", z: "BlockVector", F: "SimpleMatrix") -> "void": r""" default function to compute :math:`\nabla_z h` :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type F: :py:class:`SimpleMatrix`, out :param F: the resulting matrix """ return _sicpykernel.FirstOrderType1R_computeJachz(self, time, x, z, F)
[docs] def computeJacglambda(self, time: "double", lambda_: "SiconosVector", z: "BlockVector", B: "SimpleMatrix") -> "void": r""" to compute :math:`B = \nabla_{\lambda}g` :type time: float :param time: current time value :param x: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type B: :py:class:`SimpleMatrix`, out :param B: the resulting matrix """ return _sicpykernel.FirstOrderType1R_computeJacglambda(self, time, lambda_, z, B)
[docs] def computeOutput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute y, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderType1R_computeOutput(self, time, inter, level)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderType1R_computeInput(self, time, inter, level)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderType1R_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderType1R_computeJacg(self, time, inter)
[docs] def requireResidu(self) -> "bool": r""" return true if the relation requires the computation of residu :rtype: boolean :return: true if residu are required, false otherwise """ return _sicpykernel.FirstOrderType1R_requireResidu(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderType1R(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderType1R__zeroPlugin(self)
# Register FirstOrderType1R in _sicpykernel: _sicpykernel.FirstOrderType1R_swigregister(FirstOrderType1R)
[docs] class FirstOrderType2R(FirstOrderR): r""" First order non linear Relation. Relation for First Order Dynamical Systems, with: .. math:: y &= h(x,\lambda,z)\\ r &= g(\lambda,z) Operators (and their corresponding plug-in): - h: saved in Interaction as y (plug-in: output[0]) - :math:`\nabla_x h`: jacobianH[0] ( output[1] ) - g: saved in DS as r ( input[0]) - :math:`\nabla_\lambda g`: jacobianG[0] ( input[1] ) Remark FP: at the time, this class works only on the linear case, when: - :math:`\nabla_x h = C`, :math:`\nabla_\lambda h = D` and :math:`\nabla_\lambda g = K` are constants. Trying to update these jacobians with plugins functions leads to an exception. Solution: create a derived class and overide computeJachx and computeJach. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Basic contructor | *Overload 2:* data constructor :type pluginh: string :param pluginh: name of the plugin to compute h :type pluging: string :param pluging: name of the plugin to compute g | *Overload 3:* data constructor :type pluginh: string :param pluginh: name of the plugin to compute h :type pluging: string :param pluging: name of the plugin to compute g :type pluginJacobianhx: string :param pluginJacobianhx: name of the plugin to compute the Jacobian of h according to x :math:`\nabla_x h` :type pluginJacobianglambda: string :param pluginJacobianglambda: name of the plugin to compute the jacobian of g according to lambda """ if self.__class__ == FirstOrderType2R: _self = None else: _self = self _sicpykernel.FirstOrderType2R_swiginit(self, _sicpykernel.new_FirstOrderType2R(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderType2R
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction that owns this relation """ return _sicpykernel.FirstOrderType2R_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.FirstOrderType2R_checkSize(self, inter)
[docs] def computeh(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,x,...) of the Relation :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.FirstOrderType2R_computeh(self, time, x, lambda_, y)
[docs] def computeg(self, time: "double", lambda_: "SiconosVector", r: "BlockVector") -> "void": r""" to compute the nonsmooth input r = g(t,x,...) of the Relation :type time: float :param time: current time value :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type r: :py:class:`BlockVector` :param r: the resulting vector """ return _sicpykernel.FirstOrderType2R_computeg(self, time, lambda_, r)
[docs] def computeJachx(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", C: "SimpleMatrix") -> "void": r""" to compute :math:`C = \nabla_x h` :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type C: :py:class:`SimpleMatrix`, out :param C: the resulting matrix """ return _sicpykernel.FirstOrderType2R_computeJachx(self, time, x, lambda_, C)
[docs] def computeJacglambda(self, time: "double", lambda_: "SiconosVector", B: "SimpleMatrix") -> "void": r""" to compute :math:`B = \nabla_{\lambda}g` :type time: float :param time: current time value :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type B: :py:class:`SimpleMatrix`, out :param B: the resulting matrix """ return _sicpykernel.FirstOrderType2R_computeJacglambda(self, time, lambda_, B)
[docs] def computeJachlambda(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", D: "SimpleMatrix") -> "void": r""" to compute :math:`D = \nabla_{\lambda}h` :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type D: :py:class:`SimpleMatrix`, out :param D: the resulting matrix """ return _sicpykernel.FirstOrderType2R_computeJachlambda(self, time, x, lambda_, D)
[docs] def computeOutput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute y, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderType2R_computeOutput(self, time, inter, level)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r, using the data from the Interaction and DS :type time: float :param time: current time (not used) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderType2R_computeInput(self, time, inter, level)
[docs] def requireResidu(self) -> "bool": r""" return true if the relation requires the computation of residu :rtype: boolean :return: true if residu are required, false otherwise """ return _sicpykernel.FirstOrderType2R_requireResidu(self)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderType2R_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderType2R_computeJacg(self, time, inter)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderType2R(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderType2R__zeroPlugin(self)
# Register FirstOrderType2R in _sicpykernel: _sicpykernel.FirstOrderType2R_swigregister(FirstOrderType2R)
[docs] class FirstOrderLinearR(FirstOrderR): r""" First Order Linear Relation Linear Relation for First Order Dynamical Systems: .. math:: y &=& C(t,z)x(t) + F(t,z)z + D(t,z)\lambda + e(t,z) \\ R &=& B(t,z) \lambda The following operators can be plugged: B(t,z), C(t,z), D(t,z), e(t,z), F(t,z) """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _e = property(_sicpykernel.FirstOrderLinearR__e_get, _sicpykernel.FirstOrderLinearR__e_set, doc=r""" e operator (time dependant)""")
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation in workV and workM ...) :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation """ return _sicpykernel.FirstOrderLinearR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.FirstOrderLinearR_checkSize(self, inter)
def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* Constructor with C and B plugin names :type Cname: string :param Cname: the plugin name for computing the C matrix :type Bname: string :param Bname: the plugin name for computing the B matrix | *Overload 3:* Constructor with all plugin names :type Cname: string :param Cname: the plugin name for computing the C matrix :type Dname: string :param Dname: the plugin name for computing the D matrix :type Fname: string :param Fname: the plugin name for computing the F matrix :type Ename: string :param Ename: the plugin name for computing the e vector :type Bname: string :param Bname: the plugin name for computing the B matrix | *Overload 4:* create the Relation from constant matrices (only B and C operators) :type C: :py:class:`SimpleMatrix` :param C: the C matrix :type B: :py:class:`SimpleMatrix` :param B: the B matrix | *Overload 5:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the C matrix :type D: :py:class:`SimpleMatrix` :param D: the D matrix :type F: :py:class:`SimpleMatrix` :param F: the F matrix :type e: :py:class:`SiconosVector` :param e: the e matrix :type B: :py:class:`SimpleMatrix` :param B: the B matrix """ if self.__class__ == FirstOrderLinearR: _self = None else: _self = self _sicpykernel.FirstOrderLinearR_swiginit(self, _sicpykernel.new_FirstOrderLinearR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderLinearR
[docs] def setComputeCFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" set a specified function to compute the matrix C :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.FirstOrderLinearR_setComputeCFunction(self, pluginPath, functionName)
[docs] def setComputeDFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" set a specified function to compute the matrix D :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.FirstOrderLinearR_setComputeDFunction(self, pluginPath, functionName)
[docs] def setComputeBFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" set a specified function to compute the matrix B :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the function name to use in this plugin """ return _sicpykernel.FirstOrderLinearR_setComputeBFunction(self, pluginPath, functionName)
[docs] def computeC(self, time: "double", z: "BlockVector", C: "SimpleMatrix") -> "void": r""" Function to compute the matrix C :type time: float :param time: the current time :type z: :py:class:`BlockVector` :param z: the auxiliary input vector :type C: :py:class:`SimpleMatrix` :param C: the C matrix """ return _sicpykernel.FirstOrderLinearR_computeC(self, time, z, C)
[docs] def computeD(self, time: "double", z: "BlockVector", D: "SimpleMatrix") -> "void": r""" Function to compute the matrix D :type time: float :param time: the current time :type z: :py:class:`BlockVector` :param z: the auxiliary input vector :type D: :py:class:`SimpleMatrix` :param D: the D matrix """ return _sicpykernel.FirstOrderLinearR_computeD(self, time, z, D)
[docs] def computeF(self, time: "double", z: "BlockVector", F: "SimpleMatrix") -> "void": r""" Function to compute the matrix F :type time: float :param time: the current time :type z: :py:class:`BlockVector` :param z: the auxiliary input vector :type F: :py:class:`SimpleMatrix` :param F: the F matrix """ return _sicpykernel.FirstOrderLinearR_computeF(self, time, z, F)
[docs] def computee(self, time: "double", z: "BlockVector", e: "SiconosVector") -> "void": r""" Function to compute the vector e :type time: float :param time: the current time :type z: :py:class:`BlockVector` :param z: the auxiliary input vector :type e: :py:class:`SiconosVector` :param e: the e vector """ return _sicpykernel.FirstOrderLinearR_computee(self, time, z, e)
[docs] def computeB(self, time: "double", z: "BlockVector", B: "SimpleMatrix") -> "void": r""" Function to compute the matrix B :type time: float :param time: the current time :type z: :py:class:`BlockVector` :param z: the auxiliary input vector :type B: :py:class:`SimpleMatrix` :param B: the B matrix """ return _sicpykernel.FirstOrderLinearR_computeB(self, time, z, B)
[docs] def computeh(self, time: "double", x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" to compute the output y = h(t,x,...) of the Relation :type time: float :param time: current time value :type x: :py:class:`BlockVector` :param x: coordinates of the dynamical systems involved in the relation :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.FirstOrderLinearR_computeh(self, time, x, lambda_, z, y)
[docs] def computeg(self, time: "double", lambda_: "SiconosVector", z: "BlockVector", r: "BlockVector") -> "void": r""" to compute the nonsmooth input r = g(t,x,...) of the Relation :type time: float :param time: current time value :type lambda: :py:class:`SiconosVector` :param lambda: interaction :math:`\lambda` vector :type z: :py:class:`BlockVector` :param z: user defined parameters (optional) :type r: :py:class:`BlockVector` :param r: the resulting vector """ return _sicpykernel.FirstOrderLinearR_computeg(self, time, lambda_, z, r)
[docs] def computeOutput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute y :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderLinearR_computeOutput(self, time, inter, level)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: not used """ return _sicpykernel.FirstOrderLinearR_computeInput(self, time, inter, level)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.FirstOrderLinearR_display(self)
[docs] def setePtr(self, newe: "SP::SiconosVector") -> "void": r""" set e operator :type newe: :py:class:`SiconosVector` :param newe: the new value of e """ return _sicpykernel.FirstOrderLinearR_setePtr(self, newe)
[docs] def e(self) -> "SP::SiconosVector": r""" get e :rtype: :py:class:`SiconosVector` :return: e matrix """ return _sicpykernel.FirstOrderLinearR_e(self)
[docs] def isLinear(self) -> "bool": r""" determines if the Relation is linear :rtype: boolean :return: true if the relation is linear. """ return _sicpykernel.FirstOrderLinearR_isLinear(self)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderLinearR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderLinearR_computeJacg(self, time, inter)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderLinearR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderLinearR__zeroPlugin(self)
# Register FirstOrderLinearR in _sicpykernel: _sicpykernel.FirstOrderLinearR_swigregister(FirstOrderLinearR)
[docs] class FirstOrderLinearTIR(FirstOrderR): r""" Linear Time Invariant Relation, derived from class FirstOrderR Linear Relation for First Order Dynamical Systems with time-independant operators .. math:: y &=& Cx(t) + Fz + D\lambda + e \\ R &=& B\lambda """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _e = property(_sicpykernel.FirstOrderLinearTIR__e_get, _sicpykernel.FirstOrderLinearTIR__e_set, doc=r""" e operator (constant vector)""")
[docs] def initialize(self, inter: "Interaction") -> "void": r""" initialize the relation (check sizes, memory allocation ...) :type inter: :py:class:`Interaction` :param inter: the interaction that owns this relation """ return _sicpykernel.FirstOrderLinearTIR_initialize(self, inter)
[docs] def checkSize(self, inter: "Interaction") -> "void": r""" check sizes of the relation specific operators. :type inter: :py:class:`Interaction` :param inter: an Interaction using this relation """ return _sicpykernel.FirstOrderLinearTIR_checkSize(self, inter)
def __init__(self, *args): r""" *Overload 1:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the matrix C :type B: :py:class:`SimpleMatrix` :param B: the matrix B | *Overload 2:* create the Relation from a set of data :type C: :py:class:`SimpleMatrix` :param C: the C matrix :type D: :py:class:`SimpleMatrix` :param D: the D matrix :type F: :py:class:`SimpleMatrix` :param F: the F matrix :type e: :py:class:`SiconosVector` :param e: the e matrix :type B: :py:class:`SimpleMatrix` :param B: the B matrix """ if self.__class__ == FirstOrderLinearTIR: _self = None else: _self = self _sicpykernel.FirstOrderLinearTIR_swiginit(self, _sicpykernel.new_FirstOrderLinearTIR(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FirstOrderLinearTIR
[docs] def computeh(self, x: "BlockVector", lambda_: "SiconosVector", z: "BlockVector", y: "SiconosVector") -> "void": r""" default function to compute h = y = Cx(t) + Fz + Dlambda + e :type x: :py:class:`BlockVector` :param x: :type lambda: :py:class:`SiconosVector` :param lambda: :type z: :py:class:`BlockVector` :param z: :type y: :py:class:`SiconosVector` :param y: the resulting vector """ return _sicpykernel.FirstOrderLinearTIR_computeh(self, x, lambda_, z, y)
[docs] def computeg(self, lambda_: "SiconosVector", r: "BlockVector") -> "void": r""" default function to compute g = Blambda :type lambda: :py:class:`SiconosVector` :param lambda: :type r: :py:class:`BlockVector` :param r: non-smooth input """ return _sicpykernel.FirstOrderLinearTIR_computeg(self, lambda_, r)
[docs] def computeOutput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute y :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: """ return _sicpykernel.FirstOrderLinearTIR_computeOutput(self, time, inter, level)
[docs] def computeInput(self, time: "double", inter: "Interaction", level: "unsigned int"=0) -> "void": r""" default function to compute r :type time: float :param time: current time :type inter: :py:class:`Interaction` :param inter: Interaction using this Relation :type level: int, optional :param level: """ return _sicpykernel.FirstOrderLinearTIR_computeInput(self, time, inter, level)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.FirstOrderLinearTIR_display(self)
[docs] def setePtr(self, newe: "SP::SiconosVector") -> "void": r""" set e :type newe: :py:class:`SiconosVector` :param newe: the new value of e """ return _sicpykernel.FirstOrderLinearTIR_setePtr(self, newe)
[docs] def e(self) -> "SP::SiconosVector": r""" get e :rtype: :py:class:`SiconosVector` :return: e matrix """ return _sicpykernel.FirstOrderLinearTIR_e(self)
[docs] def isLinear(self) -> "bool": r""" determine if the Relation is linear :rtype: boolean :return: true if the relation is linear. """ return _sicpykernel.FirstOrderLinearTIR_isLinear(self)
[docs] def computeJach(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderLinearTIR_computeJach(self, time, inter)
[docs] def computeJacg(self, time: "double", inter: "Interaction") -> "void": return _sicpykernel.FirstOrderLinearTIR_computeJacg(self, time, inter)
def __disown__(self): self.this.disown() _sicpykernel.disown_FirstOrderLinearTIR(self) return weakref.proxy(self) def _zeroPlugin(self) -> "void": r""" To initialize all the plugin functions with nullptr.""" return _sicpykernel.FirstOrderLinearTIR__zeroPlugin(self)
# Register FirstOrderLinearTIR in _sicpykernel: _sicpykernel.FirstOrderLinearTIR_swigregister(FirstOrderLinearTIR)
[docs] class Interaction(object): r""" Description of a non-smooth interaction. The object Interaction is used to defined a "link" between one or two DynamicalSystem, like unilateral constraints and some nonsmooth law (e.g. complementarity). It holds two vectors of "local" variables, :math:`y` and :math:`\lambda` and their derivatives, which are related to the state variables and the inputs of the DynamicalSystem (x,R) through constraints defined in a Relation and completed with a NonSmoothLaw involving those variables. Remarks: - one and only one Relation (access: relation()) per Interaction - one and only one NonSmoothLaw (access: nonSmoothLaw()) per Interaction - dimension() is the size of the interaction and so the size of vectors y, lambda and their derivatives. - output: y(i), to get derivative i of y - input: lambda(i), to get derivative i of lambda """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, NSL: "SP::NonSmoothLaw", rel: "SP::Relation"): r""" Interaction constructor :type NSL: :py:class:`NonSmoothLaw` :param NSL: pointer object describing the nonsmooth law; the interaction size if infered from the size of this law. :type rel: :py:class:`Relation` :param rel: a pointer object describing the functions used to compute the constraints """ _sicpykernel.Interaction_swiginit(self, _sicpykernel.new_Interaction(NSL, rel)) __swig_destroy__ = _sicpykernel.delete_Interaction
[docs] def reset(self) -> "void": r""" Update interactions attributes. Must be called when levels have been modified. """ return _sicpykernel.Interaction_reset(self)
[docs] def initializeLinkToDsVariables(self, ds1: "DynamicalSystem", ds2: "DynamicalSystem") -> "void": r""" set the links to the DynamicalSystem(s) and allocate the required workspaces :param interProp: the InteractionProperties of this Interaction :type ds1: :py:class:`DynamicalSystem` :param ds1: first ds linked to this Interaction (i.e IG->vertex.source) :param workV1: work vectors of ds1 :type ds2: :py:class:`DynamicalSystem` :param ds2: second ds linked to this Interaction (i.e IG->vertex.target) ds1 == ds2 is allowed. :param workV2: work vectors of ds2 set the links between the interaction and the DynamicalSystem(s) members. :type ds1: :py:class:`DynamicalSystem` :param ds1: first ds linked to this Interaction (i.e IG->vertex.source) :type ds2: :py:class:`DynamicalSystem` :param ds2: second ds linked to this Interaction (i.e IG->vertex.target) ds1 == ds2 is allowed """ return _sicpykernel.Interaction_initializeLinkToDsVariables(self, ds1, ds2)
[docs] def resetAllLambda(self) -> "void": r""" set all lambda to zero""" return _sicpykernel.Interaction_resetAllLambda(self)
[docs] def resetLambda(self, level: "unsigned int") -> "void": r""" set lambda to zero for a given level :type level: int :param level: """ return _sicpykernel.Interaction_resetLambda(self, level)
[docs] def initializeMemory(self, steps: "unsigned int") -> "void": r""" build memories vectors for y and :math:`\lambda` :param computeResiduY: true if interaction should compute extra residu value :type steps: int :param steps: number of required memories (depends on the OSI) """ return _sicpykernel.Interaction_initializeMemory(self, steps)
[docs] def number(self) -> "size_t": r""" :rtype: int :return: the id of the interaction """ return _sicpykernel.Interaction_number(self)
[docs] def setLowerLevelForOutput(self, newVal: "unsigned int const") -> "void": r""" Set the lower level for output y. :type newVal: int :param newVal: : an unsigned int """ return _sicpykernel.Interaction_setLowerLevelForOutput(self, newVal)
[docs] def setUpperLevelForOutput(self, newVal: "unsigned int const") -> "void": r""" Set the upper level for output y. :type newVal: int :param newVal: : an unsigned int """ return _sicpykernel.Interaction_setUpperLevelForOutput(self, newVal)
[docs] def lowerLevelForOutput(self) -> "unsigned int": r""" Get the lower level for output y. :rtype: int :return: an unsigned int. """ return _sicpykernel.Interaction_lowerLevelForOutput(self)
[docs] def upperLevelForOutput(self) -> "unsigned int": r""" Get the upper level for output y. :rtype: int :return: an unsigned int. """ return _sicpykernel.Interaction_upperLevelForOutput(self)
[docs] def setLowerLevelForInput(self, newVal: "unsigned int const") -> "void": r""" Set the lower level for input Lambda. :type newVal: int :param newVal: : an unsigned int """ return _sicpykernel.Interaction_setLowerLevelForInput(self, newVal)
[docs] def setUpperLevelForInput(self, newVal: "unsigned int const") -> "void": r""" Set the upper level for input Lambda. :type newVal: int :param newVal: : an unsigned int. """ return _sicpykernel.Interaction_setUpperLevelForInput(self, newVal)
[docs] def lowerLevelForInput(self) -> "unsigned int": r""" Get the lower level for input Lambda. :rtype: int :return: an unsigned int. """ return _sicpykernel.Interaction_lowerLevelForInput(self)
[docs] def upperLevelForInput(self) -> "unsigned int": r""" Get the upper level for input Lambda. :rtype: int :return: an unsigned int. """ return _sicpykernel.Interaction_upperLevelForInput(self)
[docs] def dimension(self) -> "unsigned int": r""" returns dimension (i.e. nslaw size == y and lambda size)""" return _sicpykernel.Interaction_dimension(self)
[docs] def getSizeOfDS(self) -> "unsigned int": r""" :rtype: int :return: the sum of DS sizes, for DS involved in interaction """ return _sicpykernel.Interaction_getSizeOfDS(self)
[docs] def setHas2Bodies(self, val: "bool") -> "void": r""" Set the number of dynamical systems concerned by this interaction. Warning FP: this function is supposed to be called only during topology->link(inter, ds1, ds2) call. :type val: boolean :param val: : true if two ds, else false """ return _sicpykernel.Interaction_setHas2Bodies(self, val)
[docs] def has2Bodies(self) -> "bool": r""" Check the number of dynamical systems concerned by this interaction. :rtype: boolean :return: bool : true if two ds, else false """ return _sicpykernel.Interaction_has2Bodies(self)
[docs] def getCopyOfy(self, i: "unsigned int const") -> "SiconosVector const": r""" Get y[i], derivative number i of output :type i: int :param i: : the derivative number :rtype: :py:class:`SiconosVector` :return: BlockVector """ return _sicpykernel.Interaction_getCopyOfy(self, i)
[docs] def y(self, *args) -> "SP::SiconosVector": r""" *Overload 1:* get vector of output derivatives :rtype: :py:class:`VectorOfVectors` :return: a VectorOfVectors | *Overload 2:* get y[i], derivative number i of output :type i: int :param i: derivative number i of output :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.Interaction_y(self, *args)
[docs] def setY(self, *args) -> "void": r""" *Overload 1:* set the output vector y to newVector with copy of the y[i] (ie memory allocation) :type v: :py:class:`VectorOfVectors` :param v: VectorOfVectors | *Overload 2:* set y[i] to newValue :type i: int :param i: derivative number i of output :type v: :py:class:`SiconosVector` :param v: a SiconosVector and an unsigned int """ return _sicpykernel.Interaction_setY(self, *args)
[docs] def setYPtr(self, *args) -> "void": r""" *Overload 1:* set the output vector y to newVector with direct pointer equality for the y[i] :type v: :py:class:`VectorOfVectors` :param v: VectorOfVectors | *Overload 2:* set y[i] to pointer newPtr :type i: int :param i: derivative number i of output :type v: :py:class:`SiconosVector` :param v: a SP::SiconosVector and an unsigned int """ return _sicpykernel.Interaction_setYPtr(self, *args)
[docs] def yMemory(self, level: "unsigned int") -> "SiconosMemory &": r""" get all the values of the output y stored in memory :type level: int :param level: :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.Interaction_yMemory(self, level)
[docs] def y_k(self, i: "unsigned int const") -> "SiconosVector const &": r""" get the last value of the output y stored in memory :param level: :rtype: :py:class:`SiconosVector` :return: a SiconosVector reference """ return _sicpykernel.Interaction_y_k(self, i)
[docs] def getLambda(self, *args) -> "SiconosVector const": r""" *Overload 1:* get vector of input derivatives :rtype: :py:class:`VectorOfVectors` :return: a VectorOfVectors | *Overload 2:* get _lambda[i], derivative number i of input :type i: int :param i: derivative number i of output :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.Interaction_getLambda(self, *args)
[docs] def lambda_(self, i: "unsigned int const") -> "SP::SiconosVector": r""" get _lambda[i], derivative number i of input :type i: int :param i: derivative number i of output :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.Interaction_lambda_(self, i)
[docs] def lambdaMemory(self, level: "unsigned int") -> "SiconosMemory &": r""" get all the values of the multiplier lambda stored in memory :type level: int :param level: :rtype: :py:class:`SiconosMemory` :return: a memory """ return _sicpykernel.Interaction_lambdaMemory(self, level)
[docs] def lambda_k(self, i: "unsigned int const") -> "SiconosVector const &": r""" get the last value of the multiplier lambda stored in memory :param level: :rtype: :py:class:`SiconosVector` :return: a SiconosVector reference """ return _sicpykernel.Interaction_lambda_k(self, i)
[docs] def setLambda(self, *args) -> "void": r""" *Overload 1:* set the input vector _lambda to newVector :type v: :py:class:`VectorOfVectors` :param v: VectorOfVectors | *Overload 2:* set _lambda[i] to newValue :type i: int :param i: derivative number i of output :type newValue: :py:class:`SiconosVector` :param newValue: a SiconosVector """ return _sicpykernel.Interaction_setLambda(self, *args)
[docs] def setLambdaPtr(self, *args) -> "void": r""" *Overload 1:* set vector _lambda to newVector with direct pointer equality for the _lambda[i] :type v: :py:class:`VectorOfVectors` :param v: VectorOfVectors | *Overload 2:* set _lambda[i] to pointer newPtr :type i: int :param i: derivative number i of output :type newPtr: :py:class:`SiconosVector` :param newPtr: a SP::SiconosVector """ return _sicpykernel.Interaction_setLambdaPtr(self, *args)
[docs] def relation(self) -> "SP::Relation": r""" get the Relation of this Interaction :rtype: :py:class:`Relation` :return: a pointer on this Relation """ return _sicpykernel.Interaction_relation(self)
[docs] def nonSmoothLaw(self) -> "SP::NonSmoothLaw": r""" get the NonSmoothLaw of this Interaction :rtype: :py:class:`NonSmoothLaw` :return: a pointer on this NonSmoothLaw """ return _sicpykernel.Interaction_nonSmoothLaw(self)
def linkToDSVariables(self) -> "VectorOfBlockVectors &": return _sicpykernel.Interaction_linkToDSVariables(self) def relationVectors(self) -> "VectorOfVectors &": return _sicpykernel.Interaction_relationVectors(self) def relationMatrices(self) -> "VectorOfSMatrices &": return _sicpykernel.Interaction_relationMatrices(self)
[docs] def setDSSizes(self, s1: "unsigned int") -> "void": r""" set interaction 'ds-dimension', i.e. sum of all sizes of the dynamical systems linked by the current interaction. This must be done by topology during call to link(inter, ds, ...). :type s1: int :param s1: int sum of ds sizes """ return _sicpykernel.Interaction_setDSSizes(self, s1)
[docs] def swapInMemory(self) -> "void": r""" Must be call to fill the memory. (after convergence of the Newton iterations)""" return _sicpykernel.Interaction_swapInMemory(self)
[docs] def display(self, brief: "bool"=True) -> "void": r""" print the data to the screen""" return _sicpykernel.Interaction_display(self, brief)
[docs] @staticmethod def resetCount(new_count: "size_t"=0) -> "size_t": r""" reset the global Interaction counter (for ids) :rtype: int :return: the previous value of count """ return _sicpykernel.Interaction_resetCount(new_count)
[docs] def computeOutput(self, time: "double", derivativeNumber: "unsigned int"=0) -> "void": r""" Computes output y, depends on the relation type. :type time: float :param time: current time :type derivativeNumber: int, optional :param derivativeNumber: number of the derivative to compute, optional, default = 0 """ return _sicpykernel.Interaction_computeOutput(self, time, derivativeNumber)
[docs] def computeInput(self, time: "double", level: "unsigned int"=0) -> "void": r""" Compute input r of all Dynamical Systems involved in the present Interaction. :type time: float :param time: current time :type level: int, optional :param level: order of _lambda used to compute input. """ return _sicpykernel.Interaction_computeInput(self, time, level)
[docs] def getLeftInteractionBlock(self) -> "SP::SiconosMatrix": r""" gets the matrix used in interactionBlock computation, (left * W * right), depends on the relation type (ex, LinearTIR, left = C, right = B).. :rtype: :py:class:`SiconosMatrix` :return: InteractionBlock a pointer to SiconosMatrix (in-out parameter): the resulting interactionBlock matrix """ return _sicpykernel.Interaction_getLeftInteractionBlock(self)
[docs] def getLeftInteractionBlockForDS(self, pos: "unsigned int", size: "unsigned int", sizeDS: "unsigned int") -> "SP::SiconosMatrix": r""" gets the matrix used in interactionBlock computation (left * W * right), depends on the relation type (ex, LinearTIR, left = C, right = B). We get only the part corresponding to one ds. :type pos: int :param pos: int, relative position of the beginning of the required block in relation matrix. :type size: int :param size: int, size(0) of the block :type sizeDS: int :param sizeDS: int, size(1) of the block :rtype: :py:class:`SiconosMatrix` :return: InteractionBlock a pointer to SiconosMatrix (in-out parameter): the resulting interactionBlock matrix """ return _sicpykernel.Interaction_getLeftInteractionBlockForDS(self, pos, size, sizeDS)
[docs] def getLeftInteractionBlockForDSProjectOnConstraints(self, pos: "unsigned int", InteractionBlock: "SP::SiconosMatrix") -> "void": r""" gets the matrix used in interactionBlock computation. Used only for the formulation projecting on the constraints. We get only the part corresponding to ds. :type pos: int :param pos: int, relative position of the beginning of the required block in relation matrix. :type InteractionBlock: :py:class:`SiconosMatrix` :param InteractionBlock: a pointer to SiconosMatrix (in-out parameter): the resulting interactionBlock matrix """ return _sicpykernel.Interaction_getLeftInteractionBlockForDSProjectOnConstraints(self, pos, InteractionBlock)
[docs] def getRightInteractionBlockForDS(self, pos: "unsigned int", sizeDS: "unsigned int", size: "unsigned int") -> "SP::SiconosMatrix": r""" gets the matrix used in interactionBlock computation (left * W * rigth), depends on the relation type (ex, LinearTIR, left = C, right = B). We get only the part corresponding to ds. :type pos: int :param pos: int, relative position of the beginning of the required block in relation matrix. :type sizeDS: int :param sizeDS: int, size(0) of the block :type size: int :param size: int, size(1) of the block :rtype: :py:class:`SiconosMatrix` :return: InteractionBlock a pointer to SiconosMatrix (in-out parameter): the resulting interactionBlock matrix """ return _sicpykernel.Interaction_getRightInteractionBlockForDS(self, pos, sizeDS, size)
[docs] def getExtraInteractionBlock(self, InteractionBlock: "SP::SiconosMatrix") -> "void": r""" gets extra interactionBlock corresponding to the present Interaction :type InteractionBlock: :py:class:`SiconosMatrix`, in/out :param InteractionBlock: SP::SiconosMatrix """ return _sicpykernel.Interaction_getExtraInteractionBlock(self, InteractionBlock)
# Register Interaction in _sicpykernel: _sicpykernel.Interaction_swigregister(Interaction)
[docs] def Interaction_resetCount(new_count: "size_t"=0) -> "size_t": r""" reset the global Interaction counter (for ids) :rtype: int :return: the previous value of count """ return _sicpykernel.Interaction_resetCount(new_count)
[docs] class TimeDiscretisation(object): r""" A time discretisation scheme A TimeDiscretisation object is used to discretized a given time interval. TimeDiscretisation are used: - in the simulation, as a user-input to discretized [t0,T] - in Sensor and Actuator, to define the set of time instants where the sensor or actuator must operate. A TimeDiscretisation is defined with a starting time (t0), a time step size (h, non necessarily constant), the number of the current time step (k). The time instant values are saved in a vector tk. Depending on the way of construction of the TimeDiscretisation, all or only current and next times are saved in tk. The difference is just a question of saving memory. Note that the TimeDiscretisation is not linked to the Model. It's up to the user to check that the way he builds his time-discretisation fits with the t0 and T given in the model. Main functions: - setCurrentTimeStep(), to set current h. This value will be used for all future time steps, until next change. - increment(), shift to next time step (increment k, and shift t[k] and t[k+1]) - currentTime(), return t[k] Construction - input = the complete vector tk. This defines t0, T, number of time steps and time step size (which is not necessarily constant). In this case, the whole vector is saved in the memory. - inputs = number of time steps, t0 and T. size h is computed with t0,T and nSteps. Only two values are saved: t[k] and t[k+1] = t[k] + h. h can be changed at any time. - inputs = h and t0. Only two values are saved: t[k] and t[k+1] = t[k] + h. h can be changed at any time. - inputs = t0 and h. Only two values are saved: t[k] and t[k+1] = t[k] + h. h can be changed at any time. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* constructor with tk vector of instant times values. :type newTk: TkVector :param newTk: a TkVector describing the discretisation | *Overload 2:* constructor with the size of the default time step and t0 :type t0: float :param t0: initial time value :type h: float :param h: the time step | *Overload 3:* constructor with the number of steps, t0 and T :type nSteps: int :param nSteps: the number of steps :type t0: float :param t0: initial time value :type T: float :param T: the final time | *Overload 4:* Constructor with the size of the default timestep and t0. It creates a TimeDiscretisation using GMP for all its computation :type t0: float :param t0: initial time value :type str: string :param str: the time step in form of a string | *Overload 5:* Copy constructor :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation to copy """ _sicpykernel.TimeDiscretisation_swiginit(self, _sicpykernel.new_TimeDiscretisation(*args)) __swig_destroy__ = _sicpykernel.delete_TimeDiscretisation
[docs] def currentTimeStep(self, *args) -> "mpf_t const *": r""" *Overload 1:* get the timestep :math:`t_{k+1} - t_k` :type k: int :param k: the index of the timestep :rtype: float :return: the current time step | *Overload 2:* get the timestep in gmp format :rtype: mpf_t :return: a pointer to the timestep in mpf_t format """ return _sicpykernel.TimeDiscretisation_currentTimeStep(self, *args)
[docs] def hConst(self) -> "bool": r""" determine whether the timestep is constant :rtype: boolean :return: true if the timestep is constant """ return _sicpykernel.TimeDiscretisation_hConst(self)
[docs] def hGmp(self) -> "bool": r""" determine whether the TimeDiscretisation is using GMP :rtype: boolean :return: true if the TimeDiscretisation is using GMP """ return _sicpykernel.TimeDiscretisation_hGmp(self)
[docs] def getTk(self, indx: "unsigned int const") -> "double": r""" get the value of tk at step k :type indx: int :param indx: the step :rtype: float :return: a double """ return _sicpykernel.TimeDiscretisation_getTk(self, indx)
[docs] def getTkVector(self) -> "TkVector const &": r""" get the TkVector _tkV :rtype: TkVector :return: a reference to the TkVector _tkV """ return _sicpykernel.TimeDiscretisation_getTkVector(self)
[docs] def setTkVector(self, newTk: "TkVector const &") -> "void": r""" set the TkVector _tkV :type newTk: TkVector :param newTk: the new value for _tkV """ return _sicpykernel.TimeDiscretisation_setTkVector(self, newTk)
[docs] def setT0(self, val: "double") -> "void": r""" change t0 before the simulation starts (useful for delays) :type val: float :param val: the new value for t0 """ return _sicpykernel.TimeDiscretisation_setT0(self, val)
[docs] def display(self) -> "void": r""" print the discretisation data to the screen""" return _sicpykernel.TimeDiscretisation_display(self)
# Register TimeDiscretisation in _sicpykernel: _sicpykernel.TimeDiscretisation_swigregister(TimeDiscretisation)
[docs] class OneStepNSProblem(object): r""" Non Smooth Problem Formalization and Simulation This is an abstract class, that provides an interface to define a non smooth problem: - a formulation (ie the way the problem is written) - a solver (algorithm and solving formulation, that can be different from problem formulation) - routines to compute the problem solution. Two types of problem formulation are available : - Quadratic Problem - Linear Problem See derived classes (QP and LinearOSNS) for details. For Linear problems, the following formulations exists: - Linear Complementarity (LCP) - Mixed Linear Complementarity (MLCP) - Affine Variational Inequalities (AVI) - FrictionContact - Relay - Equality - GenericMechanical - MultipleImpact - GlobalFrictionContact The usual way to build and initialize a one-step nonsmooth problem is : - call constructor with the id of the required Numerics solver. (see Solver class or Numerics documentation for details on algorithm name and parameters). - initialize(simulation) Initialize process is usually done through model->initialize(simulation). See Examples for practical details. Options for Numerics and the driver for solvers When the Numerics driver is called a set of solver options (name, tolerance, max. number of iterations ...) is required --> SolverOptions. Default values are always set in solver options the OneStepNSProblem is built but if you need to set them yourself, please check Users'guide, Numerics solvers part. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _numerics_solver_options = property(_sicpykernel.OneStepNSProblem__numerics_solver_options_get, _sicpykernel.OneStepNSProblem__numerics_solver_options_set, doc=r""" Numerics solver properties""") _sizeOutput = property(_sicpykernel.OneStepNSProblem__sizeOutput_get, _sicpykernel.OneStepNSProblem__sizeOutput_set, doc=r""" size of the nonsmooth problem""") _simulation = property(_sicpykernel.OneStepNSProblem__simulation_get, _sicpykernel.OneStepNSProblem__simulation_set, doc=r""" link to the simulation that owns the nonsmooth problem""") _indexSetLevel = property(_sicpykernel.OneStepNSProblem__indexSetLevel_get, _sicpykernel.OneStepNSProblem__indexSetLevel_set, doc=r""" level of index sets that is considered by this osnsp""") _inputOutputLevel = property(_sicpykernel.OneStepNSProblem__inputOutputLevel_get, _sicpykernel.OneStepNSProblem__inputOutputLevel_set, doc=r""" level of input and output variables of the nonsmooth problems. We consider that the osnsp computes y[_inputOutputLevel] and lambda[_inputOutputLevel] """) _maxSize = property(_sicpykernel.OneStepNSProblem__maxSize_get, _sicpykernel.OneStepNSProblem__maxSize_set, doc=r""" maximum value for sizeOutput. Set to the number of declared constraints by default (topology->getNumberOfConstraints()); This value is used to allocate memory for M during initialize call. The best choice is to set maxSize to the estimated maximum dimension of the problem. It must not exceed ... """) _nslawtype = property(_sicpykernel.OneStepNSProblem__nslawtype_get, _sicpykernel.OneStepNSProblem__nslawtype_set) _hasBeenUpdated = property(_sicpykernel.OneStepNSProblem__hasBeenUpdated_get, _sicpykernel.OneStepNSProblem__hasBeenUpdated_set) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor from a pre-defined solver options set. :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == OneStepNSProblem: _self = None else: _self = self _sicpykernel.OneStepNSProblem_swiginit(self, _sicpykernel.new_OneStepNSProblem(_self, *args)) __swig_destroy__ = _sicpykernel.delete_OneStepNSProblem
[docs] def numericsSolverOptions(self) -> "SP::SolverOptions": r""" To get the SolverOptions structure :rtype: :py:class:`SolverOptions` :return: , the numerics structure used to save solver parameters """ return _sicpykernel.OneStepNSProblem_numericsSolverOptions(self)
[docs] def getSizeOutput(self) -> "unsigned int": r""" returns the dimension of the nonsmooth problem""" return _sicpykernel.OneStepNSProblem_getSizeOutput(self)
[docs] def simulation(self) -> "SP::Simulation": r""" get the simulation which owns this nonsmooth problem :rtype: :py:class:`Simulation` :return: a pointer on Simulation """ return _sicpykernel.OneStepNSProblem_simulation(self)
[docs] def setSimulationPtr(self, newS: "SP::Simulation") -> "void": r""" set the Simulation of the OneStepNSProblem :type newS: :py:class:`Simulation` :param newS: a pointer to Simulation """ return _sicpykernel.OneStepNSProblem_setSimulationPtr(self, newS)
[docs] def indexSetLevel(self) -> "unsigned int": r""" get indexSetLevel :rtype: int :return: an unsigned int """ return _sicpykernel.OneStepNSProblem_indexSetLevel(self)
[docs] def setIndexSetLevel(self, newVal: "unsigned int") -> "void": r""" set the value of level min :type newVal: int :param newVal: an unsigned int """ return _sicpykernel.OneStepNSProblem_setIndexSetLevel(self, newVal)
[docs] def inputOutputLevel(self) -> "unsigned int": r""" get the Input/Output level :rtype: int :return: an unsigned int """ return _sicpykernel.OneStepNSProblem_inputOutputLevel(self)
[docs] def setInputOutputLevel(self, newVal: "unsigned int") -> "void": r""" set the value of Input/Output level :type newVal: int :param newVal: an unsigned int """ return _sicpykernel.OneStepNSProblem_setInputOutputLevel(self, newVal)
[docs] def maxSize(self) -> "unsigned int": r""" get maximum value allowed for the dimension of the problem :rtype: int :return: an unsigned int """ return _sicpykernel.OneStepNSProblem_maxSize(self)
[docs] def setMaxSize(self, newVal: "unsigned int const") -> "void": r""" set the value of maxSize :type newVal: int :param newVal: an unsigned int """ return _sicpykernel.OneStepNSProblem_setMaxSize(self, newVal)
[docs] def setNumericsVerboseMode(self, vMode: "bool") -> "void": r""" Turn on/off verbose mode in numerics solver""" return _sicpykernel.OneStepNSProblem_setNumericsVerboseMode(self, vMode)
[docs] def setNumericsVerboseLevel(self, level: "int") -> "void": r""" set the verbose level in numerics solver""" return _sicpykernel.OneStepNSProblem_setNumericsVerboseLevel(self, level)
[docs] def hasInteractions(self) -> "bool": r""" Check if the OSNSPb has interactions :rtype: boolean :return: bool = true if the osnsp has interactions, i.e. indexSet(_indexSetLevel)->size >0 """ return _sicpykernel.OneStepNSProblem_hasInteractions(self)
def display(self) -> "void": return _sicpykernel.OneStepNSProblem_display(self)
[docs] def displayBlocks(self, indexSet: "SP::InteractionsGraph") -> "void": r""" Display the set of blocks for a given indexSet :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the concerned index set """ return _sicpykernel.OneStepNSProblem_displayBlocks(self, indexSet)
[docs] def updateInteractionBlocks(self) -> "void": r""" compute interactionBlocks if necessary (this depends on the type of OSNS, on the indexSets ...) """ return _sicpykernel.OneStepNSProblem_updateInteractionBlocks(self)
[docs] def computeInteractionBlock(self, ed: "InteractionsGraph::EDescriptor const &") -> "void": r""" compute extra-diagonal interactionBlock-matrix :type ed: InteractionsGraph::EDescriptor :param ed: an edge descriptor """ return _sicpykernel.OneStepNSProblem_computeInteractionBlock(self, ed)
[docs] def computeDiagonalInteractionBlock(self, vd: "InteractionsGraph::VDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::VDescriptor :param vd: a vertex descriptor """ return _sicpykernel.OneStepNSProblem_computeDiagonalInteractionBlock(self, vd)
[docs] def hasBeenUpdated(self) -> "bool": r""" :rtype: boolean :return: bool _hasBeenUpdated """ return _sicpykernel.OneStepNSProblem_hasBeenUpdated(self)
[docs] def setHasBeenUpdated(self, v: "bool") -> "void": r""" turn activation flag :type v: boolean :param v: to set _hasBeenUpdated. """ return _sicpykernel.OneStepNSProblem_setHasBeenUpdated(self, v)
[docs] def initialize(self, sim: "SP::Simulation") -> "void": r""" initialize the problem (topology and so on) :type sim: :py:class:`Simulation` :param sim: the simulation that owns this OSNSPB """ return _sicpykernel.OneStepNSProblem_initialize(self, sim)
[docs] def preCompute(self, time: "double") -> "bool": r""" prepare data of the osns for solving :type time: float :param time: the current time :rtype: boolean :return: true if the computation of the OSNS has to be carry on, false otherwise """ return _sicpykernel.OneStepNSProblem_preCompute(self, time)
[docs] def compute(self, time: "double") -> "int": r""" To run the solver for ns problem :type time: float :param time: current time :rtype: int :return: int information about the solver convergence. """ return _sicpykernel.OneStepNSProblem_compute(self, time)
[docs] def postCompute(self) -> "void": r""" post treatment for output of the solver""" return _sicpykernel.OneStepNSProblem_postCompute(self)
[docs] def setSolverId(self, solverId: "int") -> "void": r""" change the solver type and its default parameters - clear memory for the existing options set - create and initialize a new one :type solverId: int :param solverId: the new solver """ return _sicpykernel.OneStepNSProblem_setSolverId(self, solverId)
[docs] def getOSIMatrix(self, osi: "OneStepIntegrator", ds: "SP::DynamicalSystem") -> "SP::SimpleMatrix": r""" get the OSI-related matrices used to compute the current InteractionBlock (Ex: for MoreauJeanOSI, W) :type osi: :py:class:`OneStepIntegrator` :param osi: the OSI of the concerned dynamical system :type ds: :py:class:`DynamicalSystem` :param ds: the concerned dynamical system :rtype: :py:class:`SimpleMatrix` :return: the required matrix """ return _sicpykernel.OneStepNSProblem_getOSIMatrix(self, osi, ds)
def __disown__(self): self.this.disown() _sicpykernel.disown_OneStepNSProblem(self) return weakref.proxy(self)
# Register OneStepNSProblem in _sicpykernel: _sicpykernel.OneStepNSProblem_swigregister(OneStepNSProblem)
[docs] class OneStepIntegrator(object): r""" Generic class to manage DynamicalSystem(s) time-integration This is a virtual class, interface for some specific integrators. At the time, available integrators are: - EulerMoreauOSI - MoreauJeanOSI - MoreauJeanCombinedProjectionOSI - MoreauJeanDirectProjectionOSI - MoreauJeanBilbaoOSI - D1MinusLinearOSI - SchatzmanPaoliOSI - LsodarOSI - Hem5OSI - NewMarkAlphaOSI - ZeroOrderHoldOSI """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _integratorType = property(_sicpykernel.OneStepIntegrator__integratorType_get, _sicpykernel.OneStepIntegrator__integratorType_set, doc=r""" type/name of the Integrator""") _dynamicalSystemsGraph = property(_sicpykernel.OneStepIntegrator__dynamicalSystemsGraph_get, _sicpykernel.OneStepIntegrator__dynamicalSystemsGraph_set, doc=r""" a graph of dynamical systems to integrate For the moment, we point to the graph of dynamical systems in the topology. We use the properties "osi" to check if the dynamical system is integrated by this osi. It has to be improved by using a subgraph to avoid the use of checkOSI """) _sizeMem = property(_sicpykernel.OneStepIntegrator__sizeMem_get, _sicpykernel.OneStepIntegrator__sizeMem_set, doc=r""" size of the memory for the integrator""") _steps = property(_sicpykernel.OneStepIntegrator__steps_get, _sicpykernel.OneStepIntegrator__steps_set, doc=r""" steps of the integrator""") _levelMinForOutput = property(_sicpykernel.OneStepIntegrator__levelMinForOutput_get, _sicpykernel.OneStepIntegrator__levelMinForOutput_set, doc=r""" _levelMinForOutput is the minimum level for the output needed by the OneStepIntegrator """) _levelMaxForOutput = property(_sicpykernel.OneStepIntegrator__levelMaxForOutput_get, _sicpykernel.OneStepIntegrator__levelMaxForOutput_set, doc=r""" _levelMaxForOutput is the maximum level for the output needed by the OneStepIntegrator """) _levelMinForInput = property(_sicpykernel.OneStepIntegrator__levelMinForInput_get, _sicpykernel.OneStepIntegrator__levelMinForInput_set, doc=r""" _levelMinForInput is the minimum level for the input needed by the OneStepIntegrator """) _levelMaxForInput = property(_sicpykernel.OneStepIntegrator__levelMaxForInput_get, _sicpykernel.OneStepIntegrator__levelMaxForInput_set, doc=r""" _levelMaxForInput is the maximum level for the input needed by the OneStepIntegrator """) _isInitialized = property(_sicpykernel.OneStepIntegrator__isInitialized_get, _sicpykernel.OneStepIntegrator__isInitialized_set) _explicitJacobiansOfRelation = property(_sicpykernel.OneStepIntegrator__explicitJacobiansOfRelation_get, _sicpykernel.OneStepIntegrator__explicitJacobiansOfRelation_set, doc=r""" boolean variable to force an explicit evaluation of the Jacobians mapping of relations only at the beginning of the time--step and not in the Newton iteration """) _simulation = property(_sicpykernel.OneStepIntegrator__simulation_get, _sicpykernel.OneStepIntegrator__simulation_set, doc=r""" A link to the simulation that owns this OSI""") _extraAdditionalTerms = property(_sicpykernel.OneStepIntegrator__extraAdditionalTerms_get, _sicpykernel.OneStepIntegrator__extraAdditionalTerms_set, doc=r""" struct to add terms in the integration. Useful for Control""") def _check_and_update_interaction_levels(self, inter: "Interaction") -> "void": r""" Compare interaction and current OSI levels for input and output. Reset interaction if they are not compliant. :type inter: :py:class:`Interaction` :param inter: a reference to an Interaction """ return _sicpykernel.OneStepIntegrator__check_and_update_interaction_levels(self, inter) def _initializeDSWorkVectors(self, ds: "SP::DynamicalSystem") -> "SP::VectorOfVectors": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi -- common code. :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.OneStepIntegrator__initializeDSWorkVectors(self, ds) def __init__(self, *args): r""" *Overload 1:* basic constructor with OSI Id :type type: OSI::TYPES :param type: integrator type/name | *Overload 2:* default constructor """ if self.__class__ == OneStepIntegrator: _self = None else: _self = self _sicpykernel.OneStepIntegrator_swiginit(self, _sicpykernel.new_OneStepIntegrator(_self, *args)) __swig_destroy__ = _sicpykernel.delete_OneStepIntegrator
[docs] def getType(self) -> "OSI::TYPES": r""" :rtype: OSI::TYPES :return: the id of the integrator (see list in OSI::TYPES enum) """ return _sicpykernel.OneStepIntegrator_getType(self)
[docs] def dynamicalSystemsGraph(self) -> "SP::DynamicalSystemsGraph": r""" get the graph of dynamical systems associated with the Integrator warning: returns the whole ds graph, not only ds integrated by the present osi. :rtype: :py:class:`DynamicalSystemsGraph` :return: a SP::DynamicalSystemsGraph """ return _sicpykernel.OneStepIntegrator_dynamicalSystemsGraph(self)
[docs] def setDynamicalSystemsGraph(self, dsg: "SP::DynamicalSystemsGraph") -> "void": r""" set the graph of dynamical systems associated with the Integrator""" return _sicpykernel.OneStepIntegrator_setDynamicalSystemsGraph(self, dsg)
[docs] def getSizeMem(self) -> "unsigned int": r""" get number of internal memory vectors needed in dynamical systems integrated with this osi. :rtype: int :return: an unsigned int """ return _sicpykernel.OneStepIntegrator_getSizeMem(self)
[docs] def simulation(self) -> "SP::Simulation": r""" get the Simulation that owns the OneStepIntegrator (pointer link) :rtype: :py:class:`Simulation` :return: a pointer to Simulation """ return _sicpykernel.OneStepIntegrator_simulation(self)
[docs] def setSimulationPtr(self, newS: "SP::Simulation") -> "void": r""" set the Simulation of the OneStepIntegrator :type newS: :py:class:`Simulation` :param newS: a pointer to Simulation """ return _sicpykernel.OneStepIntegrator_setSimulationPtr(self, newS)
[docs] def levelMinForOutput(self) -> "unsigned int": r""" minimal level required for output var used with this integration scheme. var[level] is the derivative of order 'level' of var. """ return _sicpykernel.OneStepIntegrator_levelMinForOutput(self)
[docs] def levelMaxForOutput(self) -> "unsigned int": r""" maximal level required for output var used with this integration scheme. var[level] is the derivative of order 'level' of var. """ return _sicpykernel.OneStepIntegrator_levelMaxForOutput(self)
[docs] def levelMinForInput(self) -> "unsigned int": r""" minimal level required for input var used with this integration scheme. var[level] is the derivative of order 'level' of var. """ return _sicpykernel.OneStepIntegrator_levelMinForInput(self)
[docs] def levelMaxForInput(self) -> "unsigned int": r""" maximal level required for input var used with this integration scheme. var[level] is the derivative of order 'level' of var. """ return _sicpykernel.OneStepIntegrator_levelMaxForInput(self)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.OneStepIntegrator_numberOfIndexSets(self)
def isInitialized(self) -> "bool": return _sicpykernel.OneStepIntegrator_isInitialized(self) def setIsInitialized(self, value: "bool") -> "void": return _sicpykernel.OneStepIntegrator_setIsInitialized(self, value) def explicitJacobiansOfRelation(self) -> "bool": return _sicpykernel.OneStepIntegrator_explicitJacobiansOfRelation(self) def setExplicitJacobiansOfRelation(self, newval: "bool") -> "void": return _sicpykernel.OneStepIntegrator_setExplicitJacobiansOfRelation(self, newval)
[docs] def initialize(self) -> "void": r""" initialise the integrator""" return _sicpykernel.OneStepIntegrator_initialize(self)
[docs] def initialize_nonsmooth_problems(self) -> "void": r""" Initialization process of the nonsmooth problems linked to this OSI """ return _sicpykernel.OneStepIntegrator_initialize_nonsmooth_problems(self)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.OneStepIntegrator_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.OneStepIntegrator_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def UpdateAndSwapAllOutput(self, *args) -> "void": r""" *Overload 1:* compute interaction output (y) for all levels and swaps in memory :type time: float :param time: value for output computation :param interaction_properties: properties of the interaction, in the Interaction Graph I0 | *Overload 2:* compute interaction output (y) for all levels and swaps in memory :type inter: :py:class:`Interaction` :param inter: the interaction to update :type time: float :param time: value for output computation :param interaction_properties: properties of the interaction, in the Interaction Graph I0 """ return _sicpykernel.OneStepIntegrator_UpdateAndSwapAllOutput(self, *args)
[docs] def computeInitialNewtonState(self) -> "void": r""" compute the initial state (for dynamical system variables) of the Newton loop.""" return _sicpykernel.OneStepIntegrator_computeInitialNewtonState(self)
[docs] def computeResidu(self) -> "double": r""" return the maximum of all norms for the discretized residus of DS :rtype: float :return: a double """ return _sicpykernel.OneStepIntegrator_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" integrates the Dynamical System linked to this integrator, without taking constraints into account. """ return _sicpykernel.OneStepIntegrator_computeFreeState(self)
[docs] def computeFreeOutput(self, vertex_inter: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" integrates the Interaction linked to this integrator, without taking non-smooth effects into account :type vertex_inter: InteractionsGraph::VDescriptor :param vertex_inter: of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: pointer to OneStepNSProblem """ return _sicpykernel.OneStepIntegrator_computeFreeOutput(self, vertex_inter, osnsp)
[docs] def computeResiduOutput(self, time: "double", indexSet: "SP::InteractionsGraph") -> "double": r""" compute the residu of the output of the relation (y) This computation depends on the type of OSI :type time: float :param time: time of computation :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the interaction that are concerned """ return _sicpykernel.OneStepIntegrator_computeResiduOutput(self, time, indexSet)
[docs] def computeResiduInput(self, time: "double", indexSet: "SP::InteractionsGraph") -> "double": r""" compute the residu of the input of the relation (R or p) This computation depends on the type of OSI :type time: float :param time: time of computation :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the interaction that are concerned """ return _sicpykernel.OneStepIntegrator_computeResiduInput(self, time, indexSet)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", idid: "int &") -> "void": r""" integrate the system, between tinit and tend, with possible stop at tout :type tinit: float :param tinit: start time :type tend: float :param tend: expected end time :type tout: float :param tout: real end time :type idid: int :param idid: extra flag, meaningful only for OSI used in EventDriven schemes """ return _sicpykernel.OneStepIntegrator_integrate(self, tinit, tend, tout, idid)
[docs] def resetAllNonSmoothParts(self) -> "void": r""" set to zero all the r vectors of the DynamicalSystems integrated by this OSI""" return _sicpykernel.OneStepIntegrator_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void": r""" set to zero all the r vectors of the DynamicalSystems of the present OSI for a given level :type level: int :param level: """ return _sicpykernel.OneStepIntegrator_resetNonSmoothPart(self, level)
[docs] def updateState(self, *args) -> "void": r""" *Overload 1:* update the state of the DynamicalSystem attached to this Integrator :type level: int :param level: level of interest for the dynamics level is set to 0 by default since in all time-stepping schemes we update all the state whatever the value of level | *Overload 2:* update the state of the DynamicalSystem attached to this Integrator level is set to 0 by default since in all time-stepping schemes we update all the state whatever the value of level """ return _sicpykernel.OneStepIntegrator_updateState(self, *args)
[docs] def updateOutput(self, *args) -> "void": r""" *Overload 1:* update the output of the Interaction attached to this Integrator | *Overload 2:* update the output of the Interaction attached to this Integrator :type time: float :param time: current time :type level: int :param level: level of interest for the dynamics """ return _sicpykernel.OneStepIntegrator_updateOutput(self, *args)
[docs] def updateInput(self, *args) -> "void": r""" *Overload 1:* update the input of the Interaction attached to this Integrator | *Overload 2:* update the input of the Interaction attached to this Integrator :type time: float :param time: current time :type level: int :param level: level of interest for the dynamics Warning: VA: 27/10/2022 Whatever the level, the updateInput method loops over indexSet0 This is sometimes necessary for some OSI but for some others it may burden the computational time for nothing. For instance, in standard MoreauJEANOSI, p[1] is only defined on indexSet1. we should go towards virtual void updateInput(double time, unsigned int pLevel, unsigned int indexSetLevel ); """ return _sicpykernel.OneStepIntegrator_updateInput(self, *args)
def prepareNewtonIteration(self, time: "double") -> "void": return _sicpykernel.OneStepIntegrator_prepareNewtonIteration(self, time)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.OneStepIntegrator_display(self)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: :type i: int :param i: :rtype: boolean :return: bool """ return _sicpykernel.OneStepIntegrator_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to know if is it should be removed from the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: :type i: int :param i: :rtype: boolean :return: bool """ return _sicpykernel.OneStepIntegrator_removeInteractionFromIndexSet(self, inter, i)
[docs] def extraAdditionalTerms(self) -> "SP::ExtraAdditionalTerms": r""" get the ExtraAdditionalTerms. :rtype: SP::ExtraAdditionalTerms :return: the ExtraAdditionalTerms """ return _sicpykernel.OneStepIntegrator_extraAdditionalTerms(self)
[docs] def setExtraAdditionalTerms(self, eat: "SP::ExtraAdditionalTerms") -> "void": r""" set the ExtraAdditionalTerms to add smooth terms for the integration process. Useful when a control loop is added to a DynamicalSystem. :type eat: SP::ExtraAdditionalTerms :param eat: the ExtraAdditionalTerms to use """ return _sicpykernel.OneStepIntegrator_setExtraAdditionalTerms(self, eat)
[docs] def checkOSI(self, *args) -> "bool": r""" *Overload 1:* True if the dynamical system (a vertex in the ds graph) is integrated by this osi. :type dsi: DynamicalSystemsGraph::VIterator :param dsi: the iterator on the node of the graph corresponding to the dynamical system of interest. | *Overload 2:* True if the dynamical system (a vertex in the ds graph) is integrated by this osi. :type dsgv: DynamicalSystemsGraph::VDescriptor :param dsgv: the descriptor of the node in the graph corresponding to the dynamical system of interest. """ return _sicpykernel.OneStepIntegrator_checkOSI(self, *args)
[docs] def checkInteractionOSI(self, indexSet0: "InteractionsGraph", ui: "InteractionsGraph::VIterator") -> "bool": r""" True if the dynamical system (a vertex in the ds graph) is integrated by this osi. :param dsi: the iterator on the node of the graph corresponding to the dynamical system of interest. """ return _sicpykernel.OneStepIntegrator_checkInteractionOSI(self, indexSet0, ui)
def __disown__(self): self.this.disown() _sicpykernel.disown_OneStepIntegrator(self) return weakref.proxy(self)
# Register OneStepIntegrator in _sicpykernel: _sicpykernel.OneStepIntegrator_swigregister(OneStepIntegrator) REDUCED_BLOCK = _sicpykernel.REDUCED_BLOCK GLOBAL = _sicpykernel.GLOBAL REDUCED_DIRECT = _sicpykernel.REDUCED_DIRECT GLOBAL_REDUCED = _sicpykernel.GLOBAL_REDUCED
[docs] class LinearOSNS(OneStepNSProblem): r""" Base (abstract) class for linear non-smooth problems Usually in the form: :math:`w = q + M z` where - :math:`w \in R^{n}` and :math:`z \in R^{n}` are the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` examples: LCP, FrictionContact ... """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _w = property(_sicpykernel.LinearOSNS__w_get, _sicpykernel.LinearOSNS__w_set, doc=r""" vector w of a LinearOSNS system""") _z = property(_sicpykernel.LinearOSNS__z_get, _sicpykernel.LinearOSNS__z_set, doc=r""" vector z of a LinearOSNS system""") _M = property(_sicpykernel.LinearOSNS__M_get, _sicpykernel.LinearOSNS__M_set, doc=r""" matrix M of a LinearOSNS system""") _q = property(_sicpykernel.LinearOSNS__q_get, _sicpykernel.LinearOSNS__q_set, doc=r""" vector q of a LinearOSNS system""") _W = property(_sicpykernel.LinearOSNS__W_get, _sicpykernel.LinearOSNS__W_set, doc=r""" matrix W of a LinearOSNS system""") _W_inverse = property(_sicpykernel.LinearOSNS__W_inverse_get, _sicpykernel.LinearOSNS__W_inverse_set, doc=r""" matrix W of a LinearOSNS system""") _H = property(_sicpykernel.LinearOSNS__H_get, _sicpykernel.LinearOSNS__H_set, doc=r""" matrix H of a LinearOSNS system""") _assemblyType = property(_sicpykernel.LinearOSNS__assemblyType_get, _sicpykernel.LinearOSNS__assemblyType_set, doc=r""" Assembly strategy""") _numericsMatrixStorageType = property(_sicpykernel.LinearOSNS__numericsMatrixStorageType_get, _sicpykernel.LinearOSNS__numericsMatrixStorageType_set, doc=r""" Storage type for M - NM_DENSE: SiconosMatrix (dense), NM_SPARSE_BLOCK: Sparse Storage (embedded into OSNSMatrix) """) _keepLambdaAndYState = property(_sicpykernel.LinearOSNS__keepLambdaAndYState_get, _sicpykernel.LinearOSNS__keepLambdaAndYState_set, doc=r""" a boolean to decide if _w and _z vectors are initialized with previous values of Y and Lambda when a change occurs in problem size """) def __init__(self, *args): r""" *Overload 1:* default constructor (private) | *Overload 2:* constructor from a pre-defined solver options set. :type options: :py:class:`SolverOptions` :param options: the options set :param assemblytype: the method used to build the assembled matrix - default=REDUCED_BLOCK | *Overload 3:* constructor from a pre-defined solver options set. :type options: :py:class:`SolverOptions` :param options: the options set :param assemblytype: the method used to build the assembled matrix - default=REDUCED_BLOCK """ if self.__class__ == LinearOSNS: _self = None else: _self = self _sicpykernel.LinearOSNS_swiginit(self, _sicpykernel.new_LinearOSNS(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LinearOSNS
[docs] def getW(self) -> "SiconosVector const": r""" copy of the current value of vector w :rtype: :py:class:`SiconosVector` :return: a SiconosVector """ return _sicpykernel.LinearOSNS_getW(self)
[docs] def w(self) -> "SP::SiconosVector": r""" current w vector (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LinearOSNS_w(self)
[docs] def setWPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set w vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: the new SP::SiconosVector """ return _sicpykernel.LinearOSNS_setWPtr(self, newPtr)
[docs] def getz(self) -> "SiconosVector const": r""" copy of the current value of vector z :rtype: :py:class:`SiconosVector` :return: a SiconosVector """ return _sicpykernel.LinearOSNS_getz(self)
[docs] def z(self) -> "SP::SiconosVector": r""" current z vector (pointer link) :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LinearOSNS_z(self)
[docs] def setzPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set z vector (pointer link) :type newPtr: :py:class:`SiconosVector` :param newPtr: the new SP::SiconosVector """ return _sicpykernel.LinearOSNS_setzPtr(self, newPtr)
[docs] def M(self) -> "SP::OSNSMatrix": r""" M matrix (pointer link) :rtype: :py:class:`OSNSMatrix` :return: pointer on a OSNSMatrix """ return _sicpykernel.LinearOSNS_M(self)
[docs] def setMPtr(self, newM: "SP::OSNSMatrix") -> "void": r""" set M to pointer newPtr :type newM: :py:class:`OSNSMatrix` :param newM: the new M matrix """ return _sicpykernel.LinearOSNS_setMPtr(self, newM)
[docs] def H(self) -> "SP::OSNSMatrix": r""" get H :rtype: :py:class:`OSNSMatrix` :return: pointer on a OSNSMatrix """ return _sicpykernel.LinearOSNS_H(self)
[docs] def setH(self, H: "SP::OSNSMatrix") -> "void": r""" set the value of H :type H: :py:class:`OSNSMatrix` :param H: the new matrix """ return _sicpykernel.LinearOSNS_setH(self, H)
[docs] def getQ(self) -> "SiconosVector const": r""" get the value of q, the constant vector in the LinearOSNS :rtype: :py:class:`SiconosVector` :return: SiconosVector """ return _sicpykernel.LinearOSNS_getQ(self)
[docs] def q(self) -> "SP::SiconosVector": r""" get q, the the constant vector in the LinearOSNS :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.LinearOSNS_q(self)
[docs] def setQPtr(self, newQ: "SP::SiconosVector") -> "void": r""" set q to pointer newPtr :type newQ: :py:class:`SiconosVector` :param newQ: the new q vector """ return _sicpykernel.LinearOSNS_setQPtr(self, newQ)
[docs] def getMStorageType(self) -> "NM_types": r""" get the type of storage used for M :rtype: int :return: NM_types (NM_DENSE, NM_SPARSE_BLOCK) """ return _sicpykernel.LinearOSNS_getMStorageType(self)
[docs] def setMStorageType(self, i: "NM_types") -> "void": r""" set which type of storage will be used for M Warning: this function does not allocate any memory for M, it just sets an indicator for future use :type i: int :param i: (NM_DENSE, NM_SPARSE_BLOCK) """ return _sicpykernel.LinearOSNS_setMStorageType(self, i)
[docs] def setAssemblyType(self, assemblyType: "LINEAROSNS_ASSEMBLY_TYPE") -> "void": r""" set which type of assembly will be used for M""" return _sicpykernel.LinearOSNS_setAssemblyType(self, assemblyType)
[docs] def initVectorsMemory(self) -> "void": r""" Memory allocation or resizing for z,w,q""" return _sicpykernel.LinearOSNS_initVectorsMemory(self)
[docs] def initOSNSMatrix(self) -> "void": r""" initialize the _M matrix""" return _sicpykernel.LinearOSNS_initOSNSMatrix(self)
[docs] def initialize(self, sim: "SP::Simulation") -> "void": r""" To initialize the LinearOSNS problem(computes topology ...) :type sim: :py:class:`Simulation` :param sim: the simulation owning this OSNSPB """ return _sicpykernel.LinearOSNS_initialize(self, sim)
[docs] def computeInteractionBlock(self, ed: "InteractionsGraph::EDescriptor const &") -> "void": r""" compute extra-diagonal interactionBlock-matrix :type ed: InteractionsGraph::EDescriptor :param ed: an edge descriptor """ return _sicpykernel.LinearOSNS_computeInteractionBlock(self, ed)
[docs] def computeDiagonalInteractionBlock(self, vd: "InteractionsGraph::VDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::VDescriptor :param vd: a vertex descriptor """ return _sicpykernel.LinearOSNS_computeDiagonalInteractionBlock(self, vd)
[docs] def computeM(self) -> "void": r""" compute matrix M""" return _sicpykernel.LinearOSNS_computeM(self)
[docs] def computeqBlock(self, vertex: "InteractionsGraph::VDescriptor &", pos: "unsigned int") -> "void": r""" To compute a part of the q vector of the OSNS :type vertex: InteractionsGraph::VDescriptor :param vertex: vertex (interaction) which corresponds to the considered block :type pos: int :param pos: the position of the first element of yOut to be set """ return _sicpykernel.LinearOSNS_computeqBlock(self, vertex, pos)
[docs] def computeq(self, time: "double") -> "void": r""" compute vector q :type time: float :param time: the current time """ return _sicpykernel.LinearOSNS_computeq(self, time)
[docs] def preCompute(self, time: "double") -> "bool": r""" build problem coefficients (if required) :type time: float :param time: the current time :rtype: boolean :return: true if the indexSet is not empty """ return _sicpykernel.LinearOSNS_preCompute(self, time)
[docs] def postCompute(self) -> "void": r""" update interactions variables (y and lambda) according to current problem found solutions. """ return _sicpykernel.LinearOSNS_postCompute(self)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.LinearOSNS_display(self)
[docs] def setKeepLambdaAndYState(self, val: "bool") -> "void": r""" choose initialisation behavior for w and z. :type val: boolean :param val: true: init w and z with previous values of y and lambda saved in interactions, false: init to 0. """ return _sicpykernel.LinearOSNS_setKeepLambdaAndYState(self, val)
def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": return _sicpykernel.LinearOSNS_checkCompatibleNSLaw(self, nslaw) def __disown__(self): self.this.disown() _sicpykernel.disown_LinearOSNS(self) return weakref.proxy(self)
# Register LinearOSNS in _sicpykernel: _sicpykernel.LinearOSNS_swigregister(LinearOSNS)
[docs] class LsodarOSI(OneStepIntegrator): r""" LsodarOSI solver (odepack) Many parameters are required as input/output for LSODAR. See the documentation of this function in externals/odepack/opkdmain.f to have a full description of these parameters. Most of them are read-only parameters (ie can not be set by user). Except: - jt: Jacobian type indicator (1 means a user-supplied full Jacobian, 2 means an internally generated full Jacobian). Default = 2. - itol, rtol and atol ITOL = an indicator for the type of error control. RTOL = a relative error tolerance parameter, either a scalar or array of length NEQ. ATOL = an absolute error tolerance parameter, either a scalar or an array of length NEQ. Input only. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr FREE = _sicpykernel.LsodarOSI_FREE WORK_LENGTH = _sicpykernel.LsodarOSI_WORK_LENGTH OSNSP_RHS = _sicpykernel.LsodarOSI_OSNSP_RHS WORK_INTERACTION_LENGTH = _sicpykernel.LsodarOSI_WORK_INTERACTION_LENGTH xfree = _sicpykernel.LsodarOSI_xfree BLOCK_WORK_LENGTH = _sicpykernel.LsodarOSI_BLOCK_WORK_LENGTH count_NST = property(_sicpykernel.LsodarOSI_count_NST_get, _sicpykernel.LsodarOSI_count_NST_set, doc=r""" Lsodar counter : Number of steps taken for the problem so far.""") count_NFE = property(_sicpykernel.LsodarOSI_count_NFE_get, _sicpykernel.LsodarOSI_count_NFE_set, doc=r""" Number of RHS evaluations for the problem so far.""") def __init__(self): r""" Default constructor""" if self.__class__ == LsodarOSI: _self = None else: _self = self _sicpykernel.LsodarOSI_swiginit(self, _sicpykernel.new_LsodarOSI(_self, )) __swig_destroy__ = _sicpykernel.delete_LsodarOSI
[docs] def intData(self, *args) -> "integer": r""" *Overload 1:* get vector of integer parameters for lsodar :rtype: std::vector< integer,std::allocator< integer > > :return: a vector<integer> | *Overload 2:* get _intData[i] :type i: int :param i: index number (starting from 0) :rtype: int :return: an integer """ return _sicpykernel.LsodarOSI_intData(self, *args)
[docs] def setIntData(self, i: "unsigned int", newValue: "int") -> "void": r""" set _intData[i] :type i: int :param i: index number (starting from 0) :type newValue: int :param newValue: the new value """ return _sicpykernel.LsodarOSI_setIntData(self, i, newValue)
[docs] def getRtol(self) -> "SA::doublereal const": r""" get relative tolerance parameter for lsodar :rtype: SA::doublereal :return: a doublereal* """ return _sicpykernel.LsodarOSI_getRtol(self)
[docs] def getAtol(self) -> "SA::doublereal const": r""" get absolute tolerance parameter for lsodar :rtype: SA::doublereal :return: a doublereal* """ return _sicpykernel.LsodarOSI_getAtol(self)
[docs] def getMaxNstep(self) -> "int": r""" get the maximum number of steps for one call :rtype: int :return: an interger """ return _sicpykernel.LsodarOSI_getMaxNstep(self)
[docs] def getRwork(self) -> "SA::doublereal const": r""" get real work vector parameter for lsodar :rtype: SA::doublereal :return: a doublereal* """ return _sicpykernel.LsodarOSI_getRwork(self)
[docs] def getIwork(self) -> "SA::integer": r""" get iwork :rtype: SA::integer :return: a pointer to integer """ return _sicpykernel.LsodarOSI_getIwork(self)
[docs] def getJroot(self) -> "SA::integer": r""" get output of root information :rtype: SA::integer :return: a pointer to integer """ return _sicpykernel.LsodarOSI_getJroot(self)
[docs] def setJT(self, newJT: "integer") -> "void": r""" set Jt value, Jacobian type indicator. Excerpts from the lsodar documentation. 1 means a user-supplied full (neq by neq) jacobian. 2 means an internally generated (difference quotient) full jacobian (using neq extra calls to f per df/dy value). 4 means a user-supplied banded jacobian. 5 means an internally generated banded jacobian (using ml+mu+1 extra calls to f per df/dy evaluation). if jt = 1 or 4, the user must supply a subroutine jac (the name is arbitrary) as described above under jac. if jt = 2 or 5, a dummy argument can be used. :type newJT: int :param newJT: new value for the jt parameter. """ return _sicpykernel.LsodarOSI_setJT(self, newJT)
[docs] def setTol(self, *args) -> "void": r""" *Overload 1:* set itol, rtol and atol (tolerance parameters for lsodar) :type newItol: int :param newItol: itol value :type newRtol: SA::doublereal :param newRtol: rtol value :type newAtol: SA::doublereal :param newAtol: atol value | *Overload 2:* set itol, rtol and atol (scalar tolerance parameters for lsodar) :type newItol: int :param newItol: itol value :type newRtol: float :param newRtol: rtol value :type newAtol: float :param newAtol: atol value """ return _sicpykernel.LsodarOSI_setTol(self, *args)
[docs] def setMaxNstep(self, maxNumberSteps: "integer") -> "void": r""" set the maximum number of steps for one call of Lsodar :type maxNumberSteps: int :param maxNumberSteps: the maximum number of steps """ return _sicpykernel.LsodarOSI_setMaxNstep(self, maxNumberSteps)
[docs] def setMinMaxStepSizes(self, minStep: "doublereal", maxStep: "doublereal") -> "void": r""" set the minimum and maximum step sizes :type minStep: float :param minStep: minimum step size :type maxStep: float :param maxStep: maximum step size """ return _sicpykernel.LsodarOSI_setMinMaxStepSizes(self, minStep, maxStep)
[docs] def setMaxOrder(self, maxorderNonStiff: "integer", maxorderStiff: "integer") -> "void": r""" set maximum method order :type maxorderNonStiff: int :param maxorderNonStiff: maximum order for nonstiff methods :type maxorderStiff: int :param maxorderStiff: maximum order for stiff methods """ return _sicpykernel.LsodarOSI_setMaxOrder(self, maxorderNonStiff, maxorderStiff)
[docs] def updateData(self) -> "void": r""" update doubleData and iwork memory size, when changes occur in _intData.""" return _sicpykernel.LsodarOSI_updateData(self)
[docs] def fillXWork(self, size: "integer *", array: "doublereal *") -> "void": r""" fill xWork with a doublereal :type size: int :param size: size of x array :type array: float :param array: x array of double """ return _sicpykernel.LsodarOSI_fillXWork(self, size, array)
[docs] def computeRhs(self, t: "double") -> "void": r""" compute rhs(t) for all dynamical systems in the set :type t: float :param t: current time of simulation """ return _sicpykernel.LsodarOSI_computeRhs(self, t)
[docs] def computeJacobianRhs(self, t: "double", DSG0: "DynamicalSystemsGraph") -> "void": r""" compute jacobian of the rhs at time t for all dynamical systems in the set :type t: float :param t: current time of simulation :type DSG0: :py:class:`DynamicalSystemsGraph` :param DSG0: the graph of DynamicalSystem """ return _sicpykernel.LsodarOSI_computeJacobianRhs(self, t, DSG0)
def f(self, sizeOfX: "integer *", time: "doublereal *", x: "doublereal *", xdot: "doublereal *") -> "void": return _sicpykernel.LsodarOSI_f(self, sizeOfX, time, x, xdot) def g(self, nEq: "integer *", time: "doublereal *", x: "doublereal *", ng: "integer *", gOut: "doublereal *") -> "void": return _sicpykernel.LsodarOSI_g(self, nEq, time, x, ng, gOut) def jacobianfx(self, arg2: "integer *", arg3: "doublereal *", arg4: "doublereal *", arg5: "integer *", arg6: "integer *", arg7: "doublereal *", arg8: "integer *") -> "void": return _sicpykernel.LsodarOSI_jacobianfx(self, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
[docs] def initialize(self) -> "void": r""" initialization of the integrator""" return _sicpykernel.LsodarOSI_initialize(self)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.LsodarOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.LsodarOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.LsodarOSI_numberOfIndexSets(self)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", ioparam: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: initial time :type tend: float :param tend: end time :type tout: float :param tout: real end time :type ioparam: int :param ioparam: in-out parameter, input: 1 for first call, else 2. Output: 2 if no root was found, else 3. """ return _sicpykernel.LsodarOSI_integrate(self, tinit, tend, tout, ioparam)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" update the state of the DynamicalSystems attached to this Integrator :type level: int :param level: level of interest for the dynamics """ return _sicpykernel.LsodarOSI_updateState(self, level)
def prepareNewtonIteration(self, time: "double") -> "void": return _sicpykernel.LsodarOSI_prepareNewtonIteration(self, time)
[docs] def computeFreeOutput(self, vertex_descr: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" integrates the Interaction linked to this integrator, without taking non-smooth effects into account :type vertex_descr: InteractionsGraph::VDescriptor :param vertex_descr: descriptor vertex of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: pointer to OneStepNSProblem """ return _sicpykernel.LsodarOSI_computeFreeOutput(self, vertex_descr, osnsp)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.LsodarOSI_display(self)
[docs] @staticmethod def count_rhs_call() -> "int": r""" Return current number of rhs call (for all lsodar-like OSIs!) :rtype: int :return: int """ return _sicpykernel.LsodarOSI_count_rhs_call()
[docs] @staticmethod def count_steps() -> "int": r""" Return the number of lsodar steps already done (for all lsodar-like OSIs!) :rtype: int :return: int """ return _sicpykernel.LsodarOSI_count_steps()
def __disown__(self): self.this.disown() _sicpykernel.disown_LsodarOSI(self) return weakref.proxy(self)
# Register LsodarOSI in _sicpykernel: _sicpykernel.LsodarOSI_swigregister(LsodarOSI)
[docs] def LsodarOSI_count_rhs_call() -> "int": r""" Return current number of rhs call (for all lsodar-like OSIs!) :rtype: int :return: int """ return _sicpykernel.LsodarOSI_count_rhs_call()
[docs] def LsodarOSI_count_steps() -> "int": r""" Return the number of lsodar steps already done (for all lsodar-like OSIs!) :rtype: int :return: int """ return _sicpykernel.LsodarOSI_count_steps()
[docs] class LCP(LinearOSNS): r""" Formalization and Resolution of a Linear Complementarity Problem (LCP) This class is devoted to the formalization and the resolution of the Linear Complementarity Problem (LCP) defined by : .. math:: w = q + M z \\ w \geq 0, z \geq 0, z^{T} w =0 where - :math:`w \in R^{n}` and :math:`z \in R^{n}` are the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` The LCP main components are: - a problem (variables M,q and size of the problem), which directly corresponds to the LinearComplementarityProblem structure of Numerics - the unknowns z and w For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _numerics_problem = property(_sicpykernel.LCP__numerics_problem_get, _sicpykernel.LCP__numerics_problem_set, doc=r""" Structure (for Numerics component) that describes the problem to solve""") def __init__(self, *args): r""" *Overload 1:* constructor from numerics solver id :type numericsSolverId: int, optional :param numericsSolverId: id of numerics solver, default = SICONOS_LCP_LEMKE | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == LCP: _self = None else: _self = self _sicpykernel.LCP_swiginit(self, _sicpykernel.new_LCP(_self, *args)) __swig_destroy__ = _sicpykernel.delete_LCP
[docs] def solve(self) -> "int": r""" Call numerics solver. :rtype: int :return: int information about the solver convergence (output from numerics driver, linearComplementarity_driver, check numerics doc. for details). """ return _sicpykernel.LCP_solve(self)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknowns z and w and update the corresponding Interactions (y and lambda ) :type time: float :param time: : current time :rtype: int :return: int, information about the solver convergence (output from numerics driver, linearComplementarity_driver, check numerics doc. for details). """ return _sicpykernel.LCP_compute(self, time)
def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": return _sicpykernel.LCP_checkCompatibleNSLaw(self, nslaw) def __disown__(self): self.this.disown() _sicpykernel.disown_LCP(self) return weakref.proxy(self)
# Register LCP in _sicpykernel: _sicpykernel.LCP_swigregister(LCP)
[docs] class AVI(LinearOSNS): r""" Formalization and Resolution of an Affine Variational Inequality (AVI) This class is devoted to the formalization and the resolution of Affine variational Inequalities (AVI): given a polytopic set :math:`P`, :math:`M\in R^{p\times p}` and :math:`q\in R^p`, .. math:: \text{find }z \in P\text{ such that}\quad \langle Mz+q, x - z\rangle \geq 0 \qquad \forall x \in P TODO: : add "recover" function to start from old values of z and w. For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _numerics_problem = property(_sicpykernel.AVI__numerics_problem_get, _sicpykernel.AVI__numerics_problem_set, doc=r""" contains the numerics problem for the AVI system""") def __init__(self, *args): r""" *Overload 1:* constructor from numerics solver id :type numericsSolverId: int, optional :param numericsSolverId: id of numerics solver, default = SICONOS_AVI_CAOFERRIS | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == AVI: _self = None else: _self = self _sicpykernel.AVI_swiginit(self, _sicpykernel.new_AVI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_AVI
[docs] def initialize(self, sim: "SP::Simulation") -> "void": return _sicpykernel.AVI_initialize(self, sim)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown z and update the Interaction (y and lambda) :type time: float :param time: current time :rtype: int :return: information about the solver convergence. """ return _sicpykernel.AVI_compute(self, time)
[docs] def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": r""" Check the compatibility fol the nslaw with the targeted OSNSP""" return _sicpykernel.AVI_checkCompatibleNSLaw(self, nslaw)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.AVI_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_AVI(self) return weakref.proxy(self)
# Register AVI in _sicpykernel: _sicpykernel.AVI_swigregister(AVI)
[docs] class QP(OneStepNSProblem): r""" Quadratic Problem""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): if self.__class__ == QP: _self = None else: _self = self _sicpykernel.QP_swiginit(self, _sicpykernel.new_QP(_self, )) __swig_destroy__ = _sicpykernel.delete_QP
[docs] def getQ(self) -> "SimpleMatrix const": r""" get the value of Q :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.QP_getQ(self)
[docs] def q(self) -> "SP::SiconosMatrix": r""" get Q :rtype: :py:class:`SiconosMatrix` :return: pointer on a SiconosMatrix """ return _sicpykernel.QP_q(self)
[docs] def setQ(self, newValue: "SiconosMatrix") -> "void": r""" set the value of Q to newValue :type newValue: :py:class:`SiconosMatrix` :param newValue: SiconosMatrix """ return _sicpykernel.QP_setQ(self, newValue)
[docs] def setQPtr(self, newPtr: "SP::SiconosMatrix") -> "void": r""" set Q to pointer newPtr :type newPtr: :py:class:`SiconosMatrix` :param newPtr: the new matrix """ return _sicpykernel.QP_setQPtr(self, newPtr)
[docs] def getP(self) -> "SiconosVector const": r""" get the value of p, the initial state of the DynamicalSystem :rtype: :py:class:`SiconosVector` :return: SiconosVector Warning: : SiconosVector is an abstract class => can not be an lvalue => return SiconosVector """ return _sicpykernel.QP_getP(self)
[docs] def p(self) -> "SP::SiconosVector": r""" get p, the initial state of the DynamicalSystem :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.QP_p(self)
[docs] def setP(self, newValue: "SiconosVector") -> "void": r""" set the value of p to newValue :type newValue: :py:class:`SiconosVector` :param newValue: SiconosVector """ return _sicpykernel.QP_setP(self, newValue)
[docs] def setPPtr(self, newPtr: "SP::SiconosVector") -> "void": r""" set p to pointer newPtr :type newPtr: :py:class:`SiconosVector` :param newPtr: SiconosVector * """ return _sicpykernel.QP_setPPtr(self, newPtr)
[docs] def compute(self, time: "double") -> "int": r""" To run the solver for ns problem :type time: float :param time: current time :rtype: int :return: int, information about the solver convergence. """ return _sicpykernel.QP_compute(self, time)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.QP_display(self)
[docs] def computeInteractionBlock(self, arg0: "InteractionsGraph::EDescriptor const &") -> "void": return _sicpykernel.QP_computeInteractionBlock(self, arg0)
[docs] def computeDiagonalInteractionBlock(self, arg0: "InteractionsGraph::VDescriptor const &") -> "void": return _sicpykernel.QP_computeDiagonalInteractionBlock(self, arg0)
[docs] def preCompute(self, time: "double") -> "bool": return _sicpykernel.QP_preCompute(self, time)
[docs] def postCompute(self) -> "void": return _sicpykernel.QP_postCompute(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_QP(self) return weakref.proxy(self)
# Register QP in _sicpykernel: _sicpykernel.QP_swigregister(QP)
[docs] class Relay(LinearOSNS): r""" Formalization and Resolution of a Linear Complementarity Problem (Relay) This class is devoted to the formalization and the resolution of the Relay NonSmooth problems. .. math:: w = q + M z .. math:: w \geq 0, z \geq 0, z^{T} w =0 where - :math:`w \in R^{n}` and :math:`z \in R^{n}` are the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` TODO: : add "recover" function to start from old values of z and w. : review this introduction ... """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _lb = property(_sicpykernel.Relay__lb_get, _sicpykernel.Relay__lb_set, doc=r""" contains the vector lb (lower bounds) of a Relay system""") _ub = property(_sicpykernel.Relay__ub_get, _sicpykernel.Relay__ub_set, doc=r""" contains the vector ub (upper bounds) of a Relay system""") _numerics_problem = property(_sicpykernel.Relay__numerics_problem_get, _sicpykernel.Relay__numerics_problem_set, doc=r""" contains the numerics proble for Relay system""") def __init__(self, *args): r""" *Overload 1:* constructor from numerics solver id :type numericsSolverId: int, optional :param numericsSolverId: id of numerics solver, default = SICONOS_RELAY_AVI_CAOFERRIS | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == Relay: _self = None else: _self = self _sicpykernel.Relay_swiginit(self, _sicpykernel.new_Relay(_self, *args)) __swig_destroy__ = _sicpykernel.delete_Relay
[docs] def getLb(self) -> "SiconosVector const &": r""" get the value of lb, the lower bounds of the Relay system :rtype: :py:class:`SiconosVector` :return: the vector of lower bounds """ return _sicpykernel.Relay_getLb(self)
[docs] def lb(self) -> "SP::SiconosVector": r""" get lb, the lower bounds of the Relay system :rtype: :py:class:`SiconosVector` :return: the vector of lower bounds """ return _sicpykernel.Relay_lb(self)
[docs] def setLb(self, newLb: "SP::SiconosVector") -> "void": r""" set lb to pointer newPtr :type newLb: :py:class:`SiconosVector` :param newLb: new lower bound """ return _sicpykernel.Relay_setLb(self, newLb)
[docs] def getUb(self) -> "SiconosVector const &": r""" get the value of ub, the upper bounds of the Relay system :rtype: :py:class:`SiconosVector` :return: the vector of upper bounds """ return _sicpykernel.Relay_getUb(self)
[docs] def ub(self) -> "SP::SiconosVector": r""" get lb, the lower bounds of the Relay system :rtype: :py:class:`SiconosVector` :return: the vector of upper bounds """ return _sicpykernel.Relay_ub(self)
[docs] def setUb(self, newUb: "SP::SiconosVector") -> "void": r""" set ub to pointer newPtr :type newUb: :py:class:`SiconosVector` :param newUb: new upper bound """ return _sicpykernel.Relay_setUb(self, newUb)
[docs] def initialize(self, sim: "SP::Simulation") -> "void": return _sicpykernel.Relay_initialize(self, sim)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown z and w and update the Interaction (y and lambda ) :type time: float :param time: current time :rtype: int :return: information about the solver convergence. """ return _sicpykernel.Relay_compute(self, time)
[docs] def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": r""" Check the compatibility fol the nslaw with the targeted OSNSP""" return _sicpykernel.Relay_checkCompatibleNSLaw(self, nslaw)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.Relay_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_Relay(self) return weakref.proxy(self)
# Register Relay in _sicpykernel: _sicpykernel.Relay_swigregister(Relay) MLCP_NB_BLOCKS_MAX = _sicpykernel.MLCP_NB_BLOCKS_MAX
[docs] class MLCP(LinearOSNS): r""" Formalization and Resolution of a Mixed Linear Complementarity Problem (MLCP) This class is devoted to the formalization and the resolution of the Mixed Linear Complementarity Problem (MLCP) defined by : .. math:: 0 = Au + Cv + a \\ \\ z = Du + Bv + b \\ \\ v \geq 0, z \geq 0, z^{T} v =0 where - :math:`u \in R^{n}` :math:`v \in R^{m}` and :math:`z \in R^{m}` are the unknowns, - :math:`a \in R^{n}` and :math:`b \in R^{m}` - :math:`A \in R^{n \times n }` - :math:`B \in R^{m \times m }` - :math:`C \in R^{n \times m }` - :math:`D \in R^{m \times n }` The MLCP main components are: - a problem (variables A,B,C,D,a,b and size of the problem), which directly corresponds to the MixedLinearComplementarityProblem structure of Numerics - the unknowns u,v and z """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _n = property(_sicpykernel.MLCP__n_get, _sicpykernel.MLCP__n_set, doc=r""" n is the number of equality""") _m = property(_sicpykernel.MLCP__m_get, _sicpykernel.MLCP__m_set, doc=r""" m is the size of the complementarity conditions""") _curBlock = property(_sicpykernel.MLCP__curBlock_get, _sicpykernel.MLCP__curBlock_set) _numerics_problem = property(_sicpykernel.MLCP__numerics_problem_get, _sicpykernel.MLCP__numerics_problem_set, doc=r""" The MLCP instance""") def __init__(self, *args): r""" *Overload 1:* constructor from data :type numericsSolverId: int, optional :param numericsSolverId: id of Numerics solver (optional, default = SICONOS_MLCP_ENUM the enumerative solver) | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == MLCP: _self = None else: _self = self _sicpykernel.MLCP_swiginit(self, _sicpykernel.new_MLCP(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MLCP
[docs] def computeOptions(self, inter1: "SP::Interaction", inter2: "SP::Interaction") -> "void": r""" compute equalities/inequalities sizes and set corresponding values in numerics problem :type inter1: :py:class:`Interaction` :param inter1: Interaction used to get a non-smooth law and the constraints sizes. :type inter2: :py:class:`Interaction` :param inter2: another interaction, not used indeed (?) """ return _sicpykernel.MLCP_computeOptions(self, inter1, inter2)
[docs] def updateInteractionBlocks(self) -> "void": r""" Update blocks used to compute M matrix.""" return _sicpykernel.MLCP_updateInteractionBlocks(self)
[docs] def getn(self) -> "int": r""" get the number of equality constraints, :rtype: int :return: int """ return _sicpykernel.MLCP_getn(self)
[docs] def getNumericsMLCP(self) -> "SP::MixedLinearComplementarityProblem": r""" get the pointer on the Numerics MLCP, :rtype: SP::MixedLinearComplementarityProblem :return: SP::MixedLinearComplementarityProblem """ return _sicpykernel.MLCP_getNumericsMLCP(self)
[docs] def reset(self) -> "void": r""" Reninitialize numerics driver.""" return _sicpykernel.MLCP_reset(self)
[docs] def computeInteractionBlock(self, ed: "InteractionsGraph::EDescriptor const &") -> "void": r""" compute extra-diagonal interactionBlock-matrix :type ed: InteractionsGraph::EDescriptor :param ed: an edge descriptor """ return _sicpykernel.MLCP_computeInteractionBlock(self, ed)
[docs] def computeDiagonalInteractionBlock(self, vd: "InteractionsGraph::VDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::VDescriptor :param vd: a vertex descriptor """ return _sicpykernel.MLCP_computeDiagonalInteractionBlock(self, vd)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown z and w and update the Interaction (y and lambda ) :type time: float :param time: current time :rtype: int :return: int, information about the solver convergence. """ return _sicpykernel.MLCP_compute(self, time)
[docs] def solve(self) -> "int": r""" Call numerics solver. :rtype: int :return: int information about the solver convergence (output from numerics driver, mixedlinearComplementarity_driver, check numerics doc. for details). """ return _sicpykernel.MLCP_solve(self)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.MLCP_display(self)
[docs] def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": r""" Check the compatibility fol the nslaw with the targeted OSNSP""" return _sicpykernel.MLCP_checkCompatibleNSLaw(self, nslaw)
def __disown__(self): self.this.disown() _sicpykernel.disown_MLCP(self) return weakref.proxy(self)
# Register MLCP in _sicpykernel: _sicpykernel.MLCP_swigregister(MLCP)
[docs] class MLCPProjectOnConstraints(MLCP): r""" Formalization and Resolution of a Mixed Linear Complementarity Problem (MLCP) This class is devoted to the formalization and the resolution of the Mixed Linear Complementarity Problem (MLCP) for the specific problem of the projection onto the constraints in Mechanics """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _alpha = property(_sicpykernel.MLCPProjectOnConstraints__alpha_get, _sicpykernel.MLCPProjectOnConstraints__alpha_set, doc=r""" ??""") _doProjOnEquality = property(_sicpykernel.MLCPProjectOnConstraints__doProjOnEquality_get, _sicpykernel.MLCPProjectOnConstraints__doProjOnEquality_set, doc=r""" disabled or enabled projection On Equality (or Unilateral) for unilateral constraints """) _useMassNormalization = property(_sicpykernel.MLCPProjectOnConstraints__useMassNormalization_get, _sicpykernel.MLCPProjectOnConstraints__useMassNormalization_set)
[docs] def computeOptions(self, inter1: "SP::Interaction", inter2: "SP::Interaction") -> "void": r""" compute the number of inequality and equality for a given tuple of Interactions update the global number of equality(_n) and inequality (_m) set up _numerics_problem parameters (blocksRows and blocksIsComp ) :type inter1: :py:class:`Interaction` :param inter1: first interaction considered :type inter2: :py:class:`Interaction` :param inter2: second interaction """ return _sicpykernel.MLCPProjectOnConstraints_computeOptions(self, inter1, inter2)
def __init__(self, *args): r""" *Overload 1:* constructor from data :type numericsSolverId: int, optional :param numericsSolverId: solver id :type alpha: float, optional :param alpha: alpha parameter value | *Overload 2:* constructor from a pre-defined solver options set. :type options: :py:class:`SolverOptions` :param options: the options set, :type alpha: float, optional :param alpha: alpha parameter value | *Overload 3:* constructor from a pre-defined solver options set. :type options: :py:class:`SolverOptions` :param options: the options set, :param alpha: alpha parameter value """ if self.__class__ == MLCPProjectOnConstraints: _self = None else: _self = self _sicpykernel.MLCPProjectOnConstraints_swiginit(self, _sicpykernel.new_MLCPProjectOnConstraints(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MLCPProjectOnConstraints
[docs] def alpha(self) -> "double": r""" :rtype: float :return: alpha value """ return _sicpykernel.MLCPProjectOnConstraints_alpha(self)
[docs] def setAlpha(self, newval: "double") -> "void": r""" setter for alpha :type newval: float, in :param newval: new value for alpha parameter """ return _sicpykernel.MLCPProjectOnConstraints_setAlpha(self, newval)
def setDoProjOnEquality(self, v: "bool") -> "void": return _sicpykernel.MLCPProjectOnConstraints_setDoProjOnEquality(self, v)
[docs] def displayBlocks(self, indexSet: "SP::InteractionsGraph") -> "void": r""" Display the set of blocks for a given indexSet :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the graph of interactions """ return _sicpykernel.MLCPProjectOnConstraints_displayBlocks(self, indexSet)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.MLCPProjectOnConstraints_display(self)
[docs] def initOSNSMatrix(self) -> "void": return _sicpykernel.MLCPProjectOnConstraints_initOSNSMatrix(self)
[docs] def updateInteractionBlocks(self) -> "void": r""" compute interactionBlocks if necessary (this depends on the type of OSNS, on the indexSets ...) """ return _sicpykernel.MLCPProjectOnConstraints_updateInteractionBlocks(self)
[docs] def updateInteractionBlocksOLD(self) -> "void": r""" compute interactionBlocks if necessary (this depends on the type of OSNS, on the indexSets ...) """ return _sicpykernel.MLCPProjectOnConstraints_updateInteractionBlocksOLD(self)
[docs] def computeDiagonalInteractionBlock(self, vd: "InteractionsGraph::VDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::VDescriptor :param vd: a vertex (interaction) descriptor """ return _sicpykernel.MLCPProjectOnConstraints_computeDiagonalInteractionBlock(self, vd)
[docs] def computeInteractionBlock(self, vd: "InteractionsGraph::EDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::EDescriptor :param vd: a vertex (interaction) descriptor """ return _sicpykernel.MLCPProjectOnConstraints_computeInteractionBlock(self, vd)
[docs] def computeqBlock(self, vd: "InteractionsGraph::VDescriptor &", pos: "unsigned int") -> "void": r""" To compute a part of the "q" vector of the OSNS :type vd: InteractionsGraph::VDescriptor :param vd: vertex (interaction) which corresponds to the considered block :type pos: int :param pos: the position of the first element of yOut to be set """ return _sicpykernel.MLCPProjectOnConstraints_computeqBlock(self, vd, pos)
[docs] def computeq(self, time: "double") -> "void": r""" compute vector q :type time: float :param time: the current time """ return _sicpykernel.MLCPProjectOnConstraints_computeq(self, time)
[docs] def postCompute(self) -> "void": r""" post-treatment for MLCPProjectOnConstraints""" return _sicpykernel.MLCPProjectOnConstraints_postCompute(self)
[docs] def postComputeLagrangianR(self, inter: "SP::Interaction", pos: "unsigned int") -> "void": r""" post-treatment for MLCPProjectOnConstraints for LagrangianR :type inter: :py:class:`Interaction` :param inter: the considered interaction :type pos: int :param pos: interaction position in the global vector """ return _sicpykernel.MLCPProjectOnConstraints_postComputeLagrangianR(self, inter, pos)
[docs] def postComputeNewtonEulerR(self, inter: "SP::Interaction", pos: "unsigned int") -> "void": r""" post-treatment for MLCPProjectOnConstraints for NewtonEulerR :type inter: :py:class:`Interaction` :param inter: the considered interaction :type pos: int :param pos: interaction position in the global vector """ return _sicpykernel.MLCPProjectOnConstraints_postComputeNewtonEulerR(self, inter, pos)
def __disown__(self): self.this.disown() _sicpykernel.disown_MLCPProjectOnConstraints(self) return weakref.proxy(self)
# Register MLCPProjectOnConstraints in _sicpykernel: _sicpykernel.MLCPProjectOnConstraints_swigregister(MLCPProjectOnConstraints)
[docs] class GenericMechanical(LinearOSNS): r""" Formalization and Resolution of a generic mechanical problem: It mixes bilateral equality, complementarity, impact and friction problems. This class is devoted to contains of a set of Non-Smooth Problem. **Main** functions: - formalization of the problem: computes M,q using the set of "active" Interactions from the simulation and the interactionBlock-matrices saved in the field interactionBlocks. Functions: initialize(), computeInteractionBlock(), preCompute() - solving of the GenericMechanical problem: function compute(), used to call solvers from Numerics through the gmp_driver() interface of Numerics. - post-treatment of data: set values of y/lambda variables of the active Interaction (ie Interactions) using ouput results from the solver (velocity,reaction); function postCompute(). For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _pnumerics_GMP = property(_sicpykernel.GenericMechanical__pnumerics_GMP_get, _sicpykernel.GenericMechanical__pnumerics_GMP_set) def __init__(self, *args): r""" *Overload 1:* constructor from solver id :param numericsSolverId: id of the internal friction solver of the generic problem default = SICONOS_FRICTION_3D_ONECONTACT_NSN | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == GenericMechanical: _self = None else: _self = self _sicpykernel.GenericMechanical_swiginit(self, _sicpykernel.new_GenericMechanical(_self, *args)) __swig_destroy__ = _sicpykernel.delete_GenericMechanical
[docs] def initialize(self, sim: "SP::Simulation") -> "void": r""" initialize the GenericMechanical problem(compute topology ...) :type sim: :py:class:`Simulation` :param sim: the simulation, owner of this OSNSPB """ return _sicpykernel.GenericMechanical_initialize(self, sim)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown reaction and velocity and update the Interaction (y and lambda ) :type time: float :param time: double current time :rtype: int :return: int information about the solver convergence (0: ok, >0 problem, see Numerics documentation) """ return _sicpykernel.GenericMechanical_compute(self, time)
[docs] def computeInteractionBlock(self, ed: "InteractionsGraph::EDescriptor const &") -> "void": r""" compute extra-diagonal interactionBlock-matrix :type ed: InteractionsGraph::EDescriptor :param ed: an edge descriptor """ return _sicpykernel.GenericMechanical_computeInteractionBlock(self, ed)
[docs] def computeDiagonalInteractionBlock(self, vd: "InteractionsGraph::VDescriptor const &") -> "void": r""" compute diagonal Interaction block :type vd: InteractionsGraph::VDescriptor :param vd: a vertex descriptor """ return _sicpykernel.GenericMechanical_computeDiagonalInteractionBlock(self, vd)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.GenericMechanical_display(self)
[docs] def updateInteractionBlocks(self) -> "void": r""" compute interactionBlocks if necessary (this depends on the type of OSNS, on the indexSets ...) """ return _sicpykernel.GenericMechanical_updateInteractionBlocks(self)
[docs] def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": r""" Check the compatibility fol the nslaw with the targeted OSNSP""" return _sicpykernel.GenericMechanical_checkCompatibleNSLaw(self, nslaw)
def __disown__(self): self.this.disown() _sicpykernel.disown_GenericMechanical(self) return weakref.proxy(self)
# Register GenericMechanical in _sicpykernel: _sicpykernel.GenericMechanical_swigregister(GenericMechanical)
[docs] class FrictionContact(LinearOSNS): r""" Formalization and Resolution of a Friction-Contact Problem This class is devoted to the formalization and the resolution of friction contact problems defined by : .. math:: velocity = q + M reaction \\ \\ velocity \geq 0, reaction \geq 0, reaction^{T} velocity =0 and a Coulomb friction law. With: - :math:`velocity \in R^{n}` and :math:`reaction \in R^{n}` the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` The dimension of the problem (2D or 3D) is given by the variable contactProblemDim and the proper Numerics driver will be called according to this value. **Construction**: just set Numerics Solver id Main functions: **Usage**: - compute(time) formalize, solve and post-process the problem. pre- and post-pro are common to all LinearOSNS and defined in this class. For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _contactProblemDim = property(_sicpykernel.FrictionContact__contactProblemDim_get, _sicpykernel.FrictionContact__contactProblemDim_set, doc=r""" Type (dimension) of the contact problem (2D or 3D)""") _mu = property(_sicpykernel.FrictionContact__mu_get, _sicpykernel.FrictionContact__mu_set, doc=r"""friction coefficients""") _frictionContact_driver = property(_sicpykernel.FrictionContact__frictionContact_driver_get, _sicpykernel.FrictionContact__frictionContact_driver_set, doc=r""" Pointer to the function used to call the Numerics driver to solve the problem """) _numerics_problem = property(_sicpykernel.FrictionContact__numerics_problem_get, _sicpykernel.FrictionContact__numerics_problem_set) def __init__(self, *args): r""" *Overload 1:* constructor (solver id and dimension) :type dimPb: int, optional :param dimPb: dimension (2D or 3D) of the friction-contact problem (default: 3) :type numericsSolverId: int, optional :param numericsSolverId: id of the solver to be used default (default: SICONOS_FRICTION_3D_NSGS) | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == FrictionContact: _self = None else: _self = self _sicpykernel.FrictionContact_swiginit(self, _sicpykernel.new_FrictionContact(_self, *args)) __swig_destroy__ = _sicpykernel.delete_FrictionContact
[docs] def getFrictionContactDim(self) -> "int": r""" get the type of FrictionContact problem (2D or 3D) :rtype: int :return: an int (2 or 3) """ return _sicpykernel.FrictionContact_getFrictionContactDim(self)
[docs] def mu(self) -> "SP::MuStorage": r""" get a pointer to mu, the list of the friction coefficients :rtype: SP::MuStorage :return: pointer on a std::vector<double> """ return _sicpykernel.FrictionContact_mu(self)
[docs] def getMu(self, *args) -> "double": r""" *Overload 1:* get the vector mu, list of the friction coefficients :rtype: MuStorage :return: a vector of double | *Overload 2:* get the value of the component number i of mu, the vector of the friction coefficients :type i: int :param i: the component number (starting from 0) :rtype: float :return: double value of mu """ return _sicpykernel.FrictionContact_getMu(self, *args)
[docs] def updateMu(self) -> "void": r""" update mu vector""" return _sicpykernel.FrictionContact_updateMu(self)
[docs] def setNumericsDriver(self, newFunction: "Driver") -> "void": r""" set the driver-function used to solve the problem :type newFunction: int :param newFunction: function of prototype Driver """ return _sicpykernel.FrictionContact_setNumericsDriver(self, newFunction)
[docs] def initialize(self, simulation: "SP::Simulation") -> "void": r""" initialize the FrictionContact problem(compute topology ...) :type simulation: :py:class:`Simulation` :param simulation: the simulation, owner of this OSNSPB """ return _sicpykernel.FrictionContact_initialize(self, simulation)
[docs] def frictionContactProblem(self) -> "SP::FrictionContactProblem": r""" :rtype: SP::FrictionContactProblem :return: the friction contact problem from Numerics """ return _sicpykernel.FrictionContact_frictionContactProblem(self)
[docs] def frictionContactProblemPtr(self) -> "FrictionContactProblem *": r""" :rtype: FrictionContactProblem :return: the friction contact problem from Numerics (raw ptr, do not free) """ return _sicpykernel.FrictionContact_frictionContactProblemPtr(self)
[docs] def solve(self, *args) -> "int": r""" solve a friction contact problem :type problem: SP::FrictionContactProblem, optional :param problem: the friction contact problem :rtype: int :return: info solver information result """ return _sicpykernel.FrictionContact_solve(self, *args)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown reaction and velocity and update the Interaction (y and lambda ) :type time: float :param time: the current time :rtype: int :return: int information about the solver convergence (0: ok, >0 problem, see Numerics documentation) """ return _sicpykernel.FrictionContact_compute(self, time)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.FrictionContact_display(self)
def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": return _sicpykernel.FrictionContact_checkCompatibleNSLaw(self, nslaw) def __disown__(self): self.this.disown() _sicpykernel.disown_FrictionContact(self) return weakref.proxy(self)
# Register FrictionContact in _sicpykernel: _sicpykernel.FrictionContact_swigregister(FrictionContact)
[docs] class GlobalFrictionContact(LinearOSNS): r""" Formalization and Resolution of a Friction-Contact Problem This class is devoted to the formalization and the resolution of primal friction contact problems defined by : .. math:: M velocity = q + H reaction \\ globalVelocities = H^T velocity + tildeGlobalVelocities and :math:`globalVelocities, reaction` belongs to the Coulomb friction law with unilateral contact. With: - :math:`velocity \in R^{n}` and :math:`reaction \in R^{n}` the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` - :math:`globalVelocities \in R^{m}` and :math:`reaction \in R^{m}` the unknowns, - :math:`tildeGlobalVelocities \in R^{m}` is the modified local velocity (:math:`e U_{N,k}`) - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` - :math:`H \in R^{n \times m }` The dimension of the problem (2D or 3D) is given by the variable contactProblemDim and the right Numerics driver will be called according to this value. **Construction**: - Constructor from data (inputs = Simulations*, id, SP::NonSmoothSolver) - The solver is optional. Main functions: **Main** functions: - formalization of the problem: computes M,q using the set of "active" Interactions from the simulation and the interactionBlock-matrices saved in the field interactionBlocks. Functions: initialize(), computeInteractionBlock(), preCompute() - solving of the GlobalFrictionContact problem: function compute(), used to call solvers from Numerics through the frictionContact2D_driver() or frictionContact3D_driver() interface of Numerics. - post-treatment of data: set values of y/lambda variables of the active Interaction (ie Interactions) using ouput results from the solver (velocity,reaction); function postCompute(). For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _contactProblemDim = property(_sicpykernel.GlobalFrictionContact__contactProblemDim_get, _sicpykernel.GlobalFrictionContact__contactProblemDim_set, doc=r""" Type (dimension) of the contact problem (2D or 3D)""") _sizeGlobalOutput = property(_sicpykernel.GlobalFrictionContact__sizeGlobalOutput_get, _sicpykernel.GlobalFrictionContact__sizeGlobalOutput_set, doc=r""" size of the local problem to solve""") _globalVelocities = property(_sicpykernel.GlobalFrictionContact__globalVelocities_get, _sicpykernel.GlobalFrictionContact__globalVelocities_set, doc=r""" contains the vector globalVelocities of a GlobalFrictionContact system""") _b = property(_sicpykernel.GlobalFrictionContact__b_get, _sicpykernel.GlobalFrictionContact__b_set, doc=r""" contains the impact contributions""") _mu = property(_sicpykernel.GlobalFrictionContact__mu_get, _sicpykernel.GlobalFrictionContact__mu_set, doc=r""" friction coefficients""") _gfc_driver = property(_sicpykernel.GlobalFrictionContact__gfc_driver_get, _sicpykernel.GlobalFrictionContact__gfc_driver_set, doc=r""" Pointer to the function used to call the Numerics driver to solve the problem""") _numerics_problem = property(_sicpykernel.GlobalFrictionContact__numerics_problem_get, _sicpykernel.GlobalFrictionContact__numerics_problem_set) def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor (solver id and dimension) :type dimPb: int :param dimPb: dimension (2D or 3D) of the friction-contact problem :type numericsSolverId: int, optional :param numericsSolverId: id of the solver to be used, optional, default : SICONOS_GLOBAL_FRICTION_3D_NSGS | *Overload 3:* constructor (solver id and dimension) :type dimPb: int :param dimPb: dimension (2D or 3D) of the friction-contact problem :param numericsSolverId: id of the solver to be used, optional, default : SICONOS_GLOBAL_FRICTION_3D_NSGS | *Overload 4:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == GlobalFrictionContact: _self = None else: _self = self _sicpykernel.GlobalFrictionContact_swiginit(self, _sicpykernel.new_GlobalFrictionContact(_self, *args)) __swig_destroy__ = _sicpykernel.delete_GlobalFrictionContact
[docs] def getGlobalFrictionContactDim(self) -> "int": r""" get the type of GlobalFrictionContact problem (2D or 3D) :rtype: int :return: an int (2 or 3) """ return _sicpykernel.GlobalFrictionContact_getGlobalFrictionContactDim(self)
[docs] def getGlobalSizeOutput(self) -> "size_t": r""" get dimension of the problem :rtype: int :return: an unsigned ing """ return _sicpykernel.GlobalFrictionContact_getGlobalSizeOutput(self)
[docs] def globalVelocities(self) -> "SP::SiconosVector": r""" get globalVelocities :rtype: :py:class:`SiconosVector` :return: pointer on a SiconosVector """ return _sicpykernel.GlobalFrictionContact_globalVelocities(self)
[docs] def setGlobalVelocities(self, newPtr: "SP::SiconosVector") -> "void": r""" set globalVelocities to pointer newPtr :type newPtr: :py:class:`SiconosVector` :param newPtr: the new vector """ return _sicpykernel.GlobalFrictionContact_setGlobalVelocities(self, newPtr)
[docs] def mu(self) -> "SP::MuStorage": r""" get a pointer to mu, the list of the friction coefficients :rtype: SP::MuStorage :return: pointer on a std::vector<double> """ return _sicpykernel.GlobalFrictionContact_mu(self)
[docs] def getMu(self, i: "unsigned int") -> "double": r""" get the value of the component number i of mu, the vector of the friction coefficients :rtype: float :return: the friction coefficient for the ith contact """ return _sicpykernel.GlobalFrictionContact_getMu(self, i)
[docs] def initVectorsMemory(self) -> "void": r""" Memory allocation or resizing for z,w,q,b, globalVelocities""" return _sicpykernel.GlobalFrictionContact_initVectorsMemory(self)
[docs] def initialize(self, sim: "SP::Simulation") -> "void": r""" initialize the GlobalFrictionContact problem(compute topology ...) :type sim: :py:class:`Simulation` :param sim: the simulation, owner of this OSNSPB """ return _sicpykernel.GlobalFrictionContact_initialize(self, sim)
[docs] def globalFrictionContactProblem(self) -> "SP::GlobalFrictionContactProblem": r""" :rtype: SP::GlobalFrictionContactProblem :return: the friction contact problem from Numerics """ return _sicpykernel.GlobalFrictionContact_globalFrictionContactProblem(self)
[docs] def globalFrictionContactProblemPtr(self) -> "GlobalFrictionContactProblem *": r""" :rtype: GlobalFrictionContactProblem :return: the friction contact problem from Numerics (raw ptr, do not free) """ return _sicpykernel.GlobalFrictionContact_globalFrictionContactProblemPtr(self)
[docs] def solve(self, *args) -> "int": r""" solve a friction contact problem :type problem: SP::GlobalFrictionContactProblem, optional :param problem: the friction contact problem :rtype: int :return: info solver information result """ return _sicpykernel.GlobalFrictionContact_solve(self, *args)
[docs] def preCompute(self, time: "double") -> "bool": r""" Construction of the problem :type time: float :param time: current time """ return _sicpykernel.GlobalFrictionContact_preCompute(self, time)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown reaction and velocity and update the Interaction (y and lambda ) :type time: float :param time: current time """ return _sicpykernel.GlobalFrictionContact_compute(self, time)
[docs] def postCompute(self) -> "void": r""" post-treatment of output from Numerics solver: set values of the unknowns of Interactions using (velocity,reaction) """ return _sicpykernel.GlobalFrictionContact_postCompute(self)
def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": return _sicpykernel.GlobalFrictionContact_checkCompatibleNSLaw(self, nslaw) def updateMu(self) -> "void": return _sicpykernel.GlobalFrictionContact_updateMu(self)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.GlobalFrictionContact_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_GlobalFrictionContact(self) return weakref.proxy(self)
# Register GlobalFrictionContact in _sicpykernel: _sicpykernel.GlobalFrictionContact_swigregister(GlobalFrictionContact)
[docs] class RollingFrictionContact(LinearOSNS): r""" Formalization and Resolution of a Friction-Contact Problem This class is devoted to the formalization and the resolution of friction contact problems defined by : .. math:: velocity = q + M reaction \\ \\ velocity \geq 0, reaction \geq 0, reaction^{T} velocity =0 and a Coulomb friction law. With: - :math:`velocity \in R^{n}` and :math:`reaction \in R^{n}` the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` The dimension of the problem (2D or 3D) is given by the variable contactProblemDim and the proper Numerics driver will be called according to this value. Construction: just set Numerics Solver id Main functions: Usage: - compute(time) formalize, solve and post-process the problem. pre- and post-pro are common to all LinearOSNS and defined in this class. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _contactProblemDim = property(_sicpykernel.RollingFrictionContact__contactProblemDim_get, _sicpykernel.RollingFrictionContact__contactProblemDim_set, doc=r""" Type (dimension) of the contact problem (2D or 3D)""") _mu = property(_sicpykernel.RollingFrictionContact__mu_get, _sicpykernel.RollingFrictionContact__mu_set, doc=r"""friction coefficients""") _muR = property(_sicpykernel.RollingFrictionContact__muR_get, _sicpykernel.RollingFrictionContact__muR_set, doc=r"""friction coefficients""") _rolling_frictionContact_driver = property(_sicpykernel.RollingFrictionContact__rolling_frictionContact_driver_get, _sicpykernel.RollingFrictionContact__rolling_frictionContact_driver_set, doc=r""" Pointer to the function used to call the Numerics driver to solve the problem """) _numerics_problem = property(_sicpykernel.RollingFrictionContact__numerics_problem_get, _sicpykernel.RollingFrictionContact__numerics_problem_set) def __init__(self, *args): r""" *Overload 1:* constructor (solver id and dimension) :type dimPb: int, optional :param dimPb: dimension, default = 5 :type numericsSolverId: int, optional :param numericsSolverId: id of the solver to be used, optional, default : SICONOS_ROLLING_FRICTION_3D_NSGS | *Overload 2:* constructor from a pre-defined solver options set. :param dim: pb dimension, 5 only :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == RollingFrictionContact: _self = None else: _self = self _sicpykernel.RollingFrictionContact_swiginit(self, _sicpykernel.new_RollingFrictionContact(_self, *args)) __swig_destroy__ = _sicpykernel.delete_RollingFrictionContact
[docs] def getRollingFrictionContactDim(self) -> "int": r""" get the type of RollingFrictionContact problem (2D or 3D) :rtype: int :return: an int (2 or 3) """ return _sicpykernel.RollingFrictionContact_getRollingFrictionContactDim(self)
[docs] def mu(self) -> "SP::MuStorage": r""" get a pointer to mu, the list of the friction coefficients :rtype: SP::MuStorage :return: pointer on a std::vector<double> """ return _sicpykernel.RollingFrictionContact_mu(self)
[docs] def getMu(self, *args) -> "double": r""" *Overload 1:* get the vector mu, list of the friction coefficients :rtype: MuStorage :return: a vector of double | *Overload 2:* get the value of the component number i of mu, the vector of the friction coefficients :type i: int :param i: the component number (starting from 0) :rtype: float :return: double value of mu """ return _sicpykernel.RollingFrictionContact_getMu(self, *args)
[docs] def updateMu(self) -> "void": r""" update mu vector""" return _sicpykernel.RollingFrictionContact_updateMu(self)
[docs] def setNumericsDriver(self, newFunction: "RollingDriver") -> "void": r""" set the driver-function used to solve the problem :type newFunction: int :param newFunction: function of prototype Driver """ return _sicpykernel.RollingFrictionContact_setNumericsDriver(self, newFunction)
[docs] def initialize(self, simulation: "SP::Simulation") -> "void": r""" initialize the RollingFrictionContact problem(compute topology ...) :type simulation: :py:class:`Simulation` :param simulation: the simulation, owner of this OSNSPB """ return _sicpykernel.RollingFrictionContact_initialize(self, simulation)
[docs] def frictionContactProblem(self) -> "SP::RollingFrictionContactProblem": r""" :rtype: SP::RollingFrictionContactProblem :return: the friction contact problem from Numerics """ return _sicpykernel.RollingFrictionContact_frictionContactProblem(self)
[docs] def frictionContactProblemPtr(self) -> "RollingFrictionContactProblem *": r""" :rtype: RollingFrictionContactProblem :return: the friction contact problem from Numerics (raw ptr, do not free) """ return _sicpykernel.RollingFrictionContact_frictionContactProblemPtr(self)
[docs] def solve(self, *args) -> "int": r""" solve a friction contact problem :type problem: SP::RollingFrictionContactProblem, optional :param problem: the friction contact problem :rtype: int :return: info solver information result """ return _sicpykernel.RollingFrictionContact_solve(self, *args)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown reaction and velocity and update the Interaction (y and lambda ) :type time: float :param time: the current time :rtype: int :return: int information about the solver convergence (0: ok, >0 problem, see Numerics documentation) """ return _sicpykernel.RollingFrictionContact_compute(self, time)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.RollingFrictionContact_display(self)
[docs] def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": r""" Check the compatibility fol the nslaw with the targeted OSNSP""" return _sicpykernel.RollingFrictionContact_checkCompatibleNSLaw(self, nslaw)
def __disown__(self): self.this.disown() _sicpykernel.disown_RollingFrictionContact(self) return weakref.proxy(self)
# Register RollingFrictionContact in _sicpykernel: _sicpykernel.RollingFrictionContact_swigregister(RollingFrictionContact)
[docs] class GlobalRollingFrictionContact(GlobalFrictionContact): r""" Formalization and Resolution of a Friction-Contact Problem This class is devoted to the formalization and the resolution of primal friction contact problems defined by : .. math:: M velocity = q + H reaction \\ globalVelocities = H^T velocity + tildeGlobalVelocities and :math:`globalVelocities, reaction` belongs to the Coulomb friction law with unilateral contact. With: - :math:`velocity \in R^{n}` and :math:`reaction \in R^{n}` the unknowns, - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` - :math:`globalVelocities \in R^{m}` and :math:`reaction \in R^{m}` the unknowns, - :math:`tildeGlobalVelocities \in R^{m}` is the modified local velocity (:math:`e U_{N,k}`) - :math:`M \in R^{n \times n }` and :math:`q \in R^{n}` - :math:`H \in R^{n \times m }` The dimension of the problem (2D or 3D) is given by the variable contactProblemDim and the right Numerics driver will be called according to this value. **Construction**: - Constructor from data (inputs = Simulations*, id, SP::NonSmoothSolver) - The solver is optional. Main functions: **Main** functions: - formalization of the problem: computes M,q using the set of "active" Interactions from the simulation and the interactionBlock-matrices saved in the field interactionBlocks. Functions: initialize(), computeInteractionBlock(), preCompute() - solving of the GlobalRollingFrictionContact problem: function compute(), used to call solvers from Numerics through the frictionContact2D_driver() or frictionContact3D_driver() interface of Numerics. - post-treatment of data: set values of y/lambda variables of the active Interaction (ie Interactions) using ouput results from the solver (velocity,reaction); function postCompute(). For details regarding the available options, see Nonsmooth problems formulations and available solvers in users' guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _contactProblemDim = property(_sicpykernel.GlobalRollingFrictionContact__contactProblemDim_get, _sicpykernel.GlobalRollingFrictionContact__contactProblemDim_set, doc=r""" Type (dimension) of the contact problem (2D or 3D)""") _mu_r = property(_sicpykernel.GlobalRollingFrictionContact__mu_r_get, _sicpykernel.GlobalRollingFrictionContact__mu_r_set, doc=r""" rolling friction coefficients""") _g_rolling_driver = property(_sicpykernel.GlobalRollingFrictionContact__g_rolling_driver_get, _sicpykernel.GlobalRollingFrictionContact__g_rolling_driver_set, doc=r""" Pointer to the function used to call the Numerics driver to solve the problem""") _numerics_problem = property(_sicpykernel.GlobalRollingFrictionContact__numerics_problem_get, _sicpykernel.GlobalRollingFrictionContact__numerics_problem_set) def __init__(self, *args): r""" *Overload 1:* constructor (solver id and dimension) :type dimPb: int :param dimPb: dimension (2D or 3D) of the friction-contact problem :type numericsSolverId: int, optional :param numericsSolverId: id of the solver to be used, optional, default : SICONOS_GLOBAL_FRICTION_3D_NSGS | *Overload 2:* constructor from a pre-defined solver options set :type options: :py:class:`SolverOptions` :param options: the options set """ if self.__class__ == GlobalRollingFrictionContact: _self = None else: _self = self _sicpykernel.GlobalRollingFrictionContact_swiginit(self, _sicpykernel.new_GlobalRollingFrictionContact(_self, *args)) __swig_destroy__ = _sicpykernel.delete_GlobalRollingFrictionContact
[docs] def getGlobalRollingFrictionContactDim(self) -> "int": r""" get the type of GlobalRollingFrictionContact problem (2D or 3D) :rtype: int :return: an int (2 or 3) """ return _sicpykernel.GlobalRollingFrictionContact_getGlobalRollingFrictionContactDim(self)
[docs] def getGlobalSizeOutput(self) -> "size_t": r""" get dimension of the problem :rtype: int :return: an unsigned ing """ return _sicpykernel.GlobalRollingFrictionContact_getGlobalSizeOutput(self)
[docs] def mur(self) -> "SP::MuStorage": r""" get a pointer to mu, the list of the friction coefficients :rtype: SP::MuStorage :return: pointer on a std::vector<double> """ return _sicpykernel.GlobalRollingFrictionContact_mur(self)
[docs] def getMur(self, i: "unsigned int") -> "double": r""" get the value of the component number i of mu, the vector of the friction coefficients :rtype: float :return: the friction coefficient for the ith contact """ return _sicpykernel.GlobalRollingFrictionContact_getMur(self, i)
[docs] def initialize(self, sim: "SP::Simulation") -> "void": r""" initialize the GlobalRollingFrictionContact problem(compute topology ...) :type sim: :py:class:`Simulation` :param sim: the simulation, owner of this OSNSPB """ return _sicpykernel.GlobalRollingFrictionContact_initialize(self, sim)
[docs] def globalRollingFrictionContactProblem(self) -> "SP::GlobalRollingFrictionContactProblem": r""" :rtype: SP::GlobalRollingFrictionContactProblem :return: the friction contact problem from Numerics """ return _sicpykernel.GlobalRollingFrictionContact_globalRollingFrictionContactProblem(self)
[docs] def globalRollingFrictionContactProblemPtr(self) -> "GlobalRollingFrictionContactProblem *": r""" :rtype: GlobalRollingFrictionContactProblem :return: the friction contact problem from Numerics (raw ptr, do not free) """ return _sicpykernel.GlobalRollingFrictionContact_globalRollingFrictionContactProblemPtr(self)
[docs] def solve(self, *args) -> "int": r""" solve a friction contact problem :type problem: SP::GlobalRollingFrictionContactProblem, optional :param problem: the friction contact problem :rtype: int :return: info solver information result """ return _sicpykernel.GlobalRollingFrictionContact_solve(self, *args)
[docs] def preCompute(self, time: "double") -> "bool": r""" Construction of the problem :type time: float :param time: current time """ return _sicpykernel.GlobalRollingFrictionContact_preCompute(self, time)
[docs] def compute(self, time: "double") -> "int": r""" Compute the unknown reaction and velocity and update the Interaction (y and lambda ) :type time: float :param time: current time """ return _sicpykernel.GlobalRollingFrictionContact_compute(self, time)
def checkCompatibleNSLaw(self, nslaw: "NonSmoothLaw") -> "bool": return _sicpykernel.GlobalRollingFrictionContact_checkCompatibleNSLaw(self, nslaw) def updateMu(self) -> "void": return _sicpykernel.GlobalRollingFrictionContact_updateMu(self) def updateMur(self) -> "void": return _sicpykernel.GlobalRollingFrictionContact_updateMur(self)
[docs] def display(self) -> "void": return _sicpykernel.GlobalRollingFrictionContact_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_GlobalRollingFrictionContact(self) return weakref.proxy(self)
# Register GlobalRollingFrictionContact in _sicpykernel: _sicpykernel.GlobalRollingFrictionContact_swigregister(GlobalRollingFrictionContact)
[docs] class EulerMoreauOSI(OneStepIntegrator): r""" One Step time Integrator for First Order Dynamical Systems. This integrator is the work horse of the event--capturing time stepping schemes for first order systems. It is mainly based on some extensions of the Backward Euler and :math:`\theta-\gamma` schemes proposed in the pionnering work of J.J. Moreau for the sweeping process J.J. Moreau. Evolution problem associated with a moving convex set in a Hilbert space. Journal of Differential Equations, 26, pp 347--374, 1977. Variants are now used to integrate LCS, Relay systems, Higher order sweeping process see for instance Consistency of a time-stepping method for a class of piecewise linear networks M.K. Camlibel, W.P.M.H. Heemels, and J.M. Schumacher IEEE Transactions on Circuits and Systems I, 2002, 49(3):349--357 Numerical methods for nonsmooth dynamical systems: applications in mechanics and electronics V Acary, B Brogliato Springer Verlag 2008 Convergence of time-stepping schemes for passive and extended linear complementarity systems L. Han, A. Tiwari, M.K. Camlibel, and J.-S. Pang SIAM Journal on Numerical Analysis 2009, 47(5):3768-3796 On preserving dissipativity properties of linear complementarity dynamical systems with the &theta-method Greenhalgh Scott, Acary Vincent, Brogliato Bernard Numer. Math., , 2013. Main time--integration schemes are based on the following :math:`\theta-\gamma` scheme .. math:: \begin{cases} \label{eq:toto1} M x_{k+1} = M x_{k} +h\theta f(x_{k+1},t_{k+1})+h(1-\theta) f(x_k,t_k) + h \gamma r(t_{k+1}) + h(1-\gamma)r(t_k) \\[2mm] y_{k+1} = h(t_{k+1},x_{k+1},\lambda _{k+1}) \\[2mm] r_{k+1} = g(x_{k+1},\lambda_{k+1},t_{k+1})\\[2mm] \mbox{nslaw} ( y_{k+1} , \lambda_{k+1}) \end{cases} where :math:`\theta = [0,1]` and :math:`\gamma \in [0,1]`. As in Acary & Brogliato 2008, we call the previous problem the ``one--step nonsmooth problem''. Another variant can also be used (FullThetaGamma scheme) .. math:: \begin{cases} M x_{k+1} = M x_{k} +h f(x_{k+\theta},t_{k+1}) + h r(t_{k+\gamma})\\[2mm] y_{k+\gamma} = h(t_{k+\gamma},x_{k+\gamma},\lambda _{k+\gamma})\\[2mm] r_{k+\gamma} = g(x_{k+\gamma},\lambda_{k+\gamma},t_{k+\gamma})\\[2mm] \mbox{nslaw} ( y_{k+\gamma} , \lambda_{k+\gamma}) \end{cases} EulerMoreauOSI class is used to define some time-integrators methods for a list of first order dynamical systems. A EulerMoreauOSI instance is defined by the value of theta and possibly gamma and the list of concerned dynamical systems. Each DynamicalSystem is associated to a SiconosMatrix, named "W", which is the "iteration" matrix. W matrices are initialized and computed in initializeIterationMatrixW and computeW. Depending on the DS type, they may depend on time t and DS state x. For first order systems, the implementation uses _r for storing the the input due to the nonsmooth law. This EulerMoreauOSI scheme assumes that the relative degree is zero or one and one level for _r is sufficient Main functions: - computeFreeState(): computes xfree (or vfree), dynamical systems state without taking non-smooth part into account - updateState(): computes x (q,v), the complete dynamical systems states. See User's guide, for details. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _theta = property(_sicpykernel.EulerMoreauOSI__theta_get, _sicpykernel.EulerMoreauOSI__theta_set, doc=r""" Stl map that associates a theta parameter for the integration scheme to each DynamicalSystem of the OSI """) _gamma = property(_sicpykernel.EulerMoreauOSI__gamma_get, _sicpykernel.EulerMoreauOSI__gamma_set, doc=r""" A gamma parameter for the integration scheme to each DynamicalSystem of the OSI This parameter is used to apply a theta-method to the input $r$ """) _useGamma = property(_sicpykernel.EulerMoreauOSI__useGamma_get, _sicpykernel.EulerMoreauOSI__useGamma_set, doc=r""" a boolean to know if the parameter must be used or not""") _useGammaForRelation = property(_sicpykernel.EulerMoreauOSI__useGammaForRelation_get, _sicpykernel.EulerMoreauOSI__useGammaForRelation_set, doc=r""" a boolean to know if the parameter must be used or not""") RESIDU = _sicpykernel.EulerMoreauOSI_RESIDU RESIDU_FREE = _sicpykernel.EulerMoreauOSI_RESIDU_FREE FREE = _sicpykernel.EulerMoreauOSI_FREE X_PARTIAL_NS_FOR_RELATION = _sicpykernel.EulerMoreauOSI_X_PARTIAL_NS_FOR_RELATION DELTA_X_FOR_RELATION = _sicpykernel.EulerMoreauOSI_DELTA_X_FOR_RELATION LOCAL_BUFFER = _sicpykernel.EulerMoreauOSI_LOCAL_BUFFER WORK_LENGTH = _sicpykernel.EulerMoreauOSI_WORK_LENGTH OSNSP_RHS = _sicpykernel.EulerMoreauOSI_OSNSP_RHS VEC_X = _sicpykernel.EulerMoreauOSI_VEC_X H_ALPHA = _sicpykernel.EulerMoreauOSI_H_ALPHA VEC_RESIDU_Y = _sicpykernel.EulerMoreauOSI_VEC_RESIDU_Y VEC_RESIDU_R = _sicpykernel.EulerMoreauOSI_VEC_RESIDU_R YOLD = _sicpykernel.EulerMoreauOSI_YOLD LAMBDAOLD = _sicpykernel.EulerMoreauOSI_LAMBDAOLD WORK_INTERACTION_LENGTH = _sicpykernel.EulerMoreauOSI_WORK_INTERACTION_LENGTH XFREE = _sicpykernel.EulerMoreauOSI_XFREE X_PARTIAL_NS = _sicpykernel.EulerMoreauOSI_X_PARTIAL_NS DELTA_X = _sicpykernel.EulerMoreauOSI_DELTA_X G_ALPHA = _sicpykernel.EulerMoreauOSI_G_ALPHA BLOCK_WORK_LENGTH = _sicpykernel.EulerMoreauOSI_BLOCK_WORK_LENGTH MAT_KHAT = _sicpykernel.EulerMoreauOSI_MAT_KHAT MAT_KTILDE = _sicpykernel.EulerMoreauOSI_MAT_KTILDE MAT_WORK_LENGTH = _sicpykernel.EulerMoreauOSI_MAT_WORK_LENGTH def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor from theta value only :type theta: float :param theta: value for all DS. | *Overload 3:* constructor from theta value only :type theta: float :param theta: value for all linked DS. :type gamma: float :param gamma: value for all linked DS. """ if self.__class__ == EulerMoreauOSI: _self = None else: _self = self _sicpykernel.EulerMoreauOSI_swiginit(self, _sicpykernel.new_EulerMoreauOSI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_EulerMoreauOSI
[docs] def getW(self, *args) -> "SimpleMatrix const": r""" get the value of W corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem`, optional :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get W[0] in that case :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.EulerMoreauOSI_getW(self, *args)
[docs] def W(self, ds: "SP::DynamicalSystem") -> "SP::SimpleMatrix": r""" get W corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem :rtype: :py:class:`SimpleMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.EulerMoreauOSI_W(self, ds)
[docs] def getWBoundaryConditions(self, *args) -> "SimpleMatrix const": r""" get the value of WBoundaryConditions corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem`, optional :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.EulerMoreauOSI_getWBoundaryConditions(self, *args)
[docs] def WBoundaryConditions(self, ds: "SP::DynamicalSystem") -> "SP::SiconosMatrix": r""" get WBoundaryConditions corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case :rtype: :py:class:`SiconosMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.EulerMoreauOSI_WBoundaryConditions(self, ds)
[docs] def theta(self) -> "double": r""" get theta :rtype: float :return: a double """ return _sicpykernel.EulerMoreauOSI_theta(self)
[docs] def setTheta(self, newTheta: "double") -> "void": r""" set the value of theta :type newTheta: float :param newTheta: a double """ return _sicpykernel.EulerMoreauOSI_setTheta(self, newTheta)
[docs] def gamma(self) -> "double": r""" get gamma :rtype: float :return: a double """ return _sicpykernel.EulerMoreauOSI_gamma(self)
[docs] def setGamma(self, newGamma: "double") -> "void": r""" set the value of gamma :type newGamma: float :param newGamma: a double """ return _sicpykernel.EulerMoreauOSI_setGamma(self, newGamma)
[docs] def useGamma(self) -> "bool": r""" get bool useGamma :rtype: boolean :return: a bool """ return _sicpykernel.EulerMoreauOSI_useGamma(self)
[docs] def setUseGamma(self, b: "bool") -> "void": r""" set the boolean to indicate that we use gamma :type b: boolean :param b: true if gamma has to be used, false otherwise """ return _sicpykernel.EulerMoreauOSI_setUseGamma(self, b)
[docs] def useGammaForRelation(self) -> "bool": r""" get bool gammaForRelation for the relation :rtype: boolean :return: a """ return _sicpykernel.EulerMoreauOSI_useGammaForRelation(self)
[docs] def setUseGammaForRelation(self, newUseGammaForRelation: "bool") -> "void": r""" set the boolean to indicate that we use gamma for the relation :type newUseGammaForRelation: boolean :param newUseGammaForRelation: a bool """ return _sicpykernel.EulerMoreauOSI_setUseGammaForRelation(self, newUseGammaForRelation)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.EulerMoreauOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.EulerMoreauOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.EulerMoreauOSI_numberOfIndexSets(self)
[docs] def initializeIterationMatrixW(self, time: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialize iteration matrix W EulerMoreauOSI matrix at time t :type time: float :param time: the time (double) :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem """ return _sicpykernel.EulerMoreauOSI_initializeIterationMatrixW(self, time, ds)
[docs] def computeW(self, time: "double", ds: "DynamicalSystem", dsv: "DynamicalSystemsGraph::VDescriptor &", W: "SiconosMatrix") -> "void": r""" compute W EulerMoreauOSI matrix at time t :type time: float :param time: the current time :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem :type dsv: DynamicalSystemsGraph::VDescriptor :param dsv: a descriptor of the ds on the graph (redundant to avoid invocation) :type W: :py:class:`SiconosMatrix` :param W: the matrix to compute """ return _sicpykernel.EulerMoreauOSI_computeW(self, time, ds, dsv, W)
def computeKhat(self, inter: "Interaction", m: "SiconosMatrix", workM: "VectorOfSMatrices", h: "double") -> "void": return _sicpykernel.EulerMoreauOSI_computeKhat(self, inter, m, workM, h)
[docs] def computeWBoundaryConditions(self, ds: "SP::DynamicalSystem") -> "void": r""" compute WBoundaryConditionsMap[ds] EulerMoreauOSI matrix at time t :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem """ return _sicpykernel.EulerMoreauOSI_computeWBoundaryConditions(self, ds)
[docs] def initializeIterationMatrixWBoundaryConditions(self, ds: "SP::DynamicalSystem") -> "void": r""" initialize iteration matrix WBoundaryConditionsMap[ds] EulerMoreauOSI :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem """ return _sicpykernel.EulerMoreauOSI_initializeIterationMatrixWBoundaryConditions(self, ds)
[docs] def computeResidu(self) -> "double": r""" Computes the residuFree and residu of all the DynamicalSystems :rtype: float :return: the maximum of the 2-norm over all the residu """ return _sicpykernel.EulerMoreauOSI_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input r """ return _sicpykernel.EulerMoreauOSI_computeFreeState(self)
[docs] def updateOutput(self, *args) -> "void": r""" *Overload 1:* update the output of the Interaction attached to this Integrator | *Overload 2:* update the output of the Interaction attached to this Integrator :type time: float :param time: current time :type level: int :param level: level of interest for the dynamics """ return _sicpykernel.EulerMoreauOSI_updateOutput(self, *args)
[docs] def updateInput(self, *args) -> "void": r""" *Overload 1:* update the input of the Interaction attached to this Integrator | *Overload 2:* update the input of the Interaction attached to this Integrator :type time: float :param time: current time :type level: int :param level: level of interest for the dynamics """ return _sicpykernel.EulerMoreauOSI_updateInput(self, *args)
[docs] def computeResiduOutput(self, time: "double", indexSet: "SP::InteractionsGraph") -> "double": return _sicpykernel.EulerMoreauOSI_computeResiduOutput(self, time, indexSet)
[docs] def computeResiduInput(self, time: "double", indexSet: "SP::InteractionsGraph") -> "double": return _sicpykernel.EulerMoreauOSI_computeResiduInput(self, time, indexSet)
[docs] def computeFreeOutput(self, vertex_inter: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" integrates the Interaction linked to this integrator, without taking non-smooth effects into account :type vertex_inter: InteractionsGraph::VDescriptor :param vertex_inter: of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: pointer to OneStepNSProblem """ return _sicpykernel.EulerMoreauOSI_computeFreeOutput(self, vertex_inter, osnsp)
[docs] def prepareNewtonIteration(self, time: "double") -> "void": r""" computes all the W matrices :type time: float :param time: current time """ return _sicpykernel.EulerMoreauOSI_prepareNewtonIteration(self, time)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", useless: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: initial time :type tend: float :param tend: end time :type tout: float :param tout: real end time :type useless: int :param useless: flag (for EulerMoreauOSI, used in LsodarOSI) """ return _sicpykernel.EulerMoreauOSI_integrate(self, tinit, tend, tout, useless)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" updates the state of the Dynamical Systems :type level: int :param level: the level of interest for the dynamics: not used at the time """ return _sicpykernel.EulerMoreauOSI_updateState(self, level)
[docs] def display(self) -> "void": r""" Displays the data of the EulerMoreauOSI's integrator""" return _sicpykernel.EulerMoreauOSI_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_EulerMoreauOSI(self) return weakref.proxy(self)
# Register EulerMoreauOSI in _sicpykernel: _sicpykernel.EulerMoreauOSI_swigregister(EulerMoreauOSI)
[docs] class MoreauJeanOSI(OneStepIntegrator): r""" One Step time Integrator, Moreau-Jean algorithm. This integrator is the work horse of the event--capturing time stepping schemes for mechanical systems. It is mainly based on the pioneering works of M. Jean and J.J. Moreau for the time integration of mechanical systems with unilateral contact, impact and Coulomb's friction with :math:`\theta` scheme For the linear Lagrangian system, the scheme reads as .. math:: \begin{cases} M (v_{k+1}-v_k) + h K q_{k+\theta} + h C v_{k+\theta} - h F_{k+\theta} = p_{k+1} = G P_{k+1},\label{eq:MoreauTS-motion}\\[1mm] q_{k+1} = q_{k} + h v_{k+\theta}, \quad \\[1mm] U_{k+1} = G^\top\, v_{k+1}, \\[1mm] \begin{array}{lcl} 0 \leq U^\alpha_{k+1} + e U^\alpha_{k} \perp P^\alpha_{k+1} \geq 0,& \quad&\alpha \in \mathcal I_1, \\[1mm] P^\alpha_{k+1} =0,&\quad& \alpha \in \mathcal I \setminus \mathcal I_1, \end{array} \end{cases} with :math:`\theta \in [0,1]`. The index set :math:`\mathcal I_1` is the discrete equivalent to the rule that allows us to apply the Signorini condition at the velocity level. In the numerical practice, we choose to define this set by .. math:: \mathcal I_1 = \{\alpha \in \mathcal I \mid G^\top (q_{k} + h v_{k}) + w \leq 0\text{ and } U_k \leq 0 \}. For more details, we refer to M. Jean and J.J. Moreau. Dynamics in the presence of unilateral contacts and dry friction: a numerical approach. In G. Del Pietro and F. Maceri, editors, Unilateral problems in structural analysis. II, pages 151–196. CISM 304, Spinger Verlag, 1987. J.J. Moreau. Unilateral contact and dry friction in finite freedom dynamics. In J.J. Moreau and Panagiotopoulos P.D., editors, Nonsmooth Mechanics and Applications, number 302 in CISM, Courses and lectures, pages 1–82. CISM 302, Spinger Verlag, Wien- New York, 1988a. J.J. Moreau. Numerical aspects of the sweeping process. Computer Methods in Applied Mechanics and Engineering, 177:329–349, 1999. M. Jean. The non smooth contact dynamics method. Computer Methods in Applied Mechanics and Engineering, 177:235–257, 1999. and for a review : V. Acary and B. Brogliato. Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics, volume 35 of Lecture Notes in Applied and Computational Mechanics. Springer Verlag, 2008. MoreauJeanOSI class is used to define some time-integrators methods for a list of dynamical systems. A MoreauJeanOSI instance is defined by the value of theta and the list of concerned dynamical systems. Each DynamicalSystem is associated to a SiconosMatrix, named "W", the "teration" matrix" W matrices are initialized and computed in initializeIterationMatrixW and computeW. Depending on the DS type, they may depend on time t and DS state x. For mechanical systems, the implementation uses _p for storing the the input due to the nonsmooth law. This MoreauJeanOSI scheme assumes that the relative degree is two. For Lagrangian systems, the implementation uses _p[1] for storing the discrete impulse. Main functions: - computeFreeState(): computes xfree (or vfree), dynamical systems state without taking non-smooth part into account \n - updateState(): computes x (q,v), the complete dynamical systems states. See User's guide for details. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _theta = property(_sicpykernel.MoreauJeanOSI__theta_get, _sicpykernel.MoreauJeanOSI__theta_set, doc=r""" theta-scheme parameter""") _gamma = property(_sicpykernel.MoreauJeanOSI__gamma_get, _sicpykernel.MoreauJeanOSI__gamma_set, doc=r""" A gamma parameter for the forecast of activation of constraints leap-frog estimation of the constraints :math:`\tilde y_k = y_k + \gamma * h * ydot` """) _useGamma = property(_sicpykernel.MoreauJeanOSI__useGamma_get, _sicpykernel.MoreauJeanOSI__useGamma_set, doc=r""" a boolean to know if the gamma-parameter must be used or not""") _constraintActivationThreshold = property(_sicpykernel.MoreauJeanOSI__constraintActivationThreshold_get, _sicpykernel.MoreauJeanOSI__constraintActivationThreshold_set, doc=r""" Constraint activation threshold""") _useGammaForRelation = property(_sicpykernel.MoreauJeanOSI__useGammaForRelation_get, _sicpykernel.MoreauJeanOSI__useGammaForRelation_set, doc=r""" a boolean to know if the parameter must be used or not""") _explicitNewtonEulerDSOperators = property(_sicpykernel.MoreauJeanOSI__explicitNewtonEulerDSOperators_get, _sicpykernel.MoreauJeanOSI__explicitNewtonEulerDSOperators_set, doc=r""" a boolean to force the evaluation of T in an explicit way""") _isWSymmetricDefinitePositive = property(_sicpykernel.MoreauJeanOSI__isWSymmetricDefinitePositive_get, _sicpykernel.MoreauJeanOSI__isWSymmetricDefinitePositive_set, doc=r""" a boolean to know if the matrix W is symmetric definite positive""") _activateWithNegativeRelativeVelocity = property(_sicpykernel.MoreauJeanOSI__activateWithNegativeRelativeVelocity_get, _sicpykernel.MoreauJeanOSI__activateWithNegativeRelativeVelocity_set, doc=r""" a boolean to perform activation with negative relative velocity""") _constraintActivationThresholdVelocity = property(_sicpykernel.MoreauJeanOSI__constraintActivationThresholdVelocity_get, _sicpykernel.MoreauJeanOSI__constraintActivationThresholdVelocity_set, doc=r""" Constraint activation threshold""") _selected_coordinates = property(_sicpykernel.MoreauJeanOSI__selected_coordinates_get, _sicpykernel.MoreauJeanOSI__selected_coordinates_set, doc=r""" A set of work indices for the selected coordinates when we subprod in computeFreeOuput """) RESIDU_FREE = _sicpykernel.MoreauJeanOSI_RESIDU_FREE VFREE = _sicpykernel.MoreauJeanOSI_VFREE BUFFER = _sicpykernel.MoreauJeanOSI_BUFFER QTMP = _sicpykernel.MoreauJeanOSI_QTMP WORK_LENGTH = _sicpykernel.MoreauJeanOSI_WORK_LENGTH OSNSP_RHS = _sicpykernel.MoreauJeanOSI_OSNSP_RHS WORK_INTERACTION_LENGTH = _sicpykernel.MoreauJeanOSI_WORK_INTERACTION_LENGTH xfree = _sicpykernel.MoreauJeanOSI_xfree BLOCK_WORK_LENGTH = _sicpykernel.MoreauJeanOSI_BLOCK_WORK_LENGTH def __init__(self, *args): r""" constructor from theta value only :type theta: float, optional :param theta: value for all linked DS (default = 0.5). :type gamma: float, optional :param gamma: value for all linked DS (default = NaN and gamma is not used). """ if self.__class__ == MoreauJeanOSI: _self = None else: _self = self _sicpykernel.MoreauJeanOSI_swiginit(self, _sicpykernel.new_MoreauJeanOSI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MoreauJeanOSI
[docs] def getW(self, *args) -> "SimpleMatrix const": r""" get the value of W corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem`, optional :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get W[0] in that case :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.MoreauJeanOSI_getW(self, *args)
[docs] def W(self, ds: "SP::DynamicalSystem") -> "SP::SimpleMatrix": r""" get W corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem :rtype: :py:class:`SimpleMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.MoreauJeanOSI_W(self, ds)
def isWSymmetricDefinitePositive(self) -> "bool": return _sicpykernel.MoreauJeanOSI_isWSymmetricDefinitePositive(self) def setIsWSymmetricDefinitePositive(self, b: "bool") -> "void": return _sicpykernel.MoreauJeanOSI_setIsWSymmetricDefinitePositive(self, b)
[docs] def getWBoundaryConditions(self, *args) -> "SimpleMatrix const": r""" Get the value of WBoundaryConditions corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem`, optional :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case :rtype: :py:class:`SimpleMatrix` :return: SimpleMatrix """ return _sicpykernel.MoreauJeanOSI_getWBoundaryConditions(self, *args)
[docs] def WBoundaryConditions(self, ds: "SP::DynamicalSystem") -> "SP::SiconosMatrix": r""" get WBoundaryConditions corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem, optional, default = nullptr. get WBoundaryConditions[0] in that case :rtype: :py:class:`SiconosMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.MoreauJeanOSI_WBoundaryConditions(self, ds)
[docs] def theta(self) -> "double": r""" get theta :rtype: float :return: a double """ return _sicpykernel.MoreauJeanOSI_theta(self)
[docs] def setTheta(self, newTheta: "double") -> "void": r""" set the value of theta :type newTheta: float :param newTheta: a double """ return _sicpykernel.MoreauJeanOSI_setTheta(self, newTheta)
[docs] def gamma(self) -> "double": r""" get gamma :rtype: float :return: a double """ return _sicpykernel.MoreauJeanOSI_gamma(self)
[docs] def setGamma(self, newGamma: "double") -> "void": r""" set the value of gamma :type newGamma: float :param newGamma: a double """ return _sicpykernel.MoreauJeanOSI_setGamma(self, newGamma)
[docs] def useGamma(self) -> "bool": r""" get bool useGamma :rtype: boolean :return: a bool """ return _sicpykernel.MoreauJeanOSI_useGamma(self)
[docs] def setUseGamma(self, newUseGamma: "bool") -> "void": r""" set the Boolean to indicate that we use gamma :type newUseGamma: boolean :param newUseGamma: a Boolean variable """ return _sicpykernel.MoreauJeanOSI_setUseGamma(self, newUseGamma)
[docs] def useGammaForRelation(self) -> "bool": r""" get bool gammaForRelation for the relation :rtype: boolean :return: a Boolean """ return _sicpykernel.MoreauJeanOSI_useGammaForRelation(self)
[docs] def setUseGammaForRelation(self, newUseGammaForRelation: "bool") -> "void": r""" set the boolean to indicate that we use gamma for the relation :type newUseGammaForRelation: boolean :param newUseGammaForRelation: a Boolean """ return _sicpykernel.MoreauJeanOSI_setUseGammaForRelation(self, newUseGammaForRelation)
[docs] def setConstraintActivationThreshold(self, v: "double") -> "void": r""" set the constraint activation threshold""" return _sicpykernel.MoreauJeanOSI_setConstraintActivationThreshold(self, v)
[docs] def constraintActivationThreshold(self) -> "double": r""" get the constraint activation threshold""" return _sicpykernel.MoreauJeanOSI_constraintActivationThreshold(self)
[docs] def setConstraintActivationThresholdVelocity(self, v: "double") -> "void": r""" set the constraint activation threshold""" return _sicpykernel.MoreauJeanOSI_setConstraintActivationThresholdVelocity(self, v)
[docs] def constraintActivationThresholdVelocity(self) -> "double": r""" get the constraint activation threshold""" return _sicpykernel.MoreauJeanOSI_constraintActivationThresholdVelocity(self)
[docs] def explicitNewtonEulerDSOperators(self) -> "bool": r""" get boolean _explicitNewtonEulerDSOperators for the relation :rtype: boolean :return: a Boolean """ return _sicpykernel.MoreauJeanOSI_explicitNewtonEulerDSOperators(self)
[docs] def setExplicitNewtonEulerDSOperators(self, newExplicitNewtonEulerDSOperators: "bool") -> "void": r""" set the boolean to indicate that we use gamma for the relation :type newExplicitNewtonEulerDSOperators: boolean :param newExplicitNewtonEulerDSOperators: a Boolean """ return _sicpykernel.MoreauJeanOSI_setExplicitNewtonEulerDSOperators(self, newExplicitNewtonEulerDSOperators)
[docs] def activateWithNegativeRelativeVelocity(self) -> "bool": r""" get boolean _activateWithNegativeRelativeVelocity :rtype: boolean :return: a Boolean """ return _sicpykernel.MoreauJeanOSI_activateWithNegativeRelativeVelocity(self)
[docs] def setActivateWithNegativeRelativeVelocity(self, newActivateWithNegativeRelativeVelocity: "bool") -> "void": r""" set the boolean to perform activation with negative relative velocity :param newActivateWithNegativeRealtiveVelocity: a Boolean """ return _sicpykernel.MoreauJeanOSI_setActivateWithNegativeRelativeVelocity(self, newActivateWithNegativeRelativeVelocity)
[docs] def initialize_nonsmooth_problems(self) -> "void": r""" initialization of the MoreauJeanOSI integrator; for linear time invariant systems, we compute time invariant operator (example : W) Initialization process of the nonsmooth problems linked to this OSI """ return _sicpykernel.MoreauJeanOSI_initialize_nonsmooth_problems(self)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.MoreauJeanOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.MoreauJeanOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.MoreauJeanOSI_numberOfIndexSets(self)
[docs] def initializeIterationMatrixW(self, time: "double", ds: "SP::SecondOrderDS") -> "void": r""" initialize iteration matrix W MoreauJeanOSI matrix at time t :type time: float :param time: :type ds: :py:class:`SecondOrderDS` :param ds: a pointer to DynamicalSystem """ return _sicpykernel.MoreauJeanOSI_initializeIterationMatrixW(self, time, ds)
[docs] def computeW(self, time: "double", ds: "SecondOrderDS", W: "SiconosMatrix") -> "void": r""" compute W MoreauJeanOSI matrix at time t :type time: float :param time: (double) :type ds: :py:class:`SecondOrderDS` :param ds: a DynamicalSystem :type W: :py:class:`SiconosMatrix` :param W: the result in W """ return _sicpykernel.MoreauJeanOSI_computeW(self, time, ds, W)
[docs] def Winverse(self, ds: "SP::SecondOrderDS", keepW: "bool"=False) -> "SP::SimpleMatrix": r""" get and compute if needed W MoreauJeanOSI matrix at time t :param time: (double) :type ds: :py:class:`SecondOrderDS` :param ds: a DynamicalSystem :param Winverse: the result in Winverse :type keepW: boolean, optional :param keepW: """ return _sicpykernel.MoreauJeanOSI_Winverse(self, ds, keepW)
def _computeWBoundaryConditions(self, ds: "SecondOrderDS", WBoundaryConditions: "SiconosMatrix", iteration_matrix: "SiconosMatrix") -> "void": r""" compute WBoundaryConditionsMap[ds] MoreauJeanOSI matrix at time t :type ds: :py:class:`SecondOrderDS` :param ds: a pointer to DynamicalSystem :type WBoundaryConditions: :py:class:`SiconosMatrix` :param WBoundaryConditions: write the result in WBoundaryConditions :type iteration_matrix: :py:class:`SiconosMatrix` :param iteration_matrix: the OSI iteration matrix (W) """ return _sicpykernel.MoreauJeanOSI__computeWBoundaryConditions(self, ds, WBoundaryConditions, iteration_matrix) def _initializeIterationMatrixWBoundaryConditions(self, ds: "SecondOrderDS", dsv: "DynamicalSystemsGraph::VDescriptor const &") -> "void": r""" initialize iteration matrix WBoundaryConditionsMap[ds] MoreauJeanOSI :type ds: :py:class:`SecondOrderDS` :param ds: a pointer to DynamicalSystem :type dsv: DynamicalSystemsGraph::VDescriptor :param dsv: a descriptor of the ds on the graph (redundant) """ return _sicpykernel.MoreauJeanOSI__initializeIterationMatrixWBoundaryConditions(self, ds, dsv) def applyBoundaryConditions(self, d: "SecondOrderDS", residu: "SiconosVector", dsi: "DynamicalSystemsGraph::VIterator", t: "double", v: "SiconosVector") -> "void": return _sicpykernel.MoreauJeanOSI_applyBoundaryConditions(self, d, residu, dsi, t, v)
[docs] def computeInitialNewtonState(self) -> "void": r""" compute the initial state of the Newton loop.""" return _sicpykernel.MoreauJeanOSI_computeInitialNewtonState(self)
[docs] def computeResidu(self) -> "double": r""" return the maximum of all norms for the "MoreauJeanOSI-discretized" residus of DS :rtype: float :return: a double """ return _sicpykernel.MoreauJeanOSI_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p) """ return _sicpykernel.MoreauJeanOSI_computeFreeState(self)
[docs] def computeFreeOutput(self, vertex_inter: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" integrates the Interaction linked to this integrator, without taking non-smooth effects into account :type vertex_inter: InteractionsGraph::VDescriptor :param vertex_inter: vertex of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: pointer to OneStepNSProblem """ return _sicpykernel.MoreauJeanOSI_computeFreeOutput(self, vertex_inter, osnsp)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to know if it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: the Interaction to test :type i: int :param i: level of the IndexSet :rtype: boolean :return: Boolean """ return _sicpykernel.MoreauJeanOSI_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to know if it should be removed from the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: the Interaction to test :type i: int :param i: level of the IndexSet :rtype: boolean :return: Boolean """ return _sicpykernel.MoreauJeanOSI_removeInteractionFromIndexSet(self, inter, i)
[docs] def prepareNewtonIteration(self, time: "double") -> "void": r""" method to prepare the fist Newton iteration :type time: float :param time: """ return _sicpykernel.MoreauJeanOSI_prepareNewtonIteration(self, time)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", notUsed: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: the initial time :type tend: float :param tend: the end time :type tout: float :param tout: the real end time :type notUsed: int :param notUsed: useless flag (for MoreauJeanOSI, used in LsodarOSI) """ return _sicpykernel.MoreauJeanOSI_integrate(self, tinit, tend, tout, notUsed)
[docs] def updatePosition(self, ds: "DynamicalSystem") -> "void": r""" update the state of the dynamical systems :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical to update """ return _sicpykernel.MoreauJeanOSI_updatePosition(self, ds)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" update the state of the dynamical systems :type level: int :param level: the level of interest for the dynamics: not used at the time """ return _sicpykernel.MoreauJeanOSI_updateState(self, level)
[docs] def computeWorkForces(self) -> "SP::SimpleMatrix": r""" Compute the matrix of work of forces by ds :rtype: :py:class:`SimpleMatrix` :return: SP::Siconosmatrix """ return _sicpykernel.MoreauJeanOSI_computeWorkForces(self)
[docs] def display(self) -> "void": r""" Displays the data of the MoreauJeanOSI's integrator""" return _sicpykernel.MoreauJeanOSI_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_MoreauJeanOSI(self) return weakref.proxy(self)
# Register MoreauJeanOSI in _sicpykernel: _sicpykernel.MoreauJeanOSI_swigregister(MoreauJeanOSI) MOREAUSTEPSINMEMORY = cvar.MOREAUSTEPSINMEMORY
[docs] class MoreauJeanBilbaoOSI(OneStepIntegrator): r""" One-step integrator for event-capturing simulation combining Moreau-Jean and Bilbao numerical scheme. Numerical scheme which combines an exact method (Bilbao) for the linear (non-contacting) part of the equations of motion with a Moreau-Jean time-stepping for the nonsmooth part. Check details in users'guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr TWO_DT_SIGMA_STAR = _sicpykernel.MoreauJeanBilbaoOSI_TWO_DT_SIGMA_STAR ONE_MINUS_THETA = _sicpykernel.MoreauJeanBilbaoOSI_ONE_MINUS_THETA VFREE = _sicpykernel.MoreauJeanBilbaoOSI_VFREE WORK_LENGTH = _sicpykernel.MoreauJeanBilbaoOSI_WORK_LENGTH OSNSP_RHS = _sicpykernel.MoreauJeanBilbaoOSI_OSNSP_RHS WORK_INTERACTION_LENGTH = _sicpykernel.MoreauJeanBilbaoOSI_WORK_INTERACTION_LENGTH xfree = _sicpykernel.MoreauJeanBilbaoOSI_xfree BLOCK_WORK_LENGTH = _sicpykernel.MoreauJeanBilbaoOSI_BLOCK_WORK_LENGTH def __init__(self): r""" Constructor - No extra parameters: depends only on connected ds and simulation time step """ if self.__class__ == MoreauJeanBilbaoOSI: _self = None else: _self = self _sicpykernel.MoreauJeanBilbaoOSI_swiginit(self, _sicpykernel.new_MoreauJeanBilbaoOSI(_self, )) __swig_destroy__ = _sicpykernel.delete_MoreauJeanBilbaoOSI
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.MoreauJeanBilbaoOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.MoreauJeanBilbaoOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
def _initialize_iteration_matrix(self, ds: "SP::DynamicalSystem") -> "void": return _sicpykernel.MoreauJeanBilbaoOSI__initialize_iteration_matrix(self, ds)
[docs] def initialize_nonsmooth_problems(self) -> "void": r""" Initialization process of the nonsmooth problems linked to this OSI """ return _sicpykernel.MoreauJeanBilbaoOSI_initialize_nonsmooth_problems(self)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.MoreauJeanBilbaoOSI_numberOfIndexSets(self)
def compute_parameters(self, time_step: "double", omega: "double", sigma: "double", theta: "double &", sigma_star: "double &") -> "void": return _sicpykernel.MoreauJeanBilbaoOSI_compute_parameters(self, time_step, omega, sigma, theta, sigma_star)
[docs] def iteration_matrix(self, ds: "SP::DynamicalSystem") -> "SP::SimpleMatrix": r""" get iteration_matrix (pointer link) corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: a pointer to DynamicalSystem :rtype: :py:class:`SimpleMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.MoreauJeanBilbaoOSI_iteration_matrix(self, ds)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", idid: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: initial time :type tend: float :param tend: end time :type tout: float :param tout: real end time :type idid: int :param idid: flag used in EventDriven schemes """ return _sicpykernel.MoreauJeanBilbaoOSI_integrate(self, tinit, tend, tout, idid)
[docs] def computeResidu(self) -> "double": r""" return the maximum of all norms for the "MoreauJeanOSI-discretized" residus of DS :rtype: float :return: a double """ return _sicpykernel.MoreauJeanBilbaoOSI_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input ( _p) """ return _sicpykernel.MoreauJeanBilbaoOSI_computeFreeState(self)
[docs] def computeFreeOutput(self, vertex_inter: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" integrates the Interaction linked to this integrator, without taking non-smooth effects into account :type vertex_inter: InteractionsGraph::VDescriptor :param vertex_inter: vertex of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: pointer to OneStepNSProblem """ return _sicpykernel.MoreauJeanBilbaoOSI_computeFreeOutput(self, vertex_inter, osnsp)
[docs] def updatePosition(self, ds: "DynamicalSystem") -> "void": r""" update the state of the dynamical systems :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical to update """ return _sicpykernel.MoreauJeanBilbaoOSI_updatePosition(self, ds)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" update the state of the DynamicalSystem attached to this Integrator :type level: int :param level: level of interest for the dynamics level is set to 0 by default since in all time-stepping schemes we update all the state whatever the value of level is. """ return _sicpykernel.MoreauJeanBilbaoOSI_updateState(self, level)
[docs] def display(self) -> "void": r""" print the data to the screen""" return _sicpykernel.MoreauJeanBilbaoOSI_display(self)
def prepareNewtonIteration(self, time: "double") -> "void": return _sicpykernel.MoreauJeanBilbaoOSI_prepareNewtonIteration(self, time)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to know if it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: the Interaction to test :type i: int :param i: level of the IndexSet :rtype: boolean :return: Boolean """ return _sicpykernel.MoreauJeanBilbaoOSI_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to know if it should be removed from the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: the Interaction to test :type i: int :param i: level of the IndexSet :rtype: boolean :return: Boolean """ return _sicpykernel.MoreauJeanBilbaoOSI_removeInteractionFromIndexSet(self, inter, i)
def __disown__(self): self.this.disown() _sicpykernel.disown_MoreauJeanBilbaoOSI(self) return weakref.proxy(self)
# Register MoreauJeanBilbaoOSI in _sicpykernel: _sicpykernel.MoreauJeanBilbaoOSI_swigregister(MoreauJeanBilbaoOSI)
[docs] class MoreauJeanCombinedProjectionOSI(MoreauJeanOSI): r""" One Step time Integrator for First Order Dynamical Systems for mechanical Systems (LagrangianDS and NewtonEulerDS) with Combined Projection Algorithm This class reimplement a special activation of constraints in the MoreauJeanOSI for the Combined Projection Algorithm References : V. Acary. Projected event-capturing time-stepping schemes for nonsmooth mechanical systems with unilateral contact and coulomb’s friction. Computer Methods in Applied Mechanics and Engineering, 256:224 – 250, 2013. ISSN 0045-7825. URL http://www.sciencedirect.com/science/article/pii/S0045782512003829. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor from theta value only :type theta: float :param theta: value for all these DS. """ if self.__class__ == MoreauJeanCombinedProjectionOSI: _self = None else: _self = self _sicpykernel.MoreauJeanCombinedProjectionOSI_swiginit(self, _sicpykernel.new_MoreauJeanCombinedProjectionOSI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MoreauJeanCombinedProjectionOSI
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.MoreauJeanCombinedProjectionOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.MoreauJeanCombinedProjectionOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.MoreauJeanCombinedProjectionOSI_numberOfIndexSets(self)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: concerned interaction :type i: int :param i: level :rtype: boolean :return: bool """ return _sicpykernel.MoreauJeanCombinedProjectionOSI_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be removed in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: concerned interaction :type i: int :param i: level :rtype: boolean :return: bool """ return _sicpykernel.MoreauJeanCombinedProjectionOSI_removeInteractionFromIndexSet(self, inter, i)
def __disown__(self): self.this.disown() _sicpykernel.disown_MoreauJeanCombinedProjectionOSI(self) return weakref.proxy(self)
# Register MoreauJeanCombinedProjectionOSI in _sicpykernel: _sicpykernel.MoreauJeanCombinedProjectionOSI_swigregister(MoreauJeanCombinedProjectionOSI) MOREAUCOMBINEDPROJECTIONOSISTEPSINMEMORY = cvar.MOREAUCOMBINEDPROJECTIONOSISTEPSINMEMORY
[docs] class MoreauJeanDirectProjectionOSI(MoreauJeanOSI): r""" One Step time Integrator for First Order Dynamical Systems for mechanical Systems (LagrangianDS and NewtonEulerDS) with Direct Projection Algorithm This class reimplement a special activation of constraints in the MoreauJeanOSI for the Direct Projection Algorithm References : V. Acary. Projected event-capturing time-stepping schemes for nonsmooth mechanical systems with unilateral contact and coulomb’s friction. Computer Methods in Applied Mechanics and Engineering, 256:224 – 250, 2013. ISSN 0045-7825. URL http://www.sciencedirect.com/science/article/pii/S0045782512003829. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _deactivateYPosThreshold = property(_sicpykernel.MoreauJeanDirectProjectionOSI__deactivateYPosThreshold_get, _sicpykernel.MoreauJeanDirectProjectionOSI__deactivateYPosThreshold_set) _deactivateYVelThreshold = property(_sicpykernel.MoreauJeanDirectProjectionOSI__deactivateYVelThreshold_get, _sicpykernel.MoreauJeanDirectProjectionOSI__deactivateYVelThreshold_set) _activateYPosThreshold = property(_sicpykernel.MoreauJeanDirectProjectionOSI__activateYPosThreshold_get, _sicpykernel.MoreauJeanDirectProjectionOSI__activateYPosThreshold_set) _activateYVelThreshold = property(_sicpykernel.MoreauJeanDirectProjectionOSI__activateYVelThreshold_get, _sicpykernel.MoreauJeanDirectProjectionOSI__activateYVelThreshold_set) def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor from theta value only :type theta: float :param theta: value for all these DS. | *Overload 3:* constructor from theta value only :type theta: float :param theta: value for all these DS. :type gamma: float :param gamma: value for all these DS. """ if self.__class__ == MoreauJeanDirectProjectionOSI: _self = None else: _self = self _sicpykernel.MoreauJeanDirectProjectionOSI_swiginit(self, _sicpykernel.new_MoreauJeanDirectProjectionOSI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MoreauJeanDirectProjectionOSI def deactivateYPosThreshold(self) -> "double": return _sicpykernel.MoreauJeanDirectProjectionOSI_deactivateYPosThreshold(self) def setDeactivateYPosThreshold(self, newValue: "double") -> "void": return _sicpykernel.MoreauJeanDirectProjectionOSI_setDeactivateYPosThreshold(self, newValue) def deactivateYVelThreshold(self) -> "double": return _sicpykernel.MoreauJeanDirectProjectionOSI_deactivateYVelThreshold(self) def setDeactivateYVelThreshold(self, newValue: "double") -> "void": return _sicpykernel.MoreauJeanDirectProjectionOSI_setDeactivateYVelThreshold(self, newValue) def activateYPosThreshold(self) -> "double": return _sicpykernel.MoreauJeanDirectProjectionOSI_activateYPosThreshold(self) def setActivateYPosThreshold(self, newValue: "double") -> "void": return _sicpykernel.MoreauJeanDirectProjectionOSI_setActivateYPosThreshold(self, newValue) def activateYVelThreshold(self) -> "double": return _sicpykernel.MoreauJeanDirectProjectionOSI_activateYVelThreshold(self) def setActivateYVelThreshold(self, newValue: "double") -> "void": return _sicpykernel.MoreauJeanDirectProjectionOSI_setActivateYVelThreshold(self, newValue)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.MoreauJeanDirectProjectionOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.MoreauJeanDirectProjectionOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.MoreauJeanDirectProjectionOSI_numberOfIndexSets(self)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: concerned interaction :type i: int :param i: level :rtype: boolean :return: bool """ return _sicpykernel.MoreauJeanDirectProjectionOSI_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be removed in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: concerned interaction :type i: int :param i: level :rtype: boolean :return: bool """ return _sicpykernel.MoreauJeanDirectProjectionOSI_removeInteractionFromIndexSet(self, inter, i)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p) """ return _sicpykernel.MoreauJeanDirectProjectionOSI_computeFreeState(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_MoreauJeanDirectProjectionOSI(self) return weakref.proxy(self)
# Register MoreauJeanDirectProjectionOSI in _sicpykernel: _sicpykernel.MoreauJeanDirectProjectionOSI_swigregister(MoreauJeanDirectProjectionOSI) MOREAUPROJECTONCONSTRAINTSOSISTEPSINMEMORY = cvar.MOREAUPROJECTONCONSTRAINTSOSISTEPSINMEMORY
[docs] class MoreauJeanGOSI(MoreauJeanOSI): r""" A global version of the MoreauJeanOSI integrator""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr RESIDU_FREE = _sicpykernel.MoreauJeanGOSI_RESIDU_FREE FREE = _sicpykernel.MoreauJeanGOSI_FREE LOCAL_BUFFER = _sicpykernel.MoreauJeanGOSI_LOCAL_BUFFER WORK_LENGTH = _sicpykernel.MoreauJeanGOSI_WORK_LENGTH def __init__(self, *args): r""" constructor from theta value only :type theta: float, optional :param theta: value for all linked DS (default = 0.5). :type gamma: float, optional :param gamma: value for all linked DS (default = NaN and gamma is not used). """ if self.__class__ == MoreauJeanGOSI: _self = None else: _self = self _sicpykernel.MoreauJeanGOSI_swiginit(self, _sicpykernel.new_MoreauJeanGOSI(_self, *args)) __swig_destroy__ = _sicpykernel.delete_MoreauJeanGOSI
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.MoreauJeanGOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.MoreauJeanGOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def computeResidu(self) -> "double": r""" :rtype: float :return: the maximum of all norms for the "MoreauJeanGOSI-discretized" residus of DS """ return _sicpykernel.MoreauJeanGOSI_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p) """ return _sicpykernel.MoreauJeanGOSI_computeFreeState(self)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", notUsed: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: the initial time :type tend: float :param tend: the end time :type tout: float :param tout: the real end time :type notUsed: int :param notUsed: useless flag (for MoreauJeanGOSI, used in LsodarOSI) """ return _sicpykernel.MoreauJeanGOSI_integrate(self, tinit, tend, tout, notUsed)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" update the state of the dynamical systems :type level: int :param level: the level of interest for the dynamics: not used at the time """ return _sicpykernel.MoreauJeanGOSI_updateState(self, level)
[docs] def NonSmoothLawContributionToOutput(self, inter: "SP::Interaction", osnsp: "OneStepNSProblem") -> "void": r""" Compute the nonsmooth law contribution to the output :type inter: :py:class:`Interaction` :param inter: the interaction (for y_k) :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: the non-smooth integrator """ return _sicpykernel.MoreauJeanGOSI_NonSmoothLawContributionToOutput(self, inter, osnsp)
[docs] def display(self) -> "void": r""" Displays the data of the MoreauJeanGOSI's integrator""" return _sicpykernel.MoreauJeanGOSI_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_MoreauJeanGOSI(self) return weakref.proxy(self)
# Register MoreauJeanGOSI in _sicpykernel: _sicpykernel.MoreauJeanGOSI_swigregister(MoreauJeanGOSI)
[docs] class ZeroOrderHoldOSI(OneStepIntegrator): r""" ZeroOrderHoldOSI Time-Integrator for Dynamical Systems See User's guide for details. ZeroOrderHoldOSI class is used to define some time-integrators methods for a list of dynamical systems. A ZeroOrderHoldOSI instance is defined by the value of theta and the list of concerned dynamical systems. Each DynamicalSystem is associated to - computeFreeState(): computes xfree of dynamical systems state without taking the non-smooth part into account - updateState(): update the state x of the dynamical systems """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _useGammaForRelation = property(_sicpykernel.ZeroOrderHoldOSI__useGammaForRelation_get, _sicpykernel.ZeroOrderHoldOSI__useGammaForRelation_set, doc=r""" Unused for now""") RESIDU_FREE = _sicpykernel.ZeroOrderHoldOSI_RESIDU_FREE FREE = _sicpykernel.ZeroOrderHoldOSI_FREE DELTA_X_FOR_RELATION = _sicpykernel.ZeroOrderHoldOSI_DELTA_X_FOR_RELATION WORK_LENGTH = _sicpykernel.ZeroOrderHoldOSI_WORK_LENGTH OSNSP_RHS = _sicpykernel.ZeroOrderHoldOSI_OSNSP_RHS H_ALPHA = _sicpykernel.ZeroOrderHoldOSI_H_ALPHA WORK_INTERACTION_LENGTH = _sicpykernel.ZeroOrderHoldOSI_WORK_INTERACTION_LENGTH xfree = _sicpykernel.ZeroOrderHoldOSI_xfree DELTA_X = _sicpykernel.ZeroOrderHoldOSI_DELTA_X BLOCK_WORK_LENGTH = _sicpykernel.ZeroOrderHoldOSI_BLOCK_WORK_LENGTH def __init__(self): r""" basic constructor""" if self.__class__ == ZeroOrderHoldOSI: _self = None else: _self = self _sicpykernel.ZeroOrderHoldOSI_swiginit(self, _sicpykernel.new_ZeroOrderHoldOSI(_self, )) __swig_destroy__ = _sicpykernel.delete_ZeroOrderHoldOSI
[docs] def Ad(self, ds: "SP::DynamicalSystem") -> "SiconosMatrix const &": r""" get :math:`\Phi` corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem :rtype: :py:class:`SiconosMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.ZeroOrderHoldOSI_Ad(self, ds)
[docs] def Bd(self, ds: "SP::DynamicalSystem") -> "SiconosMatrix const &": r""" get :math:`B_d` corresponding to DynamicalSystem ds :type ds: :py:class:`DynamicalSystem` :param ds: the DynamicalSystem :rtype: :py:class:`SiconosMatrix` :return: pointer to a SiconosMatrix """ return _sicpykernel.ZeroOrderHoldOSI_Bd(self, ds)
[docs] def initializeWorkVectorsForDS(self, t: "double", ds: "SP::DynamicalSystem") -> "void": r""" initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi :type t: float :param t: time of initialization :type ds: :py:class:`DynamicalSystem` :param ds: the dynamical system """ return _sicpykernel.ZeroOrderHoldOSI_initializeWorkVectorsForDS(self, t, ds)
[docs] def initializeWorkVectorsForInteraction(self, inter: "Interaction", interProp: "InteractionProperties &", DSG: "DynamicalSystemsGraph") -> "void": r""" initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi :type inter: :py:class:`Interaction` :param inter: the interaction :type interProp: InteractionProperties :param interProp: the properties on the graph :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the dynamical systems graph """ return _sicpykernel.ZeroOrderHoldOSI_initializeWorkVectorsForInteraction(self, inter, interProp, DSG)
[docs] def numberOfIndexSets(self) -> "unsigned int": r""" get the number of index sets required for the simulation :rtype: int :return: unsigned int """ return _sicpykernel.ZeroOrderHoldOSI_numberOfIndexSets(self)
[docs] def computeResidu(self) -> "double": r""" return the maximum of all norms for the "ZeroOrderHoldOSI-discretized" residus of DS :rtype: float :return: a double """ return _sicpykernel.ZeroOrderHoldOSI_computeResidu(self)
[docs] def computeFreeState(self) -> "void": r""" Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p) """ return _sicpykernel.ZeroOrderHoldOSI_computeFreeState(self)
[docs] def computeFreeOutput(self, vertex_inter: "InteractionsGraph::VDescriptor &", osnsp: "OneStepNSProblem") -> "void": r""" Compute the Output (y) which corresponds to the free state (state without taking into account the nonsmooth input) plus the possible contribution of the nslaw :type vertex_inter: InteractionsGraph::VDescriptor :param vertex_inter: of the interaction graph :type osnsp: :py:class:`OneStepNSProblem` :param osnsp: a pointer to the OneStepNSProblem """ return _sicpykernel.ZeroOrderHoldOSI_computeFreeOutput(self, vertex_inter, osnsp)
[docs] def addInteractionInIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: a pointer to the Interaction to be added :type i: int :param i: the level of the IndexSet :rtype: boolean :return: true if y<=0 """ return _sicpykernel.ZeroOrderHoldOSI_addInteractionInIndexSet(self, inter, i)
[docs] def removeInteractionFromIndexSet(self, inter: "SP::Interaction", i: "unsigned int") -> "bool": r""" Apply the rule to one Interaction to known if is it should be removed in the IndexSet of level i :type inter: :py:class:`Interaction` :param inter: a pointer to the Interaction to be removed :type i: int :param i: the level of the IndexSet :rtype: boolean :return: true if y>0 """ return _sicpykernel.ZeroOrderHoldOSI_removeInteractionFromIndexSet(self, inter, i)
[docs] def prepareNewtonIteration(self, time: "double") -> "void": r""" Unused :type time: float :param time: current time """ return _sicpykernel.ZeroOrderHoldOSI_prepareNewtonIteration(self, time)
[docs] def integrate(self, tinit: "double &", tend: "double &", tout: "double &", notUsed: "int &") -> "void": r""" integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false) :type tinit: float :param tinit: initial time :type tend: float :param tend: end time :type tout: float :param tout: real end time :type notUsed: int :param notUsed: useless flag (for ZeroOrderHoldOSI, used in LsodarOSI) """ return _sicpykernel.ZeroOrderHoldOSI_integrate(self, tinit, tend, tout, notUsed)
[docs] def updateState(self, level: "unsigned int const") -> "void": r""" updates the state of the Dynamical Systems :type level: int :param level: level of interest for the dynamics: not used at this moment """ return _sicpykernel.ZeroOrderHoldOSI_updateState(self, level)
[docs] def display(self) -> "void": r""" Displays the data of the ZeroOrderHoldOSI's integrator""" return _sicpykernel.ZeroOrderHoldOSI_display(self)
def updateMatrices(self, ds: "SP::DynamicalSystem") -> "void": return _sicpykernel.ZeroOrderHoldOSI_updateMatrices(self, ds) def __disown__(self): self.this.disown() _sicpykernel.disown_ZeroOrderHoldOSI(self) return weakref.proxy(self)
# Register ZeroOrderHoldOSI in _sicpykernel: _sicpykernel.ZeroOrderHoldOSI_swigregister(ZeroOrderHoldOSI) ZOHSTEPSINMEMORY = cvar.ZOHSTEPSINMEMORY
[docs] class Simulation(object): r""" Description of the simulation process (integrators, time discretisation and so on). This is an abstract class. The available simulations are TimeStepping, EventDriven and TimeSteppingD1Minus. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _name = property(_sicpykernel.Simulation__name_get, _sicpykernel.Simulation__name_set, doc=r""" name or id of the Simulation""") _eventsManager = property(_sicpykernel.Simulation__eventsManager_get, _sicpykernel.Simulation__eventsManager_set, doc=r""" tool to manage all events""") _tinit = property(_sicpykernel.Simulation__tinit_get, _sicpykernel.Simulation__tinit_set, doc=r""" current starting time for integration""") _tend = property(_sicpykernel.Simulation__tend_get, _sicpykernel.Simulation__tend_set, doc=r""" current ending time for integration""") _tout = property(_sicpykernel.Simulation__tout_get, _sicpykernel.Simulation__tout_set, doc=r""" real ending time for integration (different from tend in case of stop during integrate, for example when a root is found in an EventDriven strategy) """) _T = property(_sicpykernel.Simulation__T_get, _sicpykernel.Simulation__T_set) _allOSI = property(_sicpykernel.Simulation__allOSI_get, _sicpykernel.Simulation__allOSI_set, doc=r""" the dynamical systems integrators""") _allNSProblems = property(_sicpykernel.Simulation__allNSProblems_get, _sicpykernel.Simulation__allNSProblems_set, doc=r""" the non smooth problems (each problem is identified thanks to its id) """) _nsds = property(_sicpykernel.Simulation__nsds_get, _sicpykernel.Simulation__nsds_set, doc=r""" A pointer to the simulated nonsmooth dynamical system""") _interman = property(_sicpykernel.Simulation__interman_get, _sicpykernel.Simulation__interman_set, doc=r""" An interaction manager""") _numberOfIndexSets = property(_sicpykernel.Simulation__numberOfIndexSets_get, _sicpykernel.Simulation__numberOfIndexSets_set, doc=r""" _numberOfIndexSets is the number of index sets that we need for simulation. It corresponds for most of the simulations to levelMaxForOutput + 1. Nevertheless, some simulations need more sets of indices that the number of outputs that we considered. """) _tolerance = property(_sicpykernel.Simulation__tolerance_get, _sicpykernel.Simulation__tolerance_set, doc=r""" tolerance value used to compute the index sets. Default: equal to 10 x machine double precision (std::numeric_limits<double>::epsilon) """) _printStat = property(_sicpykernel.Simulation__printStat_get, _sicpykernel.Simulation__printStat_set, doc=r""" Output setup: if true, display solver stats""") _staticLevels = property(_sicpykernel.Simulation__staticLevels_get, _sicpykernel.Simulation__staticLevels_set, doc=r""" _staticLevels : do not recompute levels once they have been initialized """) _useRelativeConvergenceCriterion = property(_sicpykernel.Simulation__useRelativeConvergenceCriterion_get, _sicpykernel.Simulation__useRelativeConvergenceCriterion_set, doc=r""" bool, option specifying if a critere of relative convergence is used. Default value is false. """) _relativeConvergenceCriterionHeld = property(_sicpykernel.Simulation__relativeConvergenceCriterionHeld_get, _sicpykernel.Simulation__relativeConvergenceCriterionHeld_set, doc=r""" bool used to remind if the relative convergence held(useful for the newton-check-convergence). Modified only if _useRelativeConvergenceCriterion is true. """) _relativeConvergenceTol = property(_sicpykernel.Simulation__relativeConvergenceTol_get, _sicpykernel.Simulation__relativeConvergenceTol_set, doc=r""" double, relative tolerance. Used only if _useRelativeConvergenceCriterion is true. """) _isInitialized = property(_sicpykernel.Simulation__isInitialized_get, _sicpykernel.Simulation__isInitialized_set) _nsdsChangeLogPosition = property(_sicpykernel.Simulation__nsdsChangeLogPosition_get, _sicpykernel.Simulation__nsdsChangeLogPosition_set, doc=r""" current NSDS changelog position""") _OSIDSmap = property(_sicpykernel.Simulation__OSIDSmap_get, _sicpykernel.Simulation__OSIDSmap_set, doc=r""" map of not-yet-initialized DS variables for each OSI""") def __init__(self, *args): r""" *Overload 1:* default constructor, for serialization | *Overload 2:* default constructor :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type td: :py:class:`TimeDiscretisation` :param td: the timeDiscretisation for this Simulation | *Overload 3:* constructor with only a TimeDiscretisation :type td: :py:class:`TimeDiscretisation` :param td: the timeDiscretisation for this Simulation """ if self.__class__ == Simulation: _self = None else: _self = self _sicpykernel.Simulation_swiginit(self, _sicpykernel.new_Simulation(_self, *args)) __swig_destroy__ = _sicpykernel.delete_Simulation
[docs] def clear(self) -> "void": r""" clear all maps. This function should not exist, but there is a cycle with the shared_ptr: the OneStepIntegrator and OneStepNSProblem have both a link to the Simulation, and here we have all the OneStepIntegrator and OneStepNSProblem in maps. Then the memory is never freed. The clumsy way to deal with it is to call this function from the Model destructor to free the maps and then the cycle is broken Warning: do not call this yourself, it is meant to be called from the desctructor of the Model """ return _sicpykernel.Simulation_clear(self)
[docs] def name(self) -> "std::string const": r""" get the name of the Simulation :rtype: string :return: std::string : the name of the Simulation """ return _sicpykernel.Simulation_name(self)
[docs] def setName(self, newName: "std::string const &") -> "void": r""" set the name of the Simulation :type newName: string :param newName: the new name """ return _sicpykernel.Simulation_setName(self, newName)
[docs] def getTk(self) -> "double": r""" returns time instant k of the time discretisation""" return _sicpykernel.Simulation_getTk(self)
[docs] def getTkp1(self) -> "double": r""" get time instant k+1 of the time discretisation Warning: : this instant may be different from nextTime(), if for example some non-smooth events or some sensor events are present :rtype: float :return: a double. If the simulation is near the end (t_{k+1} > T), it returns NaN. """ return _sicpykernel.Simulation_getTkp1(self)
[docs] def getTkp2(self) -> "double": r""" get time instant k+2 of the time discretisation Warning: : this instant may be different from nextTime(), if for example some non-smooth events or some sensor events are present :rtype: float :return: a double. If the simulation is near the end (t_{k+2} > T), it returns NaN. """ return _sicpykernel.Simulation_getTkp2(self)
[docs] def currentTimeStep(self) -> "double": r""" returns current timestep""" return _sicpykernel.Simulation_currentTimeStep(self)
[docs] def eventsManager(self) -> "SP::EventsManager": r""" returns a pointer to the EventsManager""" return _sicpykernel.Simulation_eventsManager(self)
[docs] def startingTime(self) -> "double": r""" get "current time" (ie starting point for current integration, time of currentEvent of eventsManager.) :rtype: float :return: a double. """ return _sicpykernel.Simulation_startingTime(self)
[docs] def nextTime(self) -> "double": r""" get "next time" (ie ending point for current integration, time of nextEvent of eventsManager.) :rtype: float :return: a double. """ return _sicpykernel.Simulation_nextTime(self)
[docs] def timeStep(self) -> "double": r""" get the current time step size ("next time"-"current time") :rtype: float :return: a double. """ return _sicpykernel.Simulation_timeStep(self)
[docs] def hasNextEvent(self) -> "bool": r""" true if a future event is to be treated or not (ie if some events remain in the eventsManager). """ return _sicpykernel.Simulation_hasNextEvent(self)
[docs] def oneStepIntegrators(self) -> "SP::OSISet const": r""" get all the Integrators of the Simulation :rtype: SP::OSISet :return: an OSISset """ return _sicpykernel.Simulation_oneStepIntegrators(self)
[docs] def numberOfOSI(self) -> "size_t": r""" get the number of OSIs in the Simulation (ie the size of allOSI) :rtype: int :return: an unsigned int """ return _sicpykernel.Simulation_numberOfOSI(self)
[docs] def insertIntegrator(self, osi: "SP::OneStepIntegrator") -> "void": r""" insert an Integrator into the simulation list of integrators :type osi: :py:class:`OneStepIntegrator` :param osi: the OneStepIntegrator to add """ return _sicpykernel.Simulation_insertIntegrator(self, osi)
[docs] def associate(self, osi: "SP::OneStepIntegrator", ds: "SP::DynamicalSystem") -> "void": r""" associate an OSI with a DS""" return _sicpykernel.Simulation_associate(self, osi, ds)
[docs] def indexSet(self, i: "unsigned int") -> "SP::InteractionsGraph": r""" get a pointer to indexSets[i] :type i: int :param i: number of the required index set :rtype: :py:class:`InteractionsGraph` :return: a graph of interactions """ return _sicpykernel.Simulation_indexSet(self, i)
[docs] def oneStepNSProblems(self) -> "SP::OneStepNSProblems const": r""" get allNSProblems :rtype: SP::OneStepNSProblems :return: a pointer to OneStepNSProblems object (container of SP::OneStepNSProblem) """ return _sicpykernel.Simulation_oneStepNSProblems(self)
[docs] def numberOfOSNSProblems(self) -> "size_t": r""" get the number of OSNSP in the Simulation (ie the size of allNSProblems) :rtype: int :return: an unsigned int """ return _sicpykernel.Simulation_numberOfOSNSProblems(self)
[docs] def oneStepNSProblem(self, id: "int") -> "SP::OneStepNSProblem": r""" get a OneStep nonsmooth problem of the simulation, identify with its number. :type id: int :param id: number of the required osnspb :rtype: :py:class:`OneStepNSProblem` :return: a pointer to OneStepNSProblem """ return _sicpykernel.Simulation_oneStepNSProblem(self, id)
[docs] def insertNonSmoothProblem(self, osns: "SP::OneStepNSProblem", Id: "int"=SICONOS_OSNSP_DEFAULT) -> "void": r""" add a OneStepNSProblem in the Simulation :type osns: :py:class:`OneStepNSProblem` :param osns: the OneStepNSProblem to insert :type Id: int, optional :param Id: its id: default is SICONOS_OSNSP_DEFAULT, at impact level SICONOS_OSNSP_ED_IMPACT, at acceleration level SICONOS_OSNSP_ED_ACCELERATION """ return _sicpykernel.Simulation_insertNonSmoothProblem(self, osns, Id)
[docs] def nonSmoothDynamicalSystem(self) -> "SP::NonSmoothDynamicalSystem": r""" get the NonSmoothDynamicalSystem :rtype: :py:class:`NonSmoothDynamicalSystem` :return: NonSmoothDynamicalSystem """ return _sicpykernel.Simulation_nonSmoothDynamicalSystem(self)
[docs] def setNonSmoothDynamicalSystemPtr(self, newPtr: "SP::NonSmoothDynamicalSystem") -> "void": r""" set the NonSmoothDynamicalSystem of the Simulation :type newPtr: :py:class:`NonSmoothDynamicalSystem` :param newPtr: a pointer on NonSmoothDynamicalSystem """ return _sicpykernel.Simulation_setNonSmoothDynamicalSystemPtr(self, newPtr)
[docs] def tolerance(self) -> "double": r""" get tolerance :rtype: float :return: a double """ return _sicpykernel.Simulation_tolerance(self)
[docs] def setTolerance(self, inputVal: "double") -> "void": r""" set the value of offset for q dof vector in dynamical systems (to avoid events accumulation) :type inputVal: float :param inputVal: new tolerance """ return _sicpykernel.Simulation_setTolerance(self, inputVal)
[docs] def setPrintStat(self, newVal: "bool const &") -> "void": r""" set printStat value: if true, print solver stats. :type newVal: boolean :param newVal: true to activate stats """ return _sicpykernel.Simulation_setPrintStat(self, newVal)
[docs] def getPrintStat(self) -> "bool": r""" :rtype: boolean :return: true if stats are activated """ return _sicpykernel.Simulation_getPrintStat(self)
def computeInitialStateOfTheStep(self) -> "void": return _sicpykernel.Simulation_computeInitialStateOfTheStep(self)
[docs] def updateIndexSets(self) -> "void": r""" update all index sets of the topology, using current y and lambda values of Interactions""" return _sicpykernel.Simulation_updateIndexSets(self)
[docs] def updateIndexSet(self, level: "unsigned int") -> "void": r""" update indexSets[i] of the topology, using current y and lambda values of Interactions. :type level: int :param level: the number of the set to be updated """ return _sicpykernel.Simulation_updateIndexSet(self, level)
[docs] def initialize(self) -> "void": r""" Complete initialisation of the Simulation (OneStepIntegrators, OneStepNSProblem, TImediscretisation). """ return _sicpykernel.Simulation_initialize(self)
[docs] def initializeInteraction(self, time: "double", inter: "SP::Interaction") -> "void": r""" Initialize a single Interaction for this Simulation, used for dynamic topology updates. """ return _sicpykernel.Simulation_initializeInteraction(self, time, inter)
[docs] def insertInteractionManager(self, manager: "SP::InteractionManager") -> "void": r""" Set an object to automatically manage interactions during the simulation :type manager: :py:class:`InteractionManager` :param manager: """ return _sicpykernel.Simulation_insertInteractionManager(self, manager)
[docs] def computeResidu(self) -> "void": r""" Compute the residu of all OSI""" return _sicpykernel.Simulation_computeResidu(self)
[docs] def computeOneStepNSProblem(self, nb: "int") -> "int": r""" computes a one step NS problem :type nb: int :param nb: the id of the OneStepNSProblem to be computed :rtype: int :return: information about the solver convergence. """ return _sicpykernel.Simulation_computeOneStepNSProblem(self, nb)
[docs] def updateDSPlugins(self, time: "double") -> "void": r""" update the plugins of the DS :type time: float :param time: to be used for plugins """ return _sicpykernel.Simulation_updateDSPlugins(self, time)
[docs] def updateInput(self, level: "unsigned int") -> "void": r""" update input :type level: int :param level: lambda order used to compute input """ return _sicpykernel.Simulation_updateInput(self, level)
[docs] def updateAllInput(self) -> "void": r""" update all input terms""" return _sicpykernel.Simulation_updateAllInput(self)
[docs] def updateState(self, level: "unsigned int"=0) -> "void": r""" update state of each dynamical system""" return _sicpykernel.Simulation_updateState(self, level)
[docs] def updateOutput(self, level: "unsigned int"=0) -> "void": r""" update output :type level: int, optional :param level: lambda order used to compute output level is set to 0 by default since in all time-stepping schemes we update all the state """ return _sicpykernel.Simulation_updateOutput(self, level)
[docs] def update(self, level: "unsigned int"=0) -> "void": r""" update output, state, and input :type level: int, optional :param level: lambda order used to compute input level is set to 0 by default since in all time-stepping schemes we update all the state """ return _sicpykernel.Simulation_update(self, level)
[docs] def run(self) -> "void": r""" run the simulation, from t0 to T with default parameters if any particular settings has been done """ return _sicpykernel.Simulation_run(self)
[docs] def initializeOneStepNSProblem(self) -> "void": r""" initialisation for OneStepNSProblem.""" return _sicpykernel.Simulation_initializeOneStepNSProblem(self)
[docs] def advanceToEvent(self) -> "void": r""" step from current event to next event of EventsManager""" return _sicpykernel.Simulation_advanceToEvent(self)
[docs] def clearNSDSChangeLog(self) -> "void": r""" clear the NSDS changelog up to current position. If you have a particularly dynamic simulation (DS and Interactions created and destroyed frequently), then it is important to call this periodically. """ return _sicpykernel.Simulation_clearNSDSChangeLog(self)
[docs] def setUseRelativeConvergenceCriteron(self, use: "bool") -> "void": r""" Set the option to specify if a relative convergence criterion must be used to stop the Newton iterations. :type use: boolean :param use: true if relative critarion activated """ return _sicpykernel.Simulation_setUseRelativeConvergenceCriteron(self, use)
[docs] def useRelativeConvergenceCriteron(self) -> "bool": r""" :rtype: boolean :return: true if the relative convergence criterion is activated. """ return _sicpykernel.Simulation_useRelativeConvergenceCriteron(self)
[docs] def setRelativeConvergenceTol(self, v: "double") -> "void": r""" Set the relative convergence tolerance :type v: float :param v: tolerance value """ return _sicpykernel.Simulation_setRelativeConvergenceTol(self, v)
[docs] def relativeConvergenceTol(self) -> "double": r""" :rtype: float :return: the relative convergence tolerence. """ return _sicpykernel.Simulation_relativeConvergenceTol(self)
[docs] def setRelativeConvergenceCriterionHeld(self, newVal: "bool") -> "void": r""" :type newVal: boolean :param newVal: a new relative convergence criterion """ return _sicpykernel.Simulation_setRelativeConvergenceCriterionHeld(self, newVal)
[docs] def relativeConvergenceCriterionHeld(self) -> "bool": r""" :rtype: boolean :return: true if the relative convergence criterion held. """ return _sicpykernel.Simulation_relativeConvergenceCriterionHeld(self)
[docs] def lambda_(self, level: "unsigned int"=0, coor: "unsigned int"=0) -> "SP::SiconosVector": r""" return input lambda[level](coor) for all the interactions :type level: int, optional :param level: lambda min order to be computed :type coor: int, optional :param coor: the coordinate of interest :rtype: :py:class:`SiconosVector` :return: a SP::SiconosVector that contains the concatenated value """ return _sicpykernel.Simulation_lambda_(self, level, coor)
[docs] def y(self, level: "unsigned int"=0, coor: "unsigned int"=0) -> "SP::SiconosVector": r""" return output y[level](coor) for all the interactions :type level: int, optional :param level: y min order to be computed :type coor: int, optional :param coor: the coordinate of interest :rtype: :py:class:`SiconosVector` :return: a SP::SiconosVector that contains the concatenated value """ return _sicpykernel.Simulation_y(self, level, coor)
[docs] def processEvents(self) -> "void": r""" call eventsManager processEvents.""" return _sicpykernel.Simulation_processEvents(self)
[docs] def setStaticLevels(self, b: "bool") -> "void": r""" set staticLevels :type b: boolean :param b: decides whether levels should be computed at each iteration """ return _sicpykernel.Simulation_setStaticLevels(self, b)
[docs] def updateT(self, T: "double") -> "void": r""" This updates the end of the Simulation. Warning: this should be called only from the Model, to synchronise the 2 values :type T: float :param T: the new final time """ return _sicpykernel.Simulation_updateT(self, T)
def computeResiduY(self) -> "bool": return _sicpykernel.Simulation_computeResiduY(self) def computeResiduR(self) -> "bool": return _sicpykernel.Simulation_computeResiduR(self)
[docs] def updateInteractions(self) -> "void": r""" Call the interaction manager one if is registered, otherwise do nothing.""" return _sicpykernel.Simulation_updateInteractions(self)
def updateWorldFromDS(self) -> "void": return _sicpykernel.Simulation_updateWorldFromDS(self)
[docs] def initializeOSIAssociations(self) -> "void": r""" initialize OSI-DS links in the NSDS graph.""" return _sicpykernel.Simulation_initializeOSIAssociations(self)
[docs] def initializeNSDSChangelog(self) -> "void": r""" initialize objects (DSs and Interations) found in the NSDS Changelog and update the changelog iterator. """ return _sicpykernel.Simulation_initializeNSDSChangelog(self)
def applyNSDSChangelogForDS(self) -> "void": return _sicpykernel.Simulation_applyNSDSChangelogForDS(self)
[docs] def initializeIndexSets(self) -> "void": r""" initialize index sets for OSIs""" return _sicpykernel.Simulation_initializeIndexSets(self)
[docs] def firstInitialize(self) -> "void": r""" Complete initialisation of the Simulation (OneStepIntegrators, OneStepNSProblem, TImediscretisation). """ return _sicpykernel.Simulation_firstInitialize(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_Simulation(self) return weakref.proxy(self)
# Register Simulation in _sicpykernel: _sicpykernel.Simulation_swigregister(Simulation) SICONOS_TS_LINEAR = _sicpykernel.SICONOS_TS_LINEAR r""" Event-capturing Time-Stepping simulation This class implements the basic algorithm for Event-capturing Time-Stepping simulations. References : V. Acary and B. Brogliato. Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics, volume 35 of Lecture Notes in Applied and Computational Mechanics. Springer Verlag, 2008. """ SICONOS_TS_LINEAR_IMPLICIT = _sicpykernel.SICONOS_TS_LINEAR_IMPLICIT SICONOS_TS_NONLINEAR = _sicpykernel.SICONOS_TS_NONLINEAR SICONOS_TS_NONLINEAR_FULL = _sicpykernel.SICONOS_TS_NONLINEAR_FULL
[docs] class TimeStepping(Simulation): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _newtonTolerance = property(_sicpykernel.TimeStepping__newtonTolerance_get, _sicpykernel.TimeStepping__newtonTolerance_set, doc=r""" Default Newton tolerance used in call of run() of ComputeOneStep()""") _newtonMaxIteration = property(_sicpykernel.TimeStepping__newtonMaxIteration_get, _sicpykernel.TimeStepping__newtonMaxIteration_set, doc=r""" Default maximum number of Newton iteration""") _newtonNbIterations = property(_sicpykernel.TimeStepping__newtonNbIterations_get, _sicpykernel.TimeStepping__newtonNbIterations_set, doc=r""" Number of steps performed in the Newton Loop""") _newtonCumulativeNbIterations = property(_sicpykernel.TimeStepping__newtonCumulativeNbIterations_get, _sicpykernel.TimeStepping__newtonCumulativeNbIterations_set, doc=r""" Cumulative number of steps performed in the Newton Loops""") _newtonOptions = property(_sicpykernel.TimeStepping__newtonOptions_get, _sicpykernel.TimeStepping__newtonOptions_set, doc=r""" unsigned int _newtonOptions option in the Newon iteration SICONOS_TS_LINEAR or SICONOS_TS_LINEAR_IMPLICIT SICONOS_TS_NONLINEAR will force a single iteration of the Newton Solver SICONOS_TS_NONLINEAR (default) will perform the newton iteration up to convergence """) _newtonResiduDSMax = property(_sicpykernel.TimeStepping__newtonResiduDSMax_get, _sicpykernel.TimeStepping__newtonResiduDSMax_set, doc=r""" Maximum Residual for the Dynamical system""") _newtonResiduYMax = property(_sicpykernel.TimeStepping__newtonResiduYMax_get, _sicpykernel.TimeStepping__newtonResiduYMax_set, doc=r""" Maximum Residual for the output of the relation""") _newtonResiduRMax = property(_sicpykernel.TimeStepping__newtonResiduRMax_get, _sicpykernel.TimeStepping__newtonResiduRMax_set, doc=r""" Maximum Residual for the input of the relation""") _computeResiduY = property(_sicpykernel.TimeStepping__computeResiduY_get, _sicpykernel.TimeStepping__computeResiduY_set, doc=r""" boolean variable to know whether the ResiduY has to be computed or not if true, the ResiduY is computed and the convergence is checked """) _computeResiduR = property(_sicpykernel.TimeStepping__computeResiduR_get, _sicpykernel.TimeStepping__computeResiduR_set, doc=r""" boolean variable to know whether the ResiduR has to be computed or not if true, the ResiduR is computed and the convergence is checked """) _isNewtonConverge = property(_sicpykernel.TimeStepping__isNewtonConverge_get, _sicpykernel.TimeStepping__isNewtonConverge_set, doc=r""" boolean variable to know whether Newton iterations converge or not""") _newtonUpdateInteractionsPerIteration = property(_sicpykernel.TimeStepping__newtonUpdateInteractionsPerIteration_get, _sicpykernel.TimeStepping__newtonUpdateInteractionsPerIteration_set, doc=r""" boolean variable indicating whether interactions should be updated within the Newton loop. """) _displayNewtonConvergence = property(_sicpykernel.TimeStepping__displayNewtonConvergence_get, _sicpykernel.TimeStepping__displayNewtonConvergence_set, doc=r""" boolean variable to display Newton info""") _newtonWarningOnNonConvergence = property(_sicpykernel.TimeStepping__newtonWarningOnNonConvergence_get, _sicpykernel.TimeStepping__newtonWarningOnNonConvergence_set, doc=r""" boolean variable to display warning on non-convergence""") _warningNonsmoothSolver = property(_sicpykernel.TimeStepping__warningNonsmoothSolver_get, _sicpykernel.TimeStepping__warningNonsmoothSolver_set, doc=r""" boolean variable to display warning if osnspb is not correcltys olved""") _resetAllLambda = property(_sicpykernel.TimeStepping__resetAllLambda_get, _sicpykernel.TimeStepping__resetAllLambda_set, doc=r""" boolean variable to resetAllLamda at each step (default true)""") _skip_last_updateOutput = property(_sicpykernel.TimeStepping__skip_last_updateOutput_get, _sicpykernel.TimeStepping__skip_last_updateOutput_set, doc=r""" boolean variable to skip updateOutput at the end of the step (default false) """) _skip_last_updateInput = property(_sicpykernel.TimeStepping__skip_last_updateInput_get, _sicpykernel.TimeStepping__skip_last_updateInput_set, doc=r""" boolean variable to skip updateInput at the end of the step (default false) useful for Global integrators that do not need to compute input in the linear case """) _skip_resetLambdas = property(_sicpykernel.TimeStepping__skip_resetLambdas_get, _sicpykernel.TimeStepping__skip_resetLambdas_set, doc=r""" boolean variable to skip resetLambdas (default false)""")
[docs] def newtonSolve(self, criterion: "double", maxStep: "unsigned int") -> "void": r""" newton algorithm :type criterion: float :param criterion: convergence criterion :type maxStep: int :param maxStep: maximum number of Newton steps """ return _sicpykernel.TimeStepping_newtonSolve(self, criterion, maxStep)
[docs] def initializeOneStepNSProblem(self) -> "void": r""" initialisation specific to TimeStepping for OneStepNSProblem.""" return _sicpykernel.TimeStepping_initializeOneStepNSProblem(self)
def __init__(self, *args): r""" *Overload 1:* Default Constructor | *Overload 2:* Standard constructor :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: NonSmoothDynamicalSystem to be simulated :type td: :py:class:`TimeDiscretisation` :param td: pointer to a timeDiscretisation used in the integration :type osi: :py:class:`OneStepIntegrator` :param osi: one step integrator (default none) :type osnspb: :py:class:`OneStepNSProblem` :param osnspb: one step non smooth problem (default none) | *Overload 3:* Constructor with the time-discretisation. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: NonSmoothDynamicalSystem to be simulated :type td: :py:class:`TimeDiscretisation` :param td: pointer to a timeDiscretisation used in the integration :type nb: int, optional :param nb: number of non smooth problem | *Overload 4:* Constructor with the time-discretisation. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: NonSmoothDynamicalSystem to be simulated :type td: :py:class:`TimeDiscretisation` :param td: pointer to a timeDiscretisation used in the integration :param nb: number of non smooth problem """ if self.__class__ == TimeStepping: _self = None else: _self = self _sicpykernel.TimeStepping_swiginit(self, _sicpykernel.new_TimeStepping(_self, *args))
[docs] def insertIntegrator(self, osi: "SP::OneStepIntegrator") -> "void": r""" insert an Integrator into the simulation list of integrators :type osi: :py:class:`OneStepIntegrator` :param osi: the OneStepIntegrator to add """ return _sicpykernel.TimeStepping_insertIntegrator(self, osi)
__swig_destroy__ = _sicpykernel.delete_TimeStepping
[docs] def updateIndexSet(self, i: "unsigned int") -> "void": r""" update indexSets[i] of the topology, using current y and lambda values of Interactions :type i: int :param i: the number of the set to be updated """ return _sicpykernel.TimeStepping_updateIndexSet(self, i)
[docs] def nextStep(self) -> "void": r""" increment model current time according to User TimeDiscretisation and call SaveInMemory. """ return _sicpykernel.TimeStepping_nextStep(self)
[docs] def computeFreeState(self) -> "void": r""" integrates all the DynamicalSystems taking not into account nslaw, reactions (ie non-smooth part) ... """ return _sicpykernel.TimeStepping_computeFreeState(self)
[docs] def resetLambdas(self) -> "void": r""" Reset all lambdas of all interactions""" return _sicpykernel.TimeStepping_resetLambdas(self)
[docs] def advanceToEvent(self) -> "void": r""" step from current event to next event of EventsManager""" return _sicpykernel.TimeStepping_advanceToEvent(self)
[docs] def computeOneStep(self) -> "void": r""" run one time--step of the simulation""" return _sicpykernel.TimeStepping_computeOneStep(self)
[docs] def getNewtonNbIterations(self) -> "unsigned int": r""" To known the number of steps performed by the Newton algorithm. :rtype: int :return: the number of steps performed by the Newton algorithm """ return _sicpykernel.TimeStepping_getNewtonNbIterations(self)
[docs] def getNewtonCumulativeNbIterations(self) -> "unsigned int": r""" To known the number of steps performed by the Newton algorithm. :rtype: int :return: the cumulative number of steps performed by the Newton algorithm """ return _sicpykernel.TimeStepping_getNewtonCumulativeNbIterations(self)
[docs] def initializeNewtonSolve(self) -> "void": r""" initialize the Newton It computes the initial residu and set the, if needed to Newton variable to start the newton algorithm. """ return _sicpykernel.TimeStepping_initializeNewtonSolve(self)
def computeInitialStateOfTheStep(self) -> "void": return _sicpykernel.TimeStepping_computeInitialStateOfTheStep(self) def prepareNewtonIteration(self) -> "void": return _sicpykernel.TimeStepping_prepareNewtonIteration(self)
[docs] def newtonCheckConvergence(self, criterion: "double") -> "bool": r""" check the convergence of Newton algorithm according to criterion :type criterion: float :param criterion: convergence criterion :rtype: boolean :return: bool = true if Newton method has converged """ return _sicpykernel.TimeStepping_newtonCheckConvergence(self, criterion)
[docs] def run(self) -> "void": r""" run the simulation, from t0 to T with default parameters if any setting has been done """ return _sicpykernel.TimeStepping_run(self)
[docs] def DefaultCheckSolverOutput(self, info: "int") -> "void": r""" check returning value from computeOneStepNSProblem and process :type info: int :param info: solver-specific error code return by the nonsmooth solver """ return _sicpykernel.TimeStepping_DefaultCheckSolverOutput(self, info)
[docs] def setCheckSolverFunction(self, newF: "CheckSolverFPtr") -> "void": r""" Set CheckSolverOutput function :type newF: void :param newF: pointer to function steering the behavior of simulation when nonsmooth solver failed """ return _sicpykernel.TimeStepping_setCheckSolverFunction(self, newF)
def isNewtonConverge(self) -> "bool": return _sicpykernel.TimeStepping_isNewtonConverge(self) def displayNewtonConvergence(self) -> "bool": return _sicpykernel.TimeStepping_displayNewtonConvergence(self) def setDisplayNewtonConvergence(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setDisplayNewtonConvergence(self, newval) def setNewtonWarningOnNonConvergence(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setNewtonWarningOnNonConvergence(self, newval) def newtonWarningOnNonConvergence(self) -> "bool": return _sicpykernel.TimeStepping_newtonWarningOnNonConvergence(self) def setWarningNonsmoothSolver(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setWarningNonsmoothSolver(self, newval) def warningNonsmoothSolver(self) -> "bool": return _sicpykernel.TimeStepping_warningNonsmoothSolver(self) def displayNewtonConvergenceAtTheEnd(self, info: "int", maxStep: "unsigned int") -> "void": return _sicpykernel.TimeStepping_displayNewtonConvergenceAtTheEnd(self, info, maxStep) def displayNewtonConvergenceInTheLoop(self) -> "void": return _sicpykernel.TimeStepping_displayNewtonConvergenceInTheLoop(self) def setResetAllLambda(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setResetAllLambda(self, newval) def setSkipLastUpdateOutput(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setSkipLastUpdateOutput(self, newval) def skipLastUpdateOutput(self) -> "bool": return _sicpykernel.TimeStepping_skipLastUpdateOutput(self) def setSkipLastUpdateInput(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setSkipLastUpdateInput(self, newval) def skipLastUpdateInput(self) -> "bool": return _sicpykernel.TimeStepping_skipLastUpdateInput(self) def setSkipResetLambdas(self, newval: "bool") -> "void": return _sicpykernel.TimeStepping_setSkipResetLambdas(self, newval) def skipResetLambdas(self) -> "bool": return _sicpykernel.TimeStepping_skipResetLambdas(self)
[docs] def setComputeResiduY(self, v: "bool") -> "void": r""" To specify if the output interaction residu must be computed. :type v: boolean :param v: set to true when the output interaction residu must be computed """ return _sicpykernel.TimeStepping_setComputeResiduY(self, v)
[docs] def computeResiduY(self) -> "bool": r""" To know if the output interaction residu must be computed. :rtype: boolean :return: bool _computeResiduY """ return _sicpykernel.TimeStepping_computeResiduY(self)
[docs] def setComputeResiduR(self, v: "bool") -> "void": r""" To specify if the input interaction residu must be computed. :type v: boolean :param v: set to true when the input interaction residu must be computed """ return _sicpykernel.TimeStepping_setComputeResiduR(self, v)
[docs] def computeResiduR(self) -> "bool": r""" To known if the input interaction residu must be computed. :rtype: boolean :return: bool _computeResiduR """ return _sicpykernel.TimeStepping_computeResiduR(self)
[docs] def setNewtonTolerance(self, tol: "double") -> "void": r""" set the Default Newton tolerance :type tol: float :param tol: Newton solver tolerance """ return _sicpykernel.TimeStepping_setNewtonTolerance(self, tol)
[docs] def newtonTolerance(self) -> "double": r""" get the Newton tolerance :rtype: float :return: default Newton solver tolerance """ return _sicpykernel.TimeStepping_newtonTolerance(self)
[docs] def setNewtonMaxIteration(self, maxStep: "unsigned int") -> "void": r""" set the maximum number of Newton iteration :type maxStep: int :param maxStep: maximum number of Newton solver iterations """ return _sicpykernel.TimeStepping_setNewtonMaxIteration(self, maxStep)
[docs] def newtonMaxIteration(self) -> "unsigned int": r""" get the maximum number of Newton iteration :rtype: int :return: maximum number of Newton solver iterations """ return _sicpykernel.TimeStepping_newtonMaxIteration(self)
[docs] def setNewtonOptions(self, v: "unsigned int") -> "void": r""" set the NewtonOptions :type v: int :param v: Newton solver options """ return _sicpykernel.TimeStepping_setNewtonOptions(self, v)
[docs] def newtonOptions(self) -> "unsigned int": r""" get the NewtonOptions :rtype: int :return: Newton solver options - SICONOS_TS_LINEAR 1, SICONOS_TS_LINEAR_IMPLICIT 2, SICONOS_TS_NONLINEAR 3 """ return _sicpykernel.TimeStepping_newtonOptions(self)
[docs] def newtonResiduDSMax(self) -> "double": r""" accessor to _newtonResiduDSMax :rtype: float :return: _newtonResiduDSMax """ return _sicpykernel.TimeStepping_newtonResiduDSMax(self)
[docs] def newtonResiduYMax(self) -> "double": r""" accessor to _newtonResiduYMax :rtype: float :return: _newtonResiduYMax """ return _sicpykernel.TimeStepping_newtonResiduYMax(self)
[docs] def newtonResiduRMax(self) -> "double": r""" accessor to _newtonResiduRMax :rtype: float :return: _newtonResiduRMax """ return _sicpykernel.TimeStepping_newtonResiduRMax(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_TimeStepping(self) return weakref.proxy(self)
# Register TimeStepping in _sicpykernel: _sicpykernel.TimeStepping_swigregister(TimeStepping)
[docs] class TimeSteppingCombinedProjection(TimeStepping): r""" Time-Stepping scheme""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _indexSetLevelForProjection = property(_sicpykernel.TimeSteppingCombinedProjection__indexSetLevelForProjection_get, _sicpykernel.TimeSteppingCombinedProjection__indexSetLevelForProjection_set, doc=r""" level of IndexSet on which we project (default =2 (subset of activated constraint with positive reactions)) """) _cumulatedNewtonNbIterations = property(_sicpykernel.TimeSteppingCombinedProjection__cumulatedNewtonNbIterations_get, _sicpykernel.TimeSteppingCombinedProjection__cumulatedNewtonNbIterations_set, doc=r""" Cumulated Number of steps performed is the Newton Loop""") _nbProjectionIteration = property(_sicpykernel.TimeSteppingCombinedProjection__nbProjectionIteration_get, _sicpykernel.TimeSteppingCombinedProjection__nbProjectionIteration_set, doc=r""" Number of iteration of projection""") _nbCumulatedProjectionIteration = property(_sicpykernel.TimeSteppingCombinedProjection__nbCumulatedProjectionIteration_get, _sicpykernel.TimeSteppingCombinedProjection__nbCumulatedProjectionIteration_set, doc=r""" Number of cumulated iteration of projection""") _nbIndexSetsIteration = property(_sicpykernel.TimeSteppingCombinedProjection__nbIndexSetsIteration_get, _sicpykernel.TimeSteppingCombinedProjection__nbIndexSetsIteration_set, doc=r""" Number of iteration for stabilizating indexsets""") _constraintTol = property(_sicpykernel.TimeSteppingCombinedProjection__constraintTol_get, _sicpykernel.TimeSteppingCombinedProjection__constraintTol_set, doc=r""" tolerance for the violation of the equality constraints at the position level. """) _constraintTolUnilateral = property(_sicpykernel.TimeSteppingCombinedProjection__constraintTolUnilateral_get, _sicpykernel.TimeSteppingCombinedProjection__constraintTolUnilateral_set, doc=r""" tolerance for the violation of the unilateral constraints at the position level. """) _maxViolationUnilateral = property(_sicpykernel.TimeSteppingCombinedProjection__maxViolationUnilateral_get, _sicpykernel.TimeSteppingCombinedProjection__maxViolationUnilateral_set, doc=r""" maximum violation for the violation of the unilateral constraints at the position level. """) _maxViolationEquality = property(_sicpykernel.TimeSteppingCombinedProjection__maxViolationEquality_get, _sicpykernel.TimeSteppingCombinedProjection__maxViolationEquality_set, doc=r""" maximum violation for the violation of the equality constraints at the position level. """) _projectionMaxIteration = property(_sicpykernel.TimeSteppingCombinedProjection__projectionMaxIteration_get, _sicpykernel.TimeSteppingCombinedProjection__projectionMaxIteration_set, doc=r""" Default maximum number of projection iteration""") _kIndexSetMax = property(_sicpykernel.TimeSteppingCombinedProjection__kIndexSetMax_get, _sicpykernel.TimeSteppingCombinedProjection__kIndexSetMax_set, doc=r""" Default maximum number of index set activation iteration""") _doCombinedProj = property(_sicpykernel.TimeSteppingCombinedProjection__doCombinedProj_get, _sicpykernel.TimeSteppingCombinedProjection__doCombinedProj_set, doc=r""" disabled or enabled projection (Debug Projection)""") _doCombinedProjOnEquality = property(_sicpykernel.TimeSteppingCombinedProjection__doCombinedProjOnEquality_get, _sicpykernel.TimeSteppingCombinedProjection__doCombinedProjOnEquality_set, doc=r""" disabled or enabled projection On Equality (or Unilateral) for unilateral constraints """) _isIndexSetsStable = property(_sicpykernel.TimeSteppingCombinedProjection__isIndexSetsStable_get, _sicpykernel.TimeSteppingCombinedProjection__isIndexSetsStable_set, doc=r""" Boolean to check if the index sets are stabilized in the Combined Projection Algorithm """)
[docs] def updateIndexSet(self, level: "unsigned int") -> "void": r""" update indexSets[i] of the topology, using current y and lambda values of Interactions :type level: int :param level: unsigned int: the level of the set to be updated """ return _sicpykernel.TimeSteppingCombinedProjection_updateIndexSet(self, level)
[docs] def initializeOneStepNSProblem(self) -> "void": return _sicpykernel.TimeSteppingCombinedProjection_initializeOneStepNSProblem(self)
def __init__(self, *args): r""" *Overload 1:* Constructor with the time-discretisation. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: the nsds that we want to simulate :type td: :py:class:`TimeDiscretisation` :param td: a pointer to a timeDiscretisation (linked to the model that owns this simulation) :type osi: :py:class:`OneStepIntegrator` :param osi: a one step integrator :type osnspb_velo: :py:class:`OneStepNSProblem` :param osnspb_velo: a one step non smooth problem for the velocity formulation :type osnspb_pos: :py:class:`OneStepNSProblem` :param osnspb_pos: a one step non smooth problem for the position formulation :type _level: int, optional :param _level: | *Overload 2:* default constructor """ if self.__class__ == TimeSteppingCombinedProjection: _self = None else: _self = self _sicpykernel.TimeSteppingCombinedProjection_swiginit(self, _sicpykernel.new_TimeSteppingCombinedProjection(_self, *args)) __swig_destroy__ = _sicpykernel.delete_TimeSteppingCombinedProjection def updateWorldFromDS(self) -> "void": return _sicpykernel.TimeSteppingCombinedProjection_updateWorldFromDS(self)
[docs] def nbProjectionIteration(self) -> "unsigned int": r""" get the Number of iteration of projection :rtype: int :return: unsigned int nbProjectionIteration """ return _sicpykernel.TimeSteppingCombinedProjection_nbProjectionIteration(self)
[docs] def nbCumulatedProjectionIteration(self) -> "unsigned int": r""" get the Number of cumulated iteration of projection :rtype: int :return: unsigned int """ return _sicpykernel.TimeSteppingCombinedProjection_nbCumulatedProjectionIteration(self)
[docs] def cumulatedNewtonNbIterations(self) -> "unsigned int": r""" get the Cumulated Number of steps performed in the Newton Loop :rtype: int :return: unsigned int """ return _sicpykernel.TimeSteppingCombinedProjection_cumulatedNewtonNbIterations(self)
[docs] def nbIndexSetsIteration(self) -> "unsigned int": r""" get the Number of iteration for stabilizating indexsets :rtype: int :return: unsigned int """ return _sicpykernel.TimeSteppingCombinedProjection_nbIndexSetsIteration(self)
def setConstraintTol(self, v: "double") -> "void": return _sicpykernel.TimeSteppingCombinedProjection_setConstraintTol(self, v) def setConstraintTolUnilateral(self, v: "double") -> "void": return _sicpykernel.TimeSteppingCombinedProjection_setConstraintTolUnilateral(self, v) def maxViolationUnilateral(self) -> "double": return _sicpykernel.TimeSteppingCombinedProjection_maxViolationUnilateral(self) def maxViolationEquality(self) -> "double": return _sicpykernel.TimeSteppingCombinedProjection_maxViolationEquality(self) def setProjectionMaxIteration(self, v: "unsigned int") -> "void": return _sicpykernel.TimeSteppingCombinedProjection_setProjectionMaxIteration(self, v) def setDoCombinedProj(self, v: "unsigned int") -> "void": return _sicpykernel.TimeSteppingCombinedProjection_setDoCombinedProj(self, v) def doCombinedProjOnEquality(self) -> "bool": return _sicpykernel.TimeSteppingCombinedProjection_doCombinedProjOnEquality(self)
[docs] def advanceToEvent(self) -> "void": return _sicpykernel.TimeSteppingCombinedProjection_advanceToEvent(self)
def advanceToEventOLD(self) -> "void": return _sicpykernel.TimeSteppingCombinedProjection_advanceToEventOLD(self) def computeCriteria(self, runningProjection: "bool *") -> "void": return _sicpykernel.TimeSteppingCombinedProjection_computeCriteria(self, runningProjection) def __disown__(self): self.this.disown() _sicpykernel.disown_TimeSteppingCombinedProjection(self) return weakref.proxy(self)
[docs] def newtonSolve(self, criterion: "double", maxStep: "unsigned int") -> "void": r""" newton algorithm :type criterion: float :param criterion: convergence criterion :type maxStep: int :param maxStep: maximum number of Newton steps """ return _sicpykernel.TimeSteppingCombinedProjection_newtonSolve(self, criterion, maxStep)
# Register TimeSteppingCombinedProjection in _sicpykernel: _sicpykernel.TimeSteppingCombinedProjection_swigregister(TimeSteppingCombinedProjection)
[docs] class TimeSteppingDirectProjection(TimeStepping): r""" Time-Stepping scheme with a direct projection onto the constraint thanks to the GGL augmentation of the system For details, have a look on Projected event-capturing time-stepping schemes for nonsmooth mechanical systems with unilateral contact and Coulomb's friction Vincent Acary Computer Methods in Applied Mechanics and Engineering, Elsevier, 2013, 256, pp. 224-250 """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _indexSetLevelForProjection = property(_sicpykernel.TimeSteppingDirectProjection__indexSetLevelForProjection_get, _sicpykernel.TimeSteppingDirectProjection__indexSetLevelForProjection_set, doc=r""" level of IndexSet on which we project (default =1 (activated contact))""") _nbProjectionIteration = property(_sicpykernel.TimeSteppingDirectProjection__nbProjectionIteration_get, _sicpykernel.TimeSteppingDirectProjection__nbProjectionIteration_set, doc=r""" Number of iteration of projection""") _constraintTol = property(_sicpykernel.TimeSteppingDirectProjection__constraintTol_get, _sicpykernel.TimeSteppingDirectProjection__constraintTol_set, doc=r""" tolerance for the violation of the equality constraints at the position level. """) _constraintTolUnilateral = property(_sicpykernel.TimeSteppingDirectProjection__constraintTolUnilateral_get, _sicpykernel.TimeSteppingDirectProjection__constraintTolUnilateral_set, doc=r""" tolerance for the violation of the unilateral constraints at the position level. """) _maxViolationUnilateral = property(_sicpykernel.TimeSteppingDirectProjection__maxViolationUnilateral_get, _sicpykernel.TimeSteppingDirectProjection__maxViolationUnilateral_set, doc=r""" maximum violation for the violation of the unilateral constraints at the position level. """) _maxViolationEquality = property(_sicpykernel.TimeSteppingDirectProjection__maxViolationEquality_get, _sicpykernel.TimeSteppingDirectProjection__maxViolationEquality_set, doc=r""" maximum violation for the violation of the equality constraints at the position level. """) _projectionMaxIteration = property(_sicpykernel.TimeSteppingDirectProjection__projectionMaxIteration_get, _sicpykernel.TimeSteppingDirectProjection__projectionMaxIteration_set, doc=r""" Default maximum number of projection iteration""") _doProj = property(_sicpykernel.TimeSteppingDirectProjection__doProj_get, _sicpykernel.TimeSteppingDirectProjection__doProj_set, doc=r""" disabled or enabled projection (Debug Projection)""") _doOnlyProj = property(_sicpykernel.TimeSteppingDirectProjection__doOnlyProj_get, _sicpykernel.TimeSteppingDirectProjection__doOnlyProj_set)
[docs] def initializeOneStepNSProblem(self) -> "void": return _sicpykernel.TimeSteppingDirectProjection_initializeOneStepNSProblem(self)
def __init__(self, *args): r""" *Overload 1:* Constructor with the time-discretisation. :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: the nsds that we want to simulate :type td: :py:class:`TimeDiscretisation` :param td: a pointer to a timeDiscretisation (linked to the model that owns this simulation) :type osi: :py:class:`OneStepIntegrator` :param osi: a one step integrator :type osnspb_velo: :py:class:`OneStepNSProblem` :param osnspb_velo: a one step non smooth problem for the velocity formulation :type osnspb_pos: :py:class:`OneStepNSProblem` :param osnspb_pos: a one step non smooth problem for the position formulation :type _level: int, optional :param _level: | *Overload 2:* default constructor """ if self.__class__ == TimeSteppingDirectProjection: _self = None else: _self = self _sicpykernel.TimeSteppingDirectProjection_swiginit(self, _sicpykernel.new_TimeSteppingDirectProjection(_self, *args)) __swig_destroy__ = _sicpykernel.delete_TimeSteppingDirectProjection def updateWorldFromDS(self) -> "void": return _sicpykernel.TimeSteppingDirectProjection_updateWorldFromDS(self)
[docs] def nbProjectionIteration(self) -> "unsigned int": r""" :rtype: int :return: the Number of iteration of projection """ return _sicpykernel.TimeSteppingDirectProjection_nbProjectionIteration(self)
def setConstraintTol(self, v: "double") -> "void": return _sicpykernel.TimeSteppingDirectProjection_setConstraintTol(self, v) def setConstraintTolUnilateral(self, v: "double") -> "void": return _sicpykernel.TimeSteppingDirectProjection_setConstraintTolUnilateral(self, v) def maxViolationUnilateral(self) -> "double": return _sicpykernel.TimeSteppingDirectProjection_maxViolationUnilateral(self) def maxViolationEquality(self) -> "double": return _sicpykernel.TimeSteppingDirectProjection_maxViolationEquality(self) def setProjectionMaxIteration(self, v: "unsigned int") -> "void": return _sicpykernel.TimeSteppingDirectProjection_setProjectionMaxIteration(self, v) def setDoProj(self, v: "unsigned int") -> "void": return _sicpykernel.TimeSteppingDirectProjection_setDoProj(self, v) def setDoOnlyProj(self, v: "unsigned int") -> "void": return _sicpykernel.TimeSteppingDirectProjection_setDoOnlyProj(self, v)
[docs] def advanceToEvent(self) -> "void": return _sicpykernel.TimeSteppingDirectProjection_advanceToEvent(self)
[docs] def nextStep(self) -> "void": return _sicpykernel.TimeSteppingDirectProjection_nextStep(self)
def computeCriteria(self, runningProjection: "bool *") -> "void": return _sicpykernel.TimeSteppingDirectProjection_computeCriteria(self, runningProjection)
[docs] def newtonSolve(self, criterion: "double", maxStep: "unsigned int") -> "void": return _sicpykernel.TimeSteppingDirectProjection_newtonSolve(self, criterion, maxStep)
def __disown__(self): self.this.disown() _sicpykernel.disown_TimeSteppingDirectProjection(self) return weakref.proxy(self)
# Register TimeSteppingDirectProjection in _sicpykernel: _sicpykernel.TimeSteppingDirectProjection_swigregister(TimeSteppingDirectProjection) class InteractionManager(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): if self.__class__ == InteractionManager: _self = None else: _self = self _sicpykernel.InteractionManager_swiginit(self, _sicpykernel.new_InteractionManager(_self, )) __swig_destroy__ = _sicpykernel.delete_InteractionManager def updateInteractions(self, simulation: "SP::Simulation") -> "void": r""" Called by Simulation after updating positions prior to starting the Newton loop. """ return _sicpykernel.InteractionManager_updateInteractions(self, simulation) def insertNonSmoothLaw(self, nslaw: "SP::NonSmoothLaw", group1: "unsigned long", group2: "unsigned long") -> "void": r""" Specify a non-smooth law to use for a given combination of interaction groups. :type nslaw: :py:class:`NonSmoothLaw` :param nslaw: the new nonsmooth law :type group1: int :param group1: id of the fisrt group of interactions :type group2: int :param group2: id of the second group of interactions """ return _sicpykernel.InteractionManager_insertNonSmoothLaw(self, nslaw, group1, group2) def nonSmoothLaw(self, group1: "unsigned long", group2: "unsigned long") -> "SP::NonSmoothLaw": r""" Retrieve a non-smooth law to use for a given combination of interaction groups. :rtype: :py:class:`NonSmoothLaw` :return: nsl a SP::NonSmoothLaw :type group1: int :param group1: first group :type group2: int :param group2: second group """ return _sicpykernel.InteractionManager_nonSmoothLaw(self, group1, group2) _nslaws = property(_sicpykernel.InteractionManager__nslaws_get, _sicpykernel.InteractionManager__nslaws_set, doc=r""" nslaws""") def __disown__(self): self.this.disown() _sicpykernel.disown_InteractionManager(self) return weakref.proxy(self) # Register InteractionManager in _sicpykernel: _sicpykernel.InteractionManager_swigregister(InteractionManager)
[docs] class EventDriven(Simulation): r""" Simulation based on event driven method, ie events detection (see theoretical manual for more details). WARNING: at the time only written for Lagrangian systems !!! """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _TOL_ED = property(_sicpykernel.EventDriven__TOL_ED_get, _sicpykernel.EventDriven__TOL_ED_set, doc=r""" an epsilon to define the contraint g for Interaction in IndexSet[1]""") _isNewtonConverge = property(_sicpykernel.EventDriven__isNewtonConverge_get, _sicpykernel.EventDriven__isNewtonConverge_set, doc=r""" boolean variable to known whether Newton iterations converges or not""") _newtonMaxIteration = property(_sicpykernel.EventDriven__newtonMaxIteration_get, _sicpykernel.EventDriven__newtonMaxIteration_set, doc=r""" Default maximum number of Newton iteration""") _newtonNbIterations = property(_sicpykernel.EventDriven__newtonNbIterations_get, _sicpykernel.EventDriven__newtonNbIterations_set, doc=r""" Number of steps performed is the Newton Loop""") _newtonResiduDSMax = property(_sicpykernel.EventDriven__newtonResiduDSMax_get, _sicpykernel.EventDriven__newtonResiduDSMax_set, doc=r""" Maximum Residual for the Dynamical system""") _newtonResiduYMax = property(_sicpykernel.EventDriven__newtonResiduYMax_get, _sicpykernel.EventDriven__newtonResiduYMax_set, doc=r""" Maximum Residual for the output of the relation""") _newtonTolerance = property(_sicpykernel.EventDriven__newtonTolerance_get, _sicpykernel.EventDriven__newtonTolerance_set, doc=r""" Tolerance to check Newton iteration convergence""") _localizeEventMaxIter = property(_sicpykernel.EventDriven__localizeEventMaxIter_get, _sicpykernel.EventDriven__localizeEventMaxIter_set, doc=r""" Maximum number of iterations to localize events""") _numberOfOneStepNSproblems = property(_sicpykernel.EventDriven__numberOfOneStepNSproblems_get, _sicpykernel.EventDriven__numberOfOneStepNSproblems_set, doc=r""" number of OneStepNSProblems considered in the simulation""") _indexSet0 = property(_sicpykernel.EventDriven__indexSet0_get, _sicpykernel.EventDriven__indexSet0_set, doc=r""" store the indexSet0 for performance reason (Lsodar)""") _DSG0 = property(_sicpykernel.EventDriven__DSG0_get, _sicpykernel.EventDriven__DSG0_set, doc=r""" store the graph of DynamicalSystems for performance reason (Lsodar)""") def __init__(self, *args): r""" *Overload 1:* defaut constructor :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type td: :py:class:`TimeDiscretisation` :param td: time discretisation | *Overload 2:* constructor with data :type nsds: :py:class:`NonSmoothDynamicalSystem` :param nsds: current nonsmooth dynamical system :type td: :py:class:`TimeDiscretisation` :param td: time discretisation :type nb: int :param nb: number of NSProblem | *Overload 3:* defaut constructor (needed for serialization) """ if self.__class__ == EventDriven: _self = None else: _self = self _sicpykernel.EventDriven_swiginit(self, _sicpykernel.new_EventDriven(_self, *args)) __swig_destroy__ = _sicpykernel.delete_EventDriven
[docs] def initialize(self) -> "void": r""" Overload Simulation::initialize""" return _sicpykernel.EventDriven_initialize(self)
[docs] def firstInitialize(self) -> "void": r""" First (and unique) run of initialization step.""" return _sicpykernel.EventDriven_firstInitialize(self)
[docs] def setIstate(self, newValue: "int") -> "void": r""" Set value to _istate :type newValue: int :param newValue: """ return _sicpykernel.EventDriven_setIstate(self, newValue)
[docs] def istate(self) -> "double": r""" Get value of _istate :rtype: float :return: _istate a double """ return _sicpykernel.EventDriven_istate(self)
[docs] def setToleranceED(self, var: "double") -> "void": r""" Set value to _TOL_ED :type var: float :param var: the new tolerance """ return _sicpykernel.EventDriven_setToleranceED(self, var)
[docs] def toleranceED(self) -> "double": r""" Get value of _epsilon :rtype: float :return: double """ return _sicpykernel.EventDriven_toleranceED(self)
[docs] def isNewtonConverge(self) -> "bool": r""" To know if Newton Iteratio is convergent :rtype: boolean :return: _isNewtonConverge """ return _sicpykernel.EventDriven_isNewtonConverge(self)
[docs] def getNewtonNbIterations(self) -> "unsigned int": r""" To known the number of steps performed by the Newton algorithm :rtype: int :return: _newtonNbIterations """ return _sicpykernel.EventDriven_getNewtonNbIterations(self)
[docs] def setNewtonMaxIteration(self, maxStep: "unsigned int") -> "void": r""" Set value to the maximum number of iterations :type maxStep: int :param maxStep: maximum number of step """ return _sicpykernel.EventDriven_setNewtonMaxIteration(self, maxStep)
[docs] def setLocalizeEventsMaxIteration(self, maxIter: "unsigned int") -> "void": r""" To set maximum number of iterations to localize events :type maxIter: int :param maxIter: maximum number of iterations """ return _sicpykernel.EventDriven_setLocalizeEventsMaxIteration(self, maxIter)
[docs] def newtonMaxIteration(self) -> "double": r""" get the maximum number of Newton iteration :rtype: float :return: unsigned int """ return _sicpykernel.EventDriven_newtonMaxIteration(self)
[docs] def LocalizeEventsMaxIteration(self) -> "unsigned int": r""" get the maximum number of iterations to localize events :rtype: int :return: unsigned int: maximum number of iterations """ return _sicpykernel.EventDriven_LocalizeEventsMaxIteration(self)
[docs] def newtonResiduDSMax(self) -> "double": r""" accessor to _newtonResiduDSMax :rtype: float :return: double _newtonResiduDSMax """ return _sicpykernel.EventDriven_newtonResiduDSMax(self)
[docs] def newtonResiduYMax(self) -> "double": r""" accessor to _newtonResiduYMax :rtype: float :return: double _newtonResiduYMax """ return _sicpykernel.EventDriven_newtonResiduYMax(self)
[docs] def setNewtonTolerance(self, tol: "double") -> "void": r""" set the Default Newton tolerance :type tol: float :param tol: new tolerance """ return _sicpykernel.EventDriven_setNewtonTolerance(self, tol)
[docs] def newtonTolerance(self) -> "double": r""" get the Newton tolerance :rtype: float :return: tolerance """ return _sicpykernel.EventDriven_newtonTolerance(self)
[docs] def insertIntegrator(self, arg0: "SP::OneStepIntegrator") -> "void": r""" Redefine method insertIntegrator of the class Simulation""" return _sicpykernel.EventDriven_insertIntegrator(self, arg0)
[docs] def updateIndexSet(self, i: "unsigned int") -> "void": r""" update indexSets[i] of the topology, using current y and lambda values of Interactions. :type i: int :param i: the number of the set to be updated """ return _sicpykernel.EventDriven_updateIndexSet(self, i)
[docs] def updateIndexSetsWithDoubleCondition(self) -> "void": r""" update indexSets[1] and [2] (using current y and lambda values of Interactions) with conditions on y[2] AND lambda[2]. """ return _sicpykernel.EventDriven_updateIndexSetsWithDoubleCondition(self)
[docs] def computef(self, osi: "OneStepIntegrator", sizeOfX: "integer *", time: "doublereal *", x: "doublereal *", xdot: "doublereal *") -> "void": r""" compute right-hand side of xdot = f(x,t), for the integrator osi. :type osi: :py:class:`OneStepIntegrator` :param osi: the integrator (Lsodar) :type sizeOfX: int :param sizeOfX: size of vector x :type time: float :param time: current time given by the integrator :type x: float :param x: state vector :type xdot: float :param xdot: derivative of x """ return _sicpykernel.EventDriven_computef(self, osi, sizeOfX, time, x, xdot)
[docs] def computeJacobianfx(self, osi: "OneStepIntegrator", sizeOfX: "integer *", time: "doublereal *", x: "doublereal *", jacob: "doublereal *") -> "void": r""" compute jacobian of the right-hand side :type osi: :py:class:`OneStepIntegrator` :param osi: the integrator (Lsodar) :type sizeOfX: int :param sizeOfX: size of vector x :type time: float :param time: current time given by the integrator :type x: float :param x: state vector :type jacob: float :param jacob: jacobian of f according to x """ return _sicpykernel.EventDriven_computeJacobianfx(self, osi, sizeOfX, time, x, jacob)
[docs] def computeSizeOfg(self) -> "unsigned int": r""" compute the size of constraint function g(x,t,...) for osi :rtype: int :return: unsigned int """ return _sicpykernel.EventDriven_computeSizeOfg(self)
[docs] def computeg(self, osi: "SP::OneStepIntegrator", sizeX: "integer *", time: "doublereal *", x: "doublereal *", sizeG: "integer *", g: "doublereal *") -> "void": r""" compute constraint function g(x,t,...) for osi. :type osi: :py:class:`OneStepIntegrator` :param osi: pointer to OneStepIntegrator. :type sizeX: int :param sizeX: integer*, size of vector x :type time: float :param time: doublereal*, time :type x: float :param x: doublereal*, x:array of double :type sizeG: int :param sizeG: integer*, size of vector g (ie number of constraints) :type g: float :param g: doublereal*, g (in-out parameter) """ return _sicpykernel.EventDriven_computeg(self, osi, sizeX, time, x, sizeG, g)
[docs] def updateImpactState(self) -> "void": r""" update input for impact case (ie compute p[1])""" return _sicpykernel.EventDriven_updateImpactState(self)
[docs] def updateSmoothState(self) -> "void": r""" update state for smooth dynamic case (i.e. compute p[2] and update acceleration)""" return _sicpykernel.EventDriven_updateSmoothState(self)
[docs] def updateInput(self, level: "unsigned int") -> "void": r""" update input :type level: int :param level: of lambda used to compute input """ return _sicpykernel.EventDriven_updateInput(self, level)
[docs] def updateState(self, level: "unsigned int") -> "void": r""" update state. :type level: int :param level: of lambda used to compute input """ return _sicpykernel.EventDriven_updateState(self, level)
[docs] def updateOutput(self, level: "unsigned int") -> "void": r""" update output and indexSets. :type level: int :param level: of lambda used to compute input """ return _sicpykernel.EventDriven_updateOutput(self, level)
[docs] def advanceToEvent(self) -> "void": r""" run simulation from one Event to the next, according to events manager settings.""" return _sicpykernel.EventDriven_advanceToEvent(self)
[docs] def computeResiduConstraints(self) -> "double": r""" Methods for NewMarkAlphaOSI scheme compute maximum residu over all gap functions of Index2 contacts :rtype: float :return: double: maximum residu for all gap functions """ return _sicpykernel.EventDriven_computeResiduConstraints(self)
[docs] def prepareNewtonIteration(self) -> "void": r""" prepare for Newton iterations for all OSIs :rtype: void :return: maximum residu over all DSs """ return _sicpykernel.EventDriven_prepareNewtonIteration(self)
[docs] def newtonCheckConvergence(self, arg2: "double") -> "bool": r""" Check convergence of Newton iteration :rtype: boolean :return: bool: true if convergent, false otherwise """ return _sicpykernel.EventDriven_newtonCheckConvergence(self, arg2)
[docs] def predictionNewtonIteration(self) -> "void": r""" Predict the state of all Dynamical Systems before Newton iterations""" return _sicpykernel.EventDriven_predictionNewtonIteration(self)
[docs] def correctionNewtonIteration(self) -> "void": r""" Correct the state of all Dynamical Systems during Newton iterations""" return _sicpykernel.EventDriven_correctionNewtonIteration(self)
[docs] def newtonSolve(self, criterion: "double", maxStep: "unsigned int") -> "void": r""" Newton iteration to get the state of all Dynamical Systems at the end of step :type criterion: float :param criterion: tolerance to check convergence :type maxStep: int :param maxStep: maximum number of steps """ return _sicpykernel.EventDriven_newtonSolve(self, criterion, maxStep)
[docs] def detectEvents(self, updateIstate: "bool"=True) -> "double": r""" Detect whether or not events occur during each integration step :type updateIstate: boolean, optional :param updateIstate: true if we need to update the flag _istate, false otherwise :rtype: float :return: double, maximum of absolute values of constraint fonctions over all activated ot deactivated contacts """ return _sicpykernel.EventDriven_detectEvents(self, updateIstate)
[docs] def LocalizeFirstEvent(self) -> "void": r""" Localize time of the first event""" return _sicpykernel.EventDriven_LocalizeFirstEvent(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_EventDriven(self) return weakref.proxy(self)
# Register EventDriven in _sicpykernel: _sicpykernel.EventDriven_swigregister(EventDriven)
[docs] class EventsManager(object): r""" Tools to handle a set of Events for the Simulation The EventsManager handles a set of events (from user time-discretisation, sensors, non-smooth ...), and is supposed to provide to the simulation the values of "current" and "next" events to define the time-integration interval. Events: - currentEvent: starting time for integration. Initialized with t0 of the simulation time-discretisation. - ETD: corresponds to the instant t[k+1] of the Simulation (user) TimeDiscretisation. - ENonSmooth: for EventDriven simulation only. Present only if one or more non-smooth events have been detected between currentEvent and the next event. - Sensor or Actuators Events. To each Sensor or Actuator declared in the ControlManager, corresponds an Event in the manager. When this event is processed, its time value is increased to next instant in the time-discretisation of the sensor/actuator. Examples: - for a TimeStepping, with one Sensor, the EventsManager looks like: {currentEvent(tk), ESensor(tsensor), ETD(tk+1)} - for an EventDriven, with one actuator, an non-smooth event detected at time tns: {currentEvent(tk), EActuator(tact), ENonSmooth(tns), ETD(tk+1)}. After each process, the time values of each event are updated and nextEvent points to the first event after currentEvent. Main functions - initialize(): process all events which have the same time as currentEvent - processEvents(): process all events simultaneous to nextEvent, increment them to next step, update index sets, increment currentEvent. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _events = property(_sicpykernel.EventsManager__events_get, _sicpykernel.EventsManager__events_set, doc=r""" list of events The first element is the last processed event. All the others are unprocessed events. This list is not fixed and can be updated at any time depending on the simulation, user add ... """) _eNonSmooth = property(_sicpykernel.EventsManager__eNonSmooth_get, _sicpykernel.EventsManager__eNonSmooth_set, doc=r""" Placeholder for the non smooth event""") _k = property(_sicpykernel.EventsManager__k_get, _sicpykernel.EventsManager__k_set, doc=r""" Current index (for time instants)""") _td = property(_sicpykernel.EventsManager__td_get, _sicpykernel.EventsManager__td_set, doc=r""" TimeDiscretisation for the time integration""") _T = property(_sicpykernel.EventsManager__T_get, _sicpykernel.EventsManager__T_set, doc=r""" End of the Simulation""") _GapLimit2Events = property(_sicpykernel.EventsManager__GapLimit2Events_get, _sicpykernel.EventsManager__GapLimit2Events_set, doc=r""" unsigned long int variable to check if two events are too close""") _NSeventInsteadOfTD = property(_sicpykernel.EventsManager__NSeventInsteadOfTD_get, _sicpykernel.EventsManager__NSeventInsteadOfTD_set, doc=r""" boolean to remember that a TD_EVENT has been deleted since a NS_EVENT was too close """)
[docs] def insertEv(self, e: "SP::Event") -> "unsigned int": r""" Insert an event in the event stack :type e: :py:class:`Event` :param e: the event to insert :rtype: int :return: the position of the inserted event in the stack """ return _sicpykernel.EventsManager_insertEv(self, e)
[docs] def update(self, sim: "Simulation") -> "void": r""" Update the set of events :type sim: :py:class:`Simulation` :param sim: the Simulation using this EventsManager """ return _sicpykernel.EventsManager_update(self, sim)
def __init__(self, *args): r""" *Overload 1:* default constructor | *Overload 2:* constructor :type td: :py:class:`TimeDiscretisation` :param td: the TimeDiscretisation used in the Simulation """ if self.__class__ == EventsManager: _self = None else: _self = self _sicpykernel.EventsManager_swiginit(self, _sicpykernel.new_EventsManager(_self, *args)) __swig_destroy__ = _sicpykernel.delete_EventsManager
[docs] def initialize(self, T: "double") -> "void": r""" Initialize: just set the final time :type T: float :param T: the final time of the Simulation """ return _sicpykernel.EventsManager_initialize(self, T)
[docs] def setGapLimitEvents(self, var: "unsigned long") -> "void": r""" Set the gap limit between two events :type var: int :param var: the new _GapLimit2Events """ return _sicpykernel.EventsManager_setGapLimitEvents(self, var)
[docs] def getGapLimitEvents(self) -> "unsigned long": r""" Get the gap limit between two events :rtype: int :return: the gap limit """ return _sicpykernel.EventsManager_getGapLimitEvents(self)
[docs] def noSaveInMemory(self, sim: "Simulation") -> "void": r""" Change TimeDiscretisationEvent to TimeDiscretisationEventNoSaveInMemory Warning: use this at your own risk, many integrators needs previous values to integrate properly :type sim: :py:class:`Simulation` :param sim: the Simulation that owns this EventsManager """ return _sicpykernel.EventsManager_noSaveInMemory(self, sim)
[docs] def currentEvent(self) -> "SP::Event": r""" get the current event :rtype: :py:class:`Event` :return: a pointer to Event """ return _sicpykernel.EventsManager_currentEvent(self)
[docs] def nextEvent(self) -> "SP::Event": r""" get the next event to be processed. :rtype: :py:class:`Event` :return: a pointer to Event """ return _sicpykernel.EventsManager_nextEvent(self)
[docs] def events(self) -> "EventsContainer &": r""" return all the events :rtype: EventsContainer :return: a reference to the events set """ return _sicpykernel.EventsManager_events(self)
[docs] def hasNextEvent(self) -> "bool": r""" check if there are some unprocessed events :rtype: boolean :return: true if there are unprocessed events """ return _sicpykernel.EventsManager_hasNextEvent(self)
[docs] def startingTime(self) -> "double": r""" get the time of current event, in double format :rtype: float :return: the time of the last processed events """ return _sicpykernel.EventsManager_startingTime(self)
[docs] def nextTime(self) -> "double": r""" get the time of next event, in double format :rtype: float :return: the time of the next events """ return _sicpykernel.EventsManager_nextTime(self)
[docs] def needsIntegration(self) -> "bool": r""" is an integration step required ? The current event and the next one may have the same time instant in which case no integration as to be performed :rtype: boolean :return: true if the simulation needs to be integrate, no otherwise """ return _sicpykernel.EventsManager_needsIntegration(self)
[docs] def display(self) -> "void": r""" display EventsManager data""" return _sicpykernel.EventsManager_display(self)
[docs] def scheduleNonSmoothEvent(self, sim: "Simulation", time: "double", yes_update: "bool"=True) -> "void": r""" add a new Event in the allEvents list and update nextEvent value :type sim: :py:class:`Simulation` :param sim: the simulation that owns this EventsManager :type time: float :param time: the time (double format) of occurence of the event :type yes_update: boolean, optional :param yes_update: indicator to update or not the next event (default value is true) """ return _sicpykernel.EventsManager_scheduleNonSmoothEvent(self, sim, time, yes_update)
[docs] def processEvents(self, sim: "Simulation") -> "void": r""" Process the next event, update the indexSets if necessary :type sim: :py:class:`Simulation` :param sim: the simulation that owns this EventsManager """ return _sicpykernel.EventsManager_processEvents(self, sim)
[docs] def preUpdate(self, sim: "Simulation") -> "void": r""" Function to be called once after initialization. It is used to process NonSmoothEvents at the beginning of the Simulation, if there is any. :type sim: :py:class:`Simulation` :param sim: the simulation that owns this EventsManager """ return _sicpykernel.EventsManager_preUpdate(self, sim)
[docs] def insertEvent(self, *args) -> "Event &": r""" *Overload 1:* insert an event of a certain type. The event is created on the fly. :type type: int :param type: the type of the event :type time: float :param time: the time of the event :rtype: :py:class:`Event` :return: a reference to the Event | *Overload 2:* insert an event of a certain type. The event is created on the fly, and the SP::TimeDiscretisation given in argument is stored inside :type type: int :param type: the type of the event :type td: :py:class:`TimeDiscretisation` :param td: a TimeDiscretisation for the Event :rtype: :py:class:`Event` :return: a reference to the Event """ return _sicpykernel.EventsManager_insertEvent(self, *args)
def getTk(self) -> "double": return _sicpykernel.EventsManager_getTk(self)
[docs] def getTkp1(self) -> "double": r""" get time instant k+1 of the time discretisation :rtype: float :return: a double. If the simulation is near the end (t_{k+1} >= T), it returns NaN. """ return _sicpykernel.EventsManager_getTkp1(self)
[docs] def getTkp2(self) -> "double": r""" get time instant k+2 of the time discretisation :rtype: float :return: a double. If the simulation is near the end (t_{k+2} >= T), it returns NaN. """ return _sicpykernel.EventsManager_getTkp2(self)
[docs] def getTkp3(self) -> "double": r""" get time instant k+3 of the time discretisation. It is used when we have to reschedule a TD Event in scheduleNonSmoothEvent :rtype: float :return: a double. If the simulation is near the end (t_{k+3} >= T), it returns NaN. """ return _sicpykernel.EventsManager_getTkp3(self)
[docs] def currentTimeStep(self) -> "double": r""" Get current timestep :rtype: float :return: the current timestep """ return _sicpykernel.EventsManager_currentTimeStep(self)
[docs] def timeDiscretisation(self) -> "TimeDiscretisation const &": r""" get TimeDiscretisation :rtype: :py:class:`TimeDiscretisation` :return: the TimeDiscretisation in use for the time integration """ return _sicpykernel.EventsManager_timeDiscretisation(self)
[docs] def updateT(self, T: "double") -> "void": r""" update final time :type T: float :param T: the new final time """ return _sicpykernel.EventsManager_updateT(self, T)
def __disown__(self): self.this.disown() _sicpykernel.disown_EventsManager(self) return weakref.proxy(self)
# Register EventsManager in _sicpykernel: _sicpykernel.EventsManager_swigregister(EventsManager) GAPLIMIT_DEFAULT = cvar.GAPLIMIT_DEFAULT
[docs] class Event(object): r""" Abstract class that represents generic time events. This base class simply records the time at which the event will take place. A pure virtual function named process will be invoked to execute the event. The time is represented with a mpz_t, from gmp library. See http://gmplib.org. Derived classes: - TimeDiscretisationEvent: events that corresponds to user-defined time-discretisation points - NonSmoothEvent: specific events, detected during simulation, when constraints are violated (thanks to roots-finding algorithm) - SensorEvent: event dedicated to data capture through user-defined sensors. Existing types of events: 0 -> undef 1 -> TimeDiscretisation 2 -> NonSmooth 3 -> Sensor 4 -> Observer 5 -> Actuator """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _timeOfEvent = property(_sicpykernel.Event__timeOfEvent_get, _sicpykernel.Event__timeOfEvent_set, doc=r""" Date of the present event, represented with a mpz_t """) _tickIncrement = property(_sicpykernel.Event__tickIncrement_get, _sicpykernel.Event__tickIncrement_set, doc=r""" Number of ticks corresponding to a timestep""") _type = property(_sicpykernel.Event__type_get, _sicpykernel.Event__type_set, doc=r""" Id or type of the Event""") _dTime = property(_sicpykernel.Event__dTime_get, _sicpykernel.Event__dTime_set, doc=r""" Date of the present event, represented with a double """) _tick = property(_sicpykernel.Event__tick_get, _sicpykernel.Event__tick_set, doc=r""" confidence interval used to convert double time value to mpz_t""") _eventCreated = property(_sicpykernel.Event__eventCreated_get, _sicpykernel.Event__eventCreated_set, doc=r""" has one Event object been instanciated. Use to detect in setTick potentially dangerous cases""") _k = property(_sicpykernel.Event__k_get, _sicpykernel.Event__k_set, doc=r""" index for the current Event""") _td = property(_sicpykernel.Event__td_get, _sicpykernel.Event__td_set, doc=r""" TimeDiscretisation for the Event (unused only in the NonSmoothEvent)""") _reschedule = property(_sicpykernel.Event__reschedule_get, _sicpykernel.Event__reschedule_set, doc=r""" For automatic rescheduling""") def __init__(self, *args): r""" *Overload 1:* Default constructor | *Overload 2:* constructor with time value and type as input :type time: float :param time: the starting type (a double) :type newType: int, optional :param newType: the Event type (an int) :type reschedule: boolean, optional :param reschedule: set this to true if the event has to be rescheduled | *Overload 3:* constructor with time value and type as input :type time: float :param time: the starting type (a double) :type newType: int, optional :param newType: the Event type (an int) :param reschedule: set this to true if the event has to be rescheduled | *Overload 4:* constructor with time value and type as input :type time: float :param time: the starting type (a double) :param newType: the Event type (an int) :param reschedule: set this to true if the event has to be rescheduled """ if self.__class__ == Event: _self = None else: _self = self _sicpykernel.Event_swiginit(self, _sicpykernel.new_Event(_self, *args)) __swig_destroy__ = _sicpykernel.delete_Event
[docs] def getTick(self) -> "double": r""" get tick value :rtype: float :return: a double """ return _sicpykernel.Event_getTick(self)
[docs] @staticmethod def setTick(newTick: "double") -> "void": r""" set tick value :type newTick: float :param newTick: the new tick value """ return _sicpykernel.Event_setTick(newTick)
[docs] def getTimeOfEvent(self) -> "mpz_t const *": r""" get the time of the present event (mpz_t format) :rtype: :py:class:`__mpz_struct` :return: a mpz_t """ return _sicpykernel.Event_getTimeOfEvent(self)
[docs] def getDoubleTimeOfEvent(self) -> "double": r""" get the time of the present event (double format) :rtype: float :return: a double """ return _sicpykernel.Event_getDoubleTimeOfEvent(self)
def incrementTime(self, step: "unsigned int"=1) -> "void": return _sicpykernel.Event_incrementTime(self, step)
[docs] def setTime(self, time: "double") -> "void": r""" set the time of the present event (double format) :type time: float :param time: the new time """ return _sicpykernel.Event_setTime(self, time)
[docs] def getType(self) -> "int": r""" get a type of the present event :rtype: int :return: an std::string """ return _sicpykernel.Event_getType(self)
[docs] def setType(self, newType: "int") -> "void": r""" set a new type for the present Event :type newType: int :param newType: the new Event type """ return _sicpykernel.Event_setType(self, newType)
[docs] def setK(self, newK: "unsigned int") -> "void": r""" Set the current step k :type newK: int :param newK: the new value of _k """ return _sicpykernel.Event_setK(self, newK)
[docs] def setTimeDiscretisation(self, td: "SP::TimeDiscretisation") -> "void": r""" Set the TimeDiscretisation :type td: :py:class:`TimeDiscretisation` :param td: a TimeDiscretisation for this Event """ return _sicpykernel.Event_setTimeDiscretisation(self, td)
[docs] def getTimeDiscretisation(self) -> "SP::TimeDiscretisation": r""" Get the TimeDiscretisation :rtype: :py:class:`TimeDiscretisation` :return: the TimeDiscretisation used in this Event """ return _sicpykernel.Event_getTimeDiscretisation(self)
[docs] def display(self) -> "void": r""" display Event data""" return _sicpykernel.Event_display(self)
[docs] def process(self, sim: "Simulation") -> "void": r""" virtual function which actions depends on event type :type sim: :py:class:`Simulation` :param sim: the simulation that owns this Event (through the EventsManager) """ return _sicpykernel.Event_process(self, sim)
[docs] def update(self, k: "unsigned int"=0) -> "void": r""" virtual function which actions depends on event type. The generic implementation present in this object is to increment the TimeDiscretisation and to chamge the time of the current Event :type k: int, optional :param k: meaning depends on the type of event. See derived class. """ return _sicpykernel.Event_update(self, k)
def reschedule(self) -> "bool": return _sicpykernel.Event_reschedule(self) def __disown__(self): self.this.disown() _sicpykernel.disown_Event(self) return weakref.proxy(self)
# Register Event in _sicpykernel: _sicpykernel.Event_swigregister(Event) DEFAULT_TICK = cvar.DEFAULT_TICK
[docs] def Event_setTick(newTick: "double") -> "void": r""" set tick value :type newTick: float :param newTick: the new tick value """ return _sicpykernel.Event_setTick(newTick)
[docs] class BoundaryCondition(object): r""" This class models simple boundary conditions for prescribing the velocities in a Dynamical System. A simple boundary condition is considered to fix a component :math:`j` of the velocity vector, i.e., :math:`v_j(t) = bc(t)` where :math:`bc(t)` is a given function of time. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _sicpykernel.delete_BoundaryCondition
[docs] def velocityIndices(self) -> "SP::UnsignedIntVector": r""" to get the velocityIndices :rtype: :py:class:`UnsignedIntVector` :return: a pointer on _velocityIndices """ return _sicpykernel.BoundaryCondition_velocityIndices(self)
[docs] def prescribedVelocity(self) -> "SP::SiconosVector": r""" to get the prescribedVelocity :rtype: :py:class:`SiconosVector` :return: a pointer on _prescribedVelocity """ return _sicpykernel.BoundaryCondition_prescribedVelocity(self)
[docs] def prescribedVelocityOld(self) -> "SP::SiconosVector": r""" to get the prescribedVelocityOld :rtype: :py:class:`SiconosVector` :return: a pointer on _prescribedVelocityOld """ return _sicpykernel.BoundaryCondition_prescribedVelocityOld(self)
[docs] def setComputePrescribedVelocityFunction(self, pluginPath: "std::string const &", functionName: "std::string const &") -> "void": r""" allow to set a specified function to compute prescribedVelocity :type pluginPath: string :param pluginPath: the complete path to the plugin :type functionName: string :param functionName: the name of the function to use in this plugin """ return _sicpykernel.BoundaryCondition_setComputePrescribedVelocityFunction(self, pluginPath, functionName)
[docs] def computePrescribedVelocity(self, time: "double") -> "void": r""" default function to compute the precribed velocities :type time: float :param time: : the current time """ return _sicpykernel.BoundaryCondition_computePrescribedVelocity(self, time)
[docs] def display(self) -> "void": r""" display""" return _sicpykernel.BoundaryCondition_display(self)
def __init__(self, *args): r""" *Overload 1:* Basic constructor :type newVelocityIndices: :py:class:`UnsignedIntVector` :param newVelocityIndices: the indices of the velocity subjected to prescribed velocities | *Overload 2:* Constructor with constant prescribed values :type newVelocityIndices: :py:class:`UnsignedIntVector` :param newVelocityIndices: the indices of the velocity subjected to prescribed velocities :type newVelocityValues: :py:class:`SiconosVector` :param newVelocityValues: the values of the prescribed velocities | *Overload 3:* protected default constructor """ if self.__class__ == BoundaryCondition: _self = None else: _self = self _sicpykernel.BoundaryCondition_swiginit(self, _sicpykernel.new_BoundaryCondition(_self, *args)) _velocityIndices = property(_sicpykernel.BoundaryCondition__velocityIndices_get, _sicpykernel.BoundaryCondition__velocityIndices_set) _prescribedVelocity = property(_sicpykernel.BoundaryCondition__prescribedVelocity_get, _sicpykernel.BoundaryCondition__prescribedVelocity_set) _prescribedVelocityOld = property(_sicpykernel.BoundaryCondition__prescribedVelocityOld_get, _sicpykernel.BoundaryCondition__prescribedVelocityOld_set) _pluginPrescribedVelocity = property(_sicpykernel.BoundaryCondition__pluginPrescribedVelocity_get, _sicpykernel.BoundaryCondition__pluginPrescribedVelocity_set) def __disown__(self): self.this.disown() _sicpykernel.disown_BoundaryCondition(self) return weakref.proxy(self)
# Register BoundaryCondition in _sicpykernel: _sicpykernel.BoundaryCondition_swigregister(BoundaryCondition)
[docs] class HarmonicBC(BoundaryCondition): r""" This class models a simple harmonic boundary conditions for prescribing the velocities in a Dynamical System. A simple boundary condition is considered to fix a component :math:`j` of the velocity vector, i.e., :math:`v_j(t) = a + b cos( \omega t+ \phi)`. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _sicpykernel.delete_HarmonicBC
[docs] def computePrescribedVelocity(self, time: "double") -> "void": r""" default function to compute the precribed velocities :type time: float :param time: : the current time """ return _sicpykernel.HarmonicBC_computePrescribedVelocity(self, time)
def __init__(self, *args): r""" *Overload 1:* Constructor :type newVelocityIndices: :py:class:`UnsignedIntVector` :param newVelocityIndices: the indices of the velocity subjected to prescribed velocities :type a: float :param a: constant value for additive term of the prescribed velocity :type b: float :param b: constant value for multiplicative term of the prescribed velocity :type omega: float :param omega: frequency :type phi: float :param phi: phase | *Overload 2:* protected default constructor """ if self.__class__ == HarmonicBC: _self = None else: _self = self _sicpykernel.HarmonicBC_swiginit(self, _sicpykernel.new_HarmonicBC(_self, *args)) _a = property(_sicpykernel.HarmonicBC__a_get, _sicpykernel.HarmonicBC__a_set, doc=r""" Constant additive term of the prescribed velocity""") _b = property(_sicpykernel.HarmonicBC__b_get, _sicpykernel.HarmonicBC__b_set, doc=r""" Constant multiplicative term of the prescribed velocity""") _omega = property(_sicpykernel.HarmonicBC__omega_get, _sicpykernel.HarmonicBC__omega_set, doc=r""" Constant frequency""") _phi = property(_sicpykernel.HarmonicBC__phi_get, _sicpykernel.HarmonicBC__phi_set, doc=r""" Constant phase""") _aV = property(_sicpykernel.HarmonicBC__aV_get, _sicpykernel.HarmonicBC__aV_set, doc=r""" Constant additive term of the prescribed velocity""") _bV = property(_sicpykernel.HarmonicBC__bV_get, _sicpykernel.HarmonicBC__bV_set, doc=r""" Constant multiplicative term of the prescribed velocity""") _omegaV = property(_sicpykernel.HarmonicBC__omegaV_get, _sicpykernel.HarmonicBC__omegaV_set, doc=r""" Constant frequency""") _phiV = property(_sicpykernel.HarmonicBC__phiV_get, _sicpykernel.HarmonicBC__phiV_set, doc=r""" Constant phase""") def __disown__(self): self.this.disown() _sicpykernel.disown_HarmonicBC(self) return weakref.proxy(self)
# Register HarmonicBC in _sicpykernel: _sicpykernel.HarmonicBC_swigregister(HarmonicBC)
[docs] class FixedBC(BoundaryCondition): r""" This class models a simple fixed boundary conditions for prescribing the velocities in a Dynamical System. A simple boundary condition is considered to fix a component :math:`j` of the velocity vector, i.e., :math:`v_j(t) = 0` """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _sicpykernel.delete_FixedBC
[docs] def computePrescribedVelocity(self, time: "double") -> "void": r""" default function to compute the precribed velocities :type time: float :param time: : the current time """ return _sicpykernel.FixedBC_computePrescribedVelocity(self, time)
def __init__(self, *args): r""" *Overload 1:* Basic constructor :type newVelocityIndices: :py:class:`UnsignedIntVector` :param newVelocityIndices: the indices of the velocity subjected to prescribed velocities | *Overload 2:* protected default constructor """ if self.__class__ == FixedBC: _self = None else: _self = self _sicpykernel.FixedBC_swiginit(self, _sicpykernel.new_FixedBC(_self, *args)) def __disown__(self): self.this.disown() _sicpykernel.disown_FixedBC(self) return weakref.proxy(self)
# Register FixedBC in _sicpykernel: _sicpykernel.FixedBC_swigregister(FixedBC)
[docs] class OSNSMatrix(object): r""" Interface to some specific storage types for matrices used in OneStepNSProblem This class is used to define an interface for various storage methods used for matrices in OneStepNSProblem. Its aim is to fill the Numerics structure NumericsMatrix, required in many XXX_problem structures of Numerics as input argument for drivers. The idea is to remove all matrix storage management problems from OSNS classes (LCP ...) and to leave it into this class. Two main functions: - fill(indexSet, interactionBlocks): fill the matrix using a list of "active" Interaction, in indexSet, and a MapOfMapOfInteractionMatrices, interactionBlocks, which determines which Interaction are connected or not (ie have common DynamicalSystem). - convert(): fill the NumericsMatrix structure (indeed only pointers links to the components of the present class) Note that OSNSMatrix are square. For example, if in a LCP, constraints of interest are indexSet={inter2,inter3,inter8,inter12}, whith common DynamicalSystem between 2 and 3, 2 and 8 and 8 and 12. interactionBlocks contains matrices for all (interi,interj) which have common DS, for (interi,interj) in I0, the set of all Interaction. (for details on how interactionBlocks is computed see OneStepNSProblem.h). We denote interactionBlocks[interi][interj] = mij. Then, a call to fill(indexSet, interactionBlock) results in a matrix which looks like: .. math:: M=\left\lbrace\begin{array}{cccc} m22 & m23 & m28 & 0 \\ m32 & m33 & 0 & 0 \\ 0 & 0 & m88 & m812 \\ 0 & 0 & m128& m1212 \end{array}\right. Note: at the time the available storage types are: - full matrix in a SiconosMatrix (_storageType = NM_DENSE). In this case, for each call to fill(), the SiconosMatrix M is resized according to the sizes of the Interaction present in indexSet and then all the required interactionBlocks mij are COPIED into M. - Sparse Block Storage (_storageType = NM_SPARSE_BLOCK): corresponds to SparseBlockStructuredMatrix structure of Numerics. Only non-null interactionBlocks are saved in the matrix M and there is no copy of sub-interactionBlocks, only links thanks to pointers. - Sparse matrix (_storageType = NM_SPARSE): at the time of writting, only csc (compressed-sparse column). Could also be triplet (coo or coordinate) or csr (compressed-sparse row). """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr _dimRow = property(_sicpykernel.OSNSMatrix__dimRow_get, _sicpykernel.OSNSMatrix__dimRow_set, doc=r""" number of rows""") _dimColumn = property(_sicpykernel.OSNSMatrix__dimColumn_get, _sicpykernel.OSNSMatrix__dimColumn_set, doc=r""" number of columns""") _storageType = property(_sicpykernel.OSNSMatrix__storageType_get, _sicpykernel.OSNSMatrix__storageType_set, doc=r""" Storage type used for the present matrix""") _triplet_nzmax = property(_sicpykernel.OSNSMatrix__triplet_nzmax_get, _sicpykernel.OSNSMatrix__triplet_nzmax_set, doc=r""" _triplet_nzmax for memory allocation of NM_SPARSE""") _numericsMatrix = property(_sicpykernel.OSNSMatrix__numericsMatrix_get, _sicpykernel.OSNSMatrix__numericsMatrix_set, doc=r""" Numerics structure to be filled""") _M1 = property(_sicpykernel.OSNSMatrix__M1_get, _sicpykernel.OSNSMatrix__M1_set, doc=r""" Matrix used for default storage type (_storageType = NM_DENSE)""") _M2 = property(_sicpykernel.OSNSMatrix__M2_get, _sicpykernel.OSNSMatrix__M2_set, doc=r""" Matrix which corresponds to Numerics SparseBlockStructuredMatrix (_storageType = NM_SPARSE_BLOCK) """) def __init__(self, *args): r""" *Overload 1:* Default constructor -> empty matrix | *Overload 2:* Constructor with _dimRow. of the matrix :type n: int :param n: size of the square matrix :type stor: int :param stor: storage type (NM_DENSE or NM_SPARSE_BLOCK) | *Overload 3:* Constructor with _dimRow and DimColumn of the matrix :type n: int :param n: row sizes of the rectangle matrix :type m: int :param m: column size of the rectangle matrix :type stor: int :param stor: storage type (NM_DENSE or NM_SPARSE_BLOCK) | *Overload 4:* Constructor from index set and map :type indexSet: :py:class:`InteractionsGraph` :param indexSet: InteractionsGraph* the index set of the active constraints :type stor: int :param stor: storage type | *Overload 5:* Constructor with copy of a SiconosMatrix => _storageType = NM_DENSE :type MSource: :py:class:`SiconosMatrix` :param MSource: matrix to be copied """ if self.__class__ == OSNSMatrix: _self = None else: _self = self _sicpykernel.OSNSMatrix_swiginit(self, _sicpykernel.new_OSNSMatrix(_self, *args)) __swig_destroy__ = _sicpykernel.delete_OSNSMatrix
[docs] def size(self) -> "unsigned int": r""" get dimension of the square matrix :rtype: int :return: unsigned int """ return _sicpykernel.OSNSMatrix_size(self)
[docs] def setSize(self, size: "unsigned int") -> "void": r""" get dimension of the square matrix :rtype: void :return: unsigned int """ return _sicpykernel.OSNSMatrix_setSize(self, size)
[docs] def sizeColumn(self) -> "unsigned int": r""" get dimension of the square matrix :rtype: int :return: unsigned int """ return _sicpykernel.OSNSMatrix_sizeColumn(self)
[docs] def storagetype(self) -> "NM_types": r""" get the type of storage for current matrix :rtype: int :return: unsigned int """ return _sicpykernel.OSNSMatrix_storagetype(self)
[docs] def setStorageType(self, i: "NM_types") -> "void": r""" set which type of storage will be used for current matrix :type i: int :param i: the type of storage """ return _sicpykernel.OSNSMatrix_setStorageType(self, i)
[docs] def numericsMatrix(self) -> "SP::NumericsMatrix": r""" get the numerics-readable structure :rtype: :py:class:`NumericsMatrix` :return: SP::NumericsMatrix """ return _sicpykernel.OSNSMatrix_numericsMatrix(self)
[docs] def defaultMatrix(self) -> "SP::SiconosMatrix": r""" get the matrix used for default storage :rtype: :py:class:`SiconosMatrix` :return: SP::NumericsMatrix """ return _sicpykernel.OSNSMatrix_defaultMatrix(self)
[docs] def fillM(self, indexSet: "InteractionsGraph", update: "bool"=True) -> "void": r""" fill the current class using an index set :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the active constraints :type update: boolean, optional :param update: if true update the size of the Matrix (default true) """ return _sicpykernel.OSNSMatrix_fillM(self, indexSet, update)
[docs] def computeM(self, Winverse: "SP::NumericsMatrix", H: "SP::NumericsMatrix") -> "void": r""" Compute the M matrix given the inverse of W and H :type Winverse: :py:class:`NumericsMatrix` :param Winverse: the NumericsMatrix that contains the inverse of W :type Winverse: :py:class:`NumericsMatrix` :param Winverse: the NumericsMatrix that contains H """ return _sicpykernel.OSNSMatrix_computeM(self, Winverse, H)
[docs] def fillW(self, DSG: "DynamicalSystemsGraph", update: "bool"=True) -> "void": r""" fill the current class using an index set with the W matrix of DS :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the index set of the dynamicalSystems :type update: boolean, optional :param update: if true update the size of the Matrix (default true) """ return _sicpykernel.OSNSMatrix_fillW(self, DSG, update)
[docs] def fillWinverse(self, DSG: "DynamicalSystemsGraph", update: "bool"=True) -> "void": r""" fill the current class using an index set with the inverse of W matrix of DS :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the index set of the dynamicalSystems :type update: boolean, optional :param update: if true update the size of the Matrix (default true) """ return _sicpykernel.OSNSMatrix_fillWinverse(self, DSG, update)
[docs] def fillH(self, DSG: "DynamicalSystemsGraph", indexSet: "InteractionsGraph", update: "bool"=True) -> "void": r""" fill the current class using an index set :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the index set of the dynamicalSystems :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the Interactions :type update: boolean, optional :param update: if true update the size of the Matrix (default true) """ return _sicpykernel.OSNSMatrix_fillH(self, DSG, indexSet, update)
[docs] def fillHtrans(self, DSG: "DynamicalSystemsGraph", indexSet: "InteractionsGraph", update: "bool"=True) -> "void": r""" fill the current class using an index set :type DSG: :py:class:`DynamicalSystemsGraph` :param DSG: the index set of the dynamicalSystems :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the Interactions :type update: boolean, optional :param update: if true update the size of the Matrix (default true) """ return _sicpykernel.OSNSMatrix_fillHtrans(self, DSG, indexSet, update)
[docs] def convert(self) -> "void": r""" fill the numerics structure _numericsMatSparse using MBlockCSR""" return _sicpykernel.OSNSMatrix_convert(self)
[docs] def display(self) -> "void": r""" display the current matrix""" return _sicpykernel.OSNSMatrix_display(self)
def __disown__(self): self.this.disown() _sicpykernel.disown_OSNSMatrix(self) return weakref.proxy(self)
# Register OSNSMatrix in _sicpykernel: _sicpykernel.OSNSMatrix_swigregister(OSNSMatrix)
[docs] class BlockCSRMatrix(object): r""" Definition of a compressed sparse row matrix of SiconosMatrix, used in OneStepNSProblem to store the M matrix. This class defines a specific compressed row sparse storage for blocks matrices, each block being a SiconosMatrix*. It handles: - a SparseMat (boost-ublas) of SiconosMatrix* - a vector<SiconosMatrix*> which handles the non-null blocks - three vector<int> (IndexInt) to save non-null blocks position in row, columns and the list of the sizes of diagonal blocks. - two int, the number of blocks in a row and the number of non null blocks. Each block of the current object represents the connection between two coupled Interactions, (for example for Lagrangian systems, a single :math:`H W^{-1} H^t` block or for first order systems :math:`hCW^{-1}B` ...). This objects is built using an index set of SP::Interaction, that represents the "active" constraints in the OSNS problem and a map<SP::Interaction u1, <SP::Interaction u2, SP::SiconosMatrix block> >, block being the link between u1 and u2. Only Interaction present in the index set are picked out in the map. A convert method is also implemented to create a SparseBlockStructuredMatrix which is Numerics-readable. As an example, consider the index set I={u1, u3, u5, u8} and the map where non null blocks are (ui,ui), (u1,u3), (u1,u8), (u3,u1), (u8,u1). Each block being a pointer to a 3x3 matrix. Then the resulting matrix has 4 X 4 blocks, with 8 non-null blocks and looks like: .. math:: M=\left\lbrace\begin{array}{cccc} b11 & b13 & 0 & b18 \\ b31 & b22 & 0 & 0 \\ 0 & 0 & b33&0 \\ b81 & 0 & 0 & b44 \end{array}\right. with nc = 4, nbNonNullBlocks = 8, RowPos = [0 0 0 1 1 2 3 3], RowCol = [0 1 3 0 1 2 0 3] and _diagsize0 = [3 6 9 12]. We use std::vector (which may seems redundent with the double* of the numerics SparseBlockStructuredMatrix) because memory can be reserved during construction or initialized and then vectors are resized when the object is filled in. This avoid some call to malloc/free at each iteration. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" *Overload 1:* Default constructor -> empty matrix | *Overload 2:* Constructor with dimension (number of blocks) :type n: int :param n: number of blocks in a row/column (only square matrices allowed) | *Overload 3:* Constructor from index set :type indexSet: :py:class:`InteractionsGraph` :param indexSet: the index set of the active constraints """ _sicpykernel.BlockCSRMatrix_swiginit(self, _sicpykernel.new_BlockCSRMatrix(*args)) __swig_destroy__ = _sicpykernel.delete_BlockCSRMatrix
[docs] def numberOfBlocksInARow(self) -> "unsigned int": r""" get size (in block-components) :rtype: int :return: unsigned int NumberOfBlocksInARow """ return _sicpykernel.BlockCSRMatrix_numberOfBlocksInARow(self)
[docs] def getNbNonNullBlocks(self) -> "unsigned int": r""" get total number of non-null blocks :rtype: int :return: unsigned int """ return _sicpykernel.BlockCSRMatrix_getNbNonNullBlocks(self)
[docs] def getNumericsMatSparse(self) -> "SP::SparseBlockStructuredMatrix": r""" get the numerics-readable structure :rtype: :py:class:`SparseBlockStructuredMatrix` :return: SP::SparseBlockStructuredMatrix """ return _sicpykernel.BlockCSRMatrix_getNumericsMatSparse(self)
[docs] def getMSparse(self) -> "SP::CompressedRowMat": r""" get the ublas sparse mat :rtype: SP::CompressedRowMat :return: SP::CompressedRowMat """ return _sicpykernel.BlockCSRMatrix_getMSparse(self)
[docs] def getSizeOfDiagonalBlock(self, i: "int") -> "IndexInt::value_type": r""" get the dimension of the square-diagonal block number num :type i: int :param i: block position :rtype: int :return: unsigned int """ return _sicpykernel.BlockCSRMatrix_getSizeOfDiagonalBlock(self, i)
[docs] def getPositionsIndex(self, i: "bool") -> "SP::IndexInt": r""" get the index of blocks position (i=0 -> rows, i=1 -> columns) :type i: boolean :param i: unsigned int, 0 for rows, 1 for columns :rtype: :py:class:`IndexInt` :return: SP::IndexInt """ return _sicpykernel.BlockCSRMatrix_getPositionsIndex(self, i)
[docs] def fill(self, indexSet: "InteractionsGraph") -> "void": r""" fill the current class using an index set :type indexSet: :py:class:`InteractionsGraph` :param indexSet: set of the active constraints """ return _sicpykernel.BlockCSRMatrix_fill(self, indexSet)
[docs] def fillW(self, indexSet: "InteractionsGraph") -> "void": r""" fill the matrix with the Mass matrix Warning: only for NewtonEulerDS :type indexSet: :py:class:`InteractionsGraph` :param indexSet: of the active constraints """ return _sicpykernel.BlockCSRMatrix_fillW(self, indexSet)
[docs] def fillH(self, indexSet: "InteractionsGraph") -> "void": r""" fill the matrix with the H matrix Warning: only for NewtonEuler3DR :type indexSet: :py:class:`InteractionsGraph` :param indexSet: of the active constraints """ return _sicpykernel.BlockCSRMatrix_fillH(self, indexSet)
[docs] def convert(self) -> "void": r""" fill the numerics structure _sparseBlockStructuredMatrix using _blockCSR""" return _sicpykernel.BlockCSRMatrix_convert(self)
[docs] def display(self) -> "void": r""" display the current matrix""" return _sicpykernel.BlockCSRMatrix_display(self)
# Register BlockCSRMatrix in _sicpykernel: _sicpykernel.BlockCSRMatrix_swigregister(BlockCSRMatrix) def getMatrix(v: "SP::SiconosMatrix") -> "SP::SiconosMatrix const": return _sicpykernel.getMatrix(v) def getVector(*args) -> "PyArrayObject const *": return _sicpykernel.getVector(*args) def cast_NewtonImpactFrictionNSL(nslaw: "SP::NonSmoothLaw") -> "SP::NewtonImpactFrictionNSL": return _sicpykernel.cast_NewtonImpactFrictionNSL(nslaw) def cast_FremondImpactFrictionNSL(nslaw: "SP::NonSmoothLaw") -> "SP::FremondImpactFrictionNSL": return _sicpykernel.cast_FremondImpactFrictionNSL(nslaw) def cast_RelayNSL(nslaw: "SP::NonSmoothLaw") -> "SP::RelayNSL": return _sicpykernel.cast_RelayNSL(nslaw) def cast_NewtonImpactNSL(nslaw: "SP::NonSmoothLaw") -> "SP::NewtonImpactNSL": return _sicpykernel.cast_NewtonImpactNSL(nslaw) def cast_NewtonEulerDS(ds: "SP::DynamicalSystem") -> "SP::NewtonEulerDS": return _sicpykernel.cast_NewtonEulerDS(ds) def cast_LagrangianDS(ds: "SP::DynamicalSystem") -> "SP::LagrangianDS": return _sicpykernel.cast_LagrangianDS(ds) def cast_NewtonEuler1DR(r: "SP::Relation") -> "SP::NewtonEuler1DR": return _sicpykernel.cast_NewtonEuler1DR(r) def cast_NewtonEulerR(r: "SP::Relation") -> "SP::NewtonEulerR": return _sicpykernel.cast_NewtonEulerR(r) def cast_FrictionContact(osnpb: "SP::OneStepNSProblem") -> "SP::FrictionContact": return _sicpykernel.cast_FrictionContact(osnpb) def size_graph(index_set: "InteractionsGraph") -> "size_t": return _sicpykernel.size_graph(index_set)