MP Constraints
Multi-point constraints create relationships between multiple nodes in your mesh, allowing you to create master-slave relationships, rigid links, rigid diaphragms, and laminar boundary conditions.
Understanding the MP Constraint Manager
The MPConstraintManager
is a core component of Femora that provides a centralized system for creating, managing, and applying multi-point constraints to your model. It implements the Singleton pattern to ensure a single, consistent point of constraint management across the entire application.
MP constraints define relationships between multiple nodes in your mesh, allowing you to:
Create master-slave relationships between nodes
Create rigid links between nodes
Create rigid diaphragms across sets of nodes
Create laminar boundary conditions on mesh surfaces
MP constraints are typically applied after assembling the mesh, as they operate on nodes in the assembled mesh.
Accessing the MP Constraint Manager
There are two ways to access the MP Constraint Manager:
Direct Access: Import and use the MPConstraintManager class directly
from femora.components.Constraint.mpConstraint import mpConstraintManager # Get the singleton instance mp_manager = mpConstraintManager() # Use MP manager directly mp_manager.create_equal_dof(...)
Through Femora (Recommended): Access via the Femora class and the Constraint module
import femora as fm # Create a Femora instance # Access the MPConstraintManager through the constraint property mp_manager = fm.constraint.mp # Add constraints using the manager mp_manager.create_equal_dof(...)
The second approach is recommended as it provides a unified interface to all of Femora’s components and ensures proper initialization of all dependencies.
Managing MP Constraints
The MP Constraint Manager provides methods to manage constraints:
# Get a specific constraint by tag
constraint = mp_manager.get_constraint(tag=1)
# Remove a constraint by tag
mp_manager.remove_constraint(tag=1)
# Iterate through all constraints
for constraint in mp_manager:
print(constraint)
Best Practices for MP Constraints
Create MP constraints after mesh assembly to ensure all nodes are properly defined
Choose master nodes carefully as they control the motion of all slave nodes
Avoid cyclic constraints where nodes are both masters and slaves in different constraints
Be careful with over-constrained systems as they may lead to numerical issues
Consider using laminar_boundary for soil-structure interfaces to create appropriate boundary conditions
MP Constraint Manager API Reference
Below is the complete API reference for the MPConstraintManager class:
Available MP Constraint Types
Femora provides several types of MP constraints: