# $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/modules/module-hunt-crossley/hunt_crossley,v 1.7 2017/01/12 14:52:34 masarati Exp $
#
# MBDyn (C) is a multibody analysis code. 
# http://www.mbdyn.org
# 
# Copyright (C) 1996-2017
# 
# Pierangelo Masarati	<masarati@aero.polimi.it>
# Paolo Mantegazza	<mantegazza@aero.polimi.it>
# 
# Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
# via La Masa, 34 - 20156 Milano, Italy
# http://www.aero.polimi.it
# 
# Changing this copyright notice is forbidden.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation (version 2 of the License).
# 
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

module load: "./libmodule-hunt-crossley.so";

begin: data;
	problem: initial value;
end: data;

begin: initial value;
	initial time: 0.;
	final time: 10.;
	time step: 1e-3;

	tolerance: 1e-6;
	max iterations: 20;
end: initial value;

begin: control data;
	structural nodes: 2;
	rigid bodies: 1;
	joints:
		+1		# ground
		+1		# guide
		+1		# contact (rod)
	;
	gravity;
end: control data;

set: const real L0 = 2.;
set: const real LREF = 1.;

begin: nodes;
	structural: 0, static,
		null,
		eye,
		null,
		null,
		output, no;

	structural: 1, dynamic,
		0., 0., L0,
		eye,
		null,
		null;
end: nodes;

begin: elements;
	gravity: 0., 0., -1., 9.81;
	body: 1, 1, 1., null, eye;

	joint: 0, clamp, 0, node, node;

	joint: 1, total joint,
		1,
			position, reference, node, null,
			position orientation, reference, node, eye,
			rotation orientation, reference, node, eye,
		0,
			position, reference, other node, null,
			position orientation, reference, other node, eye,
			rotation orientation, reference, other node, eye,
		position constraint, 1, 1, 0, null,
		orientation constraint, 1, 1, 1, null;

	joint: 2, rod,
		0,
			position, reference, node, null,
		1,
			position, reference, node, null,
		LREF,
		hunt crossley, alpha, 4e-2, kappa, 1e6, exp, 1.5;
end: elements;
