BoundaryCondition (hwx.inspire)#

class BoundaryCondition#

Bases: Named

Boundary conditions are constraints necessary for the solution of a boundary value problem.

The main types of boundary condition available are force, torque, support, temperature and etc. These can be applied to points, surfaces, edges or remotely offset from a feature. The way that the model is constrained can significantly affect the results and requires special consideration.

Attribute Table#

Name

Type

bearing

property

color

Color

connectionRadius

Double

connectionType

Enum

direction

Direction

distributed

Bool

feature

property

features

List

inahole

property

loadCase

property

localToPart

Bool

location

Location

mode

Enum

part

Reference

parts

List

traction

property

visible

Bool

Method Table#

Name

Description

importLoads (csvFile)

Imports boundary conditions to the active model from a csv file.

setSystem (self, system)

Associate system to a boundary condition.

updatePosition (self, m44)

Sets the design space positions of all the inspire parts to their

property distributed#

Returns whether the applied boundary condition is distributed or not.

Boundary conditions applied across the entire feature area (for faces) or length (for edges) are distributed and at a single point boundary conditions are non-distributed.

property connectionType#

The type of the connection. Valid choices are:

  • rigid

  • flexible

Example

# connectionType is applicable only when the boundary condition is detached.

from hwx import inspire
# Start with an empty model
model = inspire.newModel()
# Alternatively, you can get an existing model
# model = inspire.getModel()
# Create a solid block
block = model.createSolidBlock(x=0.5, y=0.5, z=0.5)
# Get a face feature from the block (using the first available face)
face = block.getFeatures(type='FeatureArea')[0]
# Create a boundary condition on the face feature
force = inspire.Force(features=face, loadCase='current')
# moving the force to a detached state
force.location = face.cg  + [0,0,0.1]
# Set the connection type to 'rigid'
force.connectionType = 'rigid'
# Print the connection type to verify
print("Connection type is set to:", force.connectionType)
# Change the connection type to 'flexible'
force.connectionType = 'flexible'  # Change to flexible
# Print the connection type to verify
print("Connection type is now set to:", force.connectionType)
# Update the view to see the changes
inspire.orientView(direction="isometric")
property part#

Returns the part on which the entity is applied graphically.

property parts#

The list of parts on which the boundary condition is applied.

property mode#

Specifies the mode of the boundary condition.

Valid choices are:

  • direction

  • components

property localToPart#

Returns or sets ‘Rotate with part’.

It makes boundary condition not to rotate or rotate along with its associated part.

Example

from hwx import inspire
# Start with an empty model
model = inspire.newModel()
# Alternatively, you can get an existing model
# model = inspire.getModel()
# Create a solid block
block = model.createSolidBlock(x=0.5, y=0.5, z=0.5)
# Get a face feature from the block (using the first available face)
face = block.getFeatures(type='FeatureArea')[0]
# Create a boundary condition on the face feature
force = inspire.Force(features=face, loadCase='current')
# Set the localToPart attribute to True
# By making localToPart True, the force will will rotate along with the part
force.localToPart = True
# Print the localToPart attribute to verify
print("Local to part attribute is set to:", force.localToPart)
# Update the view to see the changes

inspire.orientView(direction="isometric")
property connectionRadius#

The search radius for the boundary condition.

property color#

The color assigned to the boundary condition.

property visible#

Determines whether the boundary condition is visible or not.

property feature#

Returns the feature on which the boundary condition is attached graphically.

property features#

The list of features to which the boundary condition is applied.

property inahole#

Determines if the boundary condition is applied on a hole or not.

property location#

The location of the boundary condition.

property direction#

The direction of vector the boundary condition.

property loadCase#

The loadcase this boundary condition belongs to.

It can be set to ‘current’ or any instance of LoadCase.

Example

from hwx import inspire

# Start with an empty model
model = inspire.newModel()
block = model.createSolidBlock(x=0.5, y=0.5, z=0.5)
# create a load case with a name Linear Static 1 and type LINEAR_STATIC
loadcaseSupports = inspire.LoadCase( loads=[], name="Linear Static 1", type='LINEAR_STATIC', linkedLoadCase=None)
# Create a Support or Constraint on the first FeatureArea of the block
face = block.getFeatures(type='FeatureArea')[0]
support1 = inspire.Constraint(features=face)
# Adding the support to the load case
loadcaseSupports.add(support1)
print(f"BCs in LoadCase: {loadcaseSupports.name}")
print(f"LoadCase Type: {loadcaseSupports.type}")
print(f"Scale Factor: {loadcaseSupports.scaleFactor}")
print(f"Use Inertia Relief: {loadcaseSupports.inertiaRelief}")
print("	", loadcaseSupports.loads)
# LINEAR_STATIC type loadcase have scaleFactor and inertiaRelief attributes.
# Scale the load case by a factor of 2.0
loadcaseSupports.scaleFactor = 2.0
# disable inertia relief for the load case
loadcaseSupports.inertiaRelief = False

# LINEAR_STATIC and MODAL Load Case have solution settings options 
# How to get the soution settings from the load case
ss = loadcaseSupports.solutionSettings
print("Below are the solution settings properties:")
print(f"Method: {ss.method}")
print(f"Solution Adaption: {ss.solutionAdaption}")
print(f"No of Groups: {len(ss.getAllGroups())}")

# solution settings groups
g1 = ss.getGroup(0)
print("")
print("Below are the group properties for solution settings:")
print(f"Entities: {g1.entities}")
print(f"Adapt to Feature: {g1.adaptToFeature}")
print(f"Adapt to Thin Solid: {g1.adaptToThinSolid}")
print(f"Refinement Level: {g1.refinementLevel}")

# create a load case to hold forces
face1 = block.getFeatures(type='FeatureArea')[2]
force1 = inspire.Force(features=face1, location=face1.location, magnitude=10.0)
# Alternatively, you can create load case with the loads directly
loadcaseForces = inspire.LoadCase( loads=[force1], name="Linear Static 2", type='LINEAR_STATIC', linkedLoadCase=None)  

face2 = block.getFeatures(type='FeatureArea')[4]
force2 = inspire.Force(features=face2, magnitude=10.0)
loadcaseForces.add([force2])
print("BCs in LoadCase Forces", loadcaseForces.name, ":")
print("	", loadcaseForces.loads)

# Crating a load case of type 'BUCKLING_LINEAR'
# for buckling load cases, the linkedLoadCase should be set to a Linear Static load case.
loadcaseBuckling = inspire.LoadCase(name="Buckling 1", type='BUCKLING_LINEAR', linkedLoadCase=loadcaseForces)
# we can det mode for buckling load cases
loadcaseBuckling.modes =5

# Crating a load case of type 'MODAL'
# for Modal load cases, the linkedLoadCase can  be set to a Linear Static load case, optionally it can be None
loadcaseModal = inspire.LoadCase(name="Modal 1", type='MODAL', linkedLoadCase=None)
# we can det mode for Modal load cases
loadcaseModal.modes =5

# Crating a load case of type 'PRESTRESS_MODAL'
# for prestress Modal load cases, the linkedLoadCase should be set to a Linear Static load case.
prestressModal = inspire.LoadCase(name="Modal Prestress 1", type='PRESTRESS_MODAL', linkedLoadCase=loadcaseForces)
# we can det mode for  prestress Modal load cases
prestressModal.modes =5

inspire.fitView()
updatePosition(m44)#

Sets the design space positions of all the inspire parts to their position in the current analysis frame.

setSystem(system)#

Associate system to a boundary condition.

Parameters:

system (System) – System tp associate with boundary condition.

Example

from hwx import inspire
model = inspire.newModel()

# Alternatively, you can get an existing model
# model = inspire.getModel()

model.createSolidBlock(x=0.5, y=0.5, z=0.5)
origin = model.getFeatures(type="FeaturePoint")[0]
axis = model.getFeatures(type="FeatureLinear")[0]
plane = model.getFeatures(type="FeaturePlanar")[0]

# Creating a reference system along a surface using origin, axis and plane.
inspire.geometry.referenceSystem(creationMethod="AT_VERTEX", origin=origin,
                                type=True,
                                firstAxis="Y", firstAxisValue=axis,
                                flipFirstAxis=False,
                                secondPlane="XZ", secondPlaneValue=plane,
                                flipSecondPlane=True,
                                orthoLock=True)

print("Reference System is created at vertex.")
# creating a BoundaryCondition Force
face = model.getFeatures(type="FeaturePlanar")[0]
force = inspire.Force(features=face, magnitude=10.0, loadCase='current')
# Query the system from the model
system = model.getChild(type="System")
# Set the system to the force
force.setSystem(system)

inspire.orientView(direction="isometric")
property bearing#

Returns the bearing of the boundary condition.

property traction#

Returns the traction of the boundary condition.