Beispiel #1
0
import numpy as np
import getfem as gf
from matplotlib.pyplot import *

t0 = 0.0  # start time
T = 10.0  # end time
h = 0.005  # time step
g = 9.81  # gravity
e = 0.1  # restitution coeficient
mu = 0.3  # Friction coefficient
theta = 0.5  # theta scheme

with_friction = False

sico = gts.SiconosFem()
fem_model = gts.import_fem(sico)

# =======================================
# Create the siconos Dynamical System
# =======================================
# Initial position and velocity
v0 = np.zeros(sico.nbdof)

block = Kernel.LagrangianLinearTIDS(sico.q0, v0, sico.Mass.full())
F = sico.RHS
block.setFExtPtr(F)
block.setKPtr(sico.Stiff.full())

position_init = sico.pos

# =======================================
Beispiel #2
0
import numpy as np
import getfem as gf
from matplotlib.pyplot import *

t0 = 0.0      # start time
T = 0.1      # end time
h = 0.005   # time step
g = 9.81    # gravity
e = 0.9     # restitution coeficient
mu=0.3 # Friction coefficient
theta = 0.5 # theta scheme

with_friction = False

sico = gts.SiconosFem()
fem_model = gts.import_fem(sico)

# =======================================
# Create the siconos Dynamical System
# =======================================
# Initial position and velocity
v0 = np.zeros(sico.nbdof)

block = kernel.LagrangianLinearTIDS(sico.pos,v0,sico.Mass.full())
F = sico.RHS + sico.K0
block.setFExtPtr(F)
block.setKPtr(sico.Stiff.full())

# =======================================
# The interaction
# =======================================