Skip to content

[KratosAPI] MultiPoint Constraint (MPC) interface

Vicente Mataix Ferrándiz edited this page Jan 30, 2019 · 10 revisions

Content

  1. Overview
  2. Formulation
    1. Problem introduction
    2. The Master-Slave method
  3. Kratos interface (how to use it)
  4. References

Overview

MultiFreedom Constraints (MFC) are functional equations that connect two or more degrees of freedom components:

 F(nodal degree of freedom)  = prescribed value

An MFC of this form is called multipoint or multinode (MPC) if it involves DoF components at different nodes. The constraint is called linear if all displacement components appear linearly on the left-hand-side, and nonlinear otherwise.

There are basically three methods for treating MFC.

  1. Master-Slave Elimination. The degrees of freedom involved in each MFC are separated into master and slave freedoms. The slave freedoms are then explicitly eliminated. The modified equations do not contain the slave freedoms.
  2. Penalty Augmentation. Also called the penalty function method. Each MFC is viewed as the presence of a fictitious elastic structural element called penalty element that enforces it approximately. This element is parametrized by a numerical weight. The exact constraint is recovered if the weight goes to infinity. The MFCs are imposed by augmenting the finite element model with the penalty elements.
  3. Lagrange Multiplier Adjunction. For each MFC an additional unknown is adjoined to the master stiffness equations. Physically this set of unknowns represent constraint forces that would enforce the constraints exactly should they be applied to the unconstrained system.

These methods can be compared, the following table resumes the differences between them.

Comparison

The MFC implemented in Kratos is the Master-Slave Elimination, this will be the one presented in the Formulation section.

Formulation

Problem introduction

We will use a very simple structure example in order to explain how the formulation works. This structure consists of six bar elements connected by seven nodes that can only displace in the x direction. Before imposing various multifreedom constraints discussed below, the master stiffness equations for this problem are assumed to be

Now let us specify a multifreedom constraint that states that nodes 2 and 6 are to move by the same amount:

u2 = u6

Passing all node displacements to the right hand side gives the canonical form:

u2-u6=0

Constraintconditionsofthistypearesometimescalled rigid links becausetheycanbemechanically interpreted as forcing node points 2 and 6 to move together as if they were tied by a rigid member.

The Master-Slave method

To apply this method by hand, the MFCs are taken one at a time. For each constraint a slave degree of freedom is chosen. The freedoms remaining in that constraint are labeled master. A new set of degrees of freedom u is established by removing all slave freedoms from u. This new vector contains master freedoms as well as those that do not appear in the MFCs. A matrix transformation equation that relates u to u is generated. This equation is used to apply a congruential transformation to the master stiffness equations. This procedure yields a set of modified stiffness equations that are expressed in terms of the new freedom set u. Because the modified system does not contain the slave freedoms, these have been effectively eliminated.

The mechanics of the process is best seen by going through an example.

This is the required transformation relation. In compact form:

Replacing and premultiplying by T yields the modified system:

Carrying out the indicated matrix multiplications yields:

Kratos interface (how to use it)

The MPC are implemented in Kratos via the MasterSlaveConstraint class, and particularly the linear kinematic relationship can be found in in the class LinearMasterSlaveConstraint class.

The LinearMasterSlaveConstraint is defined by the following:

  • Index: The Id of the new created constraint
  • Vector of master DoF: The vector containing the DoF of the master side
  • Vector of slave DoF: The vector containing the DoF of the slave side
  • A relation matrix : The relation matrix between the master/slave DoF. This is T in the theoretical formulation.
  • A constant vector: The vector containing the additional kinematic relationship

Additionally to this, in order to consider the MPC into ths system assembly the ResidualBasedBlockBuilderAndSolverWithConstraints must be used as builder and solver.

The MasterSlaveConstraint are part of the Mesh class, so they are stored in the ModelPart as the elements and conditions do. Then the ModelPart has an interface to access and create them. Particularly the methods CreateNewMasterSlaveConstraint are of interest, there are three options:

MasterSlaveConstraint::Pointer CreateNewMasterSlaveConstraint(
	const std::string& ConstraintName,
	IndexType Id, 
	DofsVectorType& rMasterDofsVector,
	DofsVectorType& rSlaveDofsVector,
	const MatrixType& RelationMatrix,
	const VectorType& ConstantVector,
	IndexType ThisIndex = 0);

MasterSlaveConstraint::Pointer CreateNewMasterSlaveConstraint(
	const std::string& ConstraintName, 
	IndexType Id, 
	NodeType& rMasterNode,
	const DoubleVariableType& rMasterVariable,
	NodeType& rSlaveNode,
	const DoubleVariableType& rSlaveVariable,
	const double Weight,
	const double Constant,
	IndexType ThisIndex = 0);

MasterSlaveConstraint::Pointer CreateNewMasterSlaveConstraint(
	const std::string& ConstraintName, 
	IndexType Id, 
	NodeType& rMasterNode,
	const VariableComponentType& rMasterVariable,
	NodeType& rSlaveNode,
	const VariableComponentType& rSlaveVariable,
	double Weight,
	double Constant,
	IndexType ThisIndex = 0);

This can be seen in a simple example:

import KratosMultiphysics

# Define a Model
current_model = KratosMultiphysics.Model()
mp = current_model.CreateModelPart("Main")

mp.AddNodalSolutionStepVariable(KratosMultiphysics.DISPLACEMENT)
mp.AddNodalSolutionStepVariable(KratosMultiphysics.REACTION)

mp.CreateNewNode(1, 0.00000, 0.00000, 0.00000)
mp.CreateNewNode(2, 0.00000, 1.00000, 0.00000)

KratosMultiphysics.VariableUtils().AddDof(KratosMultiphysics.DISPLACEMENT_X, KratosMultiphysics.REACTION_X, mp)
KratosMultiphysics.VariableUtils().AddDof(KratosMultiphysics.DISPLACEMENT_Y, KratosMultiphysics.REACTION_Y, mp)
KratosMultiphysics.VariableUtils().AddDof(KratosMultiphysics.DISPLACEMENT_Z, KratosMultiphysics.REACTION_Z, mp)

mp.CreateNewMasterSlaveConstraint("LinearMasterSlaveConstraint", 1, mp.Nodes[1], KratosMultiphysics.DISPLACEMENT_X, mp.Nodes[2], KratosMultiphysics.DISPLACEMENT_X, 1.0, 0) # This constructor already sets the falg, but in order to be general we set it again
mp.Nodes[2].Set(KratosMultiphysics.SLAVE)

# We impose the BC
mp.Nodes[1].Fix(KratosMultiphysics.DISPLACEMENT_X)
mp.Nodes[1].SetSolutionStepValue(KratosMultiphysics.DISPLACEMENT_X, 0.1)

#define a minimal newton raphson solver
linear_solver = KratosMultiphysics.SkylineLUFactorizationSolver()
builder_and_solver = KratosMultiphysics.ResidualBasedBlockBuilderAndSolverWithConstraints(linear_solver)
scheme = KratosMultiphysics.ResidualBasedIncrementalUpdateStaticScheme()
convergence_criterion = KratosMultiphysics.ResidualCriteria(1e-10, 1e-12)
convergence_criterion.SetEchoLevel(0)

max_iters = 100
compute_reactions = False
reform_step_dofs = True
move_mesh_flag = False
strategy = KratosMultiphysics.ResidualBasedNewtonRaphsonStrategy(
    mp, scheme, linear_solver, convergence_criterion,
    builder_and_solver, max_iters, compute_reactions,
    reform_step_dofs, move_mesh_flag)
strategy.SetEchoLevel(0)
strategy.Initialize()

strategy.Check()
strategy.Solve()

print(mp.Nodes[2].GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT_X))

assert mp.Nodes[2].GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT_X) == mp.Nodes[1].GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT_X)

IMPORTANT: The slaves nodes must have the flag SLAVE set to true

References

[1] "MultiFreedom Constraint I " by C. Felippa. Link

[2] "MultiFreedom Constraint II " by C. Felippa. Link

[3] "Multi-Point Constraints". Link

Project information

Getting Started

Tutorials

Developers

Kratos structure

Conventions

Solvers

Debugging, profiling and testing

HOW TOs

Utilities

Kratos API

Kratos Structural Mechanics API

Clone this wiki locally