Skip to main content
Milcapy uses Python enumerations to provide type-safe, readable parameter values. You can use either the enum values or their string equivalents in most API calls.

BeamTheoriesType

Specifies the beam theory used for frame element formulation.
from milcapy.utils.types import BeamTheoriesType

Values

TIMOSHENKO
BeamTheoriesType.TIMOSHENKO
Timoshenko beam theory - Accounts for shear deformation. More accurate for short, deep beams.String equivalent: 'TIMOSHENKO'
EULER_BERNOULLI
BeamTheoriesType.EULER_BERNOULLI
Euler-Bernoulli beam theory - Ignores shear deformation. Suitable for slender beams.String equivalent: 'EULER_BERNOULLI'

Usage

# Using enum
model.add_member(1, 1, 2, 'Section1', beam_theory=BeamTheoriesType.TIMOSHENKO)

# Using string (equivalent)
model.add_member(1, 1, 2, 'Section1', beam_theory='TIMOSHENKO')

CoordinateSystemType

Specifies whether to use global or local coordinate systems.
from milcapy.utils.types import CoordinateSystemType

Values

GLOBAL
CoordinateSystemType.GLOBAL
Global coordinate system - Fixed reference frame for entire model.String equivalent: 'GLOBAL'
LOCAL
CoordinateSystemType.LOCAL
Local coordinate system - Element-specific or node-specific reference frame.String equivalent: 'LOCAL'

Usage

# Apply load in global coordinates
model.add_point_load(1, 'Dead', fx=10, CSys=CoordinateSystemType.GLOBAL)

# Apply load in local coordinates
model.add_point_load(2, 'Dead', fx=10, CSys='LOCAL')

DirectionType

Specifies load direction in global or local coordinate systems.
from milcapy.utils.types import DirectionType

Local Directions

LOCAL_1
DirectionType.LOCAL_1
Local axial direction along the member.String equivalent: 'LOCAL_1'
LOCAL_2
DirectionType.LOCAL_2
Local shear direction (perpendicular to member axis).String equivalent: 'LOCAL_2'
LOCAL_3
DirectionType.LOCAL_3
Local moment direction.String equivalent: 'LOCAL_3'

Global Directions

X
DirectionType.X
Global X direction.String equivalent: 'X'
Y
DirectionType.Y
Global Y direction.String equivalent: 'Y'
X_PROJ
DirectionType.X_PROJ
Projected in global X direction.String equivalent: 'X_PROJ'
Y_PROJ
DirectionType.Y_PROJ
Projected in global Y direction.String equivalent: 'Y_PROJ'
GRAVITY
DirectionType.GRAVITY
Gravity direction (typically -Y).String equivalent: 'GRAVITY'
GRAVITY_PROJ
DirectionType.GRAVITY_PROJ
Projected gravity direction.String equivalent: 'GRAVITY_PROJ'
MOMENT
DirectionType.MOMENT
Moment direction.String equivalent: 'MOMENT'

Usage

# Distributed load in local shear direction
model.add_distributed_load(
    1, 'Dead', 
    load_start=-10, 
    load_end=-10,
    direction=DirectionType.LOCAL_2
)

# Distributed load in gravity direction
model.add_distributed_load(
    2, 'Dead',
    load_start=-5,
    load_end=-5, 
    direction='GRAVITY'
)

StateType

Specifies the active/inactive state of load patterns.
from milcapy.utils.types import StateType

Values

ACTIVE
StateType.ACTIVE
Load pattern is active and will be included in analysis.String equivalent: 'ACTIVE'
INACTIVE
StateType.INACTIVE
Load pattern is inactive and will be excluded from analysis.String equivalent: 'INACTIVE'

Usage

# Create active load pattern
model.add_load_pattern('Dead', state=StateType.ACTIVE)

# Create inactive pattern (to activate later)
model.add_load_pattern('Live', state='INACTIVE')

# Change state
model.set_state_load_pattern('Live', StateType.ACTIVE)

LoadType

Specifies the type of distributed load.
from milcapy.utils.types import LoadType

Values

FORCE
LoadType.FORCE
Force per unit length (e.g., kN/m).String equivalent: 'FORCE'
MOMENT
LoadType.MOMENT
Moment per unit length (e.g., kN·m/m).String equivalent: 'MOMENT'

Usage

# Force distributed load
model.add_distributed_load(
    1, 'Dead',
    load_start=-10,
    load_end=-10,
    load_type=LoadType.FORCE
)

FieldType

Specifies field types for membrane/shell element results.
from milcapy.utils.types import FieldType

Stress Components

SX
FieldType.SX
Normal stress in X direction.String equivalent: 'SX'
SY
FieldType.SY
Normal stress in Y direction.String equivalent: 'SY'
SXY
FieldType.SXY
Shear stress in XY plane.String equivalent: 'SXY'

Strain Components

EX
FieldType.EX
Normal strain in X direction.String equivalent: 'EX'
EY
FieldType.EY
Normal strain in Y direction.String equivalent: 'EY'
EXY
FieldType.EXY
Shear strain in XY plane.String equivalent: 'EXY'

Displacement Components

UX
FieldType.UX
Displacement in X direction.String equivalent: 'UX'
UY
FieldType.UY
Displacement in Y direction.String equivalent: 'UY'
UMAG
FieldType.UMAG
Displacement magnitude (resultant).String equivalent: 'UMAG'

ConstitutiveModelType

Specifies the constitutive model for 2D finite elements.
from milcapy.utils.types import ConstitutiveModelType

Values

PLANE_STRESS
ConstitutiveModelType.PLANE_STRESS
Plane stress assumption - Stress in out-of-plane direction is zero. Suitable for thin plates.String equivalent: 'PLANE_STRESS'
PLANE_STRAIN
ConstitutiveModelType.PLANE_STRAIN
Plane strain assumption - Strain in out-of-plane direction is zero. Suitable for long structures.String equivalent: 'PLANE_STRAIN'

Usage

# CST element with plane stress
model.add_cst(
    1, 1, 2, 3, 
    'Shell1',
    state=ConstitutiveModelType.PLANE_STRESS
)

# CST element with plane strain
model.add_cst(
    2, 4, 5, 6,
    'Shell1', 
    state='PLANE_STRAIN'
)

IntegrationType

Specifies the numerical integration scheme for finite elements.
from milcapy.utils.types import IntegrationType

Values

COMPLETE
IntegrationType.COMPLETE
Complete (full) integration - More accurate but can cause locking in some elements.String equivalent: 'COMPLETE'
REDUCED
IntegrationType.REDUCED
Reduced integration - Uses fewer integration points to avoid locking.String equivalent: 'REDUCED'

Usage

# Q8 element with complete integration
model.add_membrane_q8(
    1, 1, 2, 3, 4,
    'Shell1',
    integration=IntegrationType.COMPLETE
)

# Q8 element with reduced integration
model.add_membrane_q8(
    2, 5, 6, 7, 8,
    'Shell1',
    integration='REDUCED'
)

Example: Using Multiple Enums

import milcapy as milca
from milcapy.utils.types import (
    BeamTheoriesType,
    CoordinateSystemType,
    DirectionType,
    StateType,
    LoadType,
    ConstitutiveModelType
)

model = milca.SystemMilcaModel()

# Create member with Timoshenko theory
model.add_member(
    1, 1, 2, 'Beam',
    beam_theory=BeamTheoriesType.TIMOSHENKO
)

# Create active load pattern
model.add_load_pattern(
    'Dead Load',
    state=StateType.ACTIVE
)

# Add distributed load in local coordinates
model.add_distributed_load(
    member_id=1,
    load_pattern_name='Dead Load',
    load_start=-10,
    load_end=-10,
    CSys=CoordinateSystemType.LOCAL,
    direction=DirectionType.LOCAL_2,
    load_type=LoadType.FORCE
)

# Add CST element with plane stress
model.add_cst(
    1, 1, 2, 3,
    'Shell',
    state=ConstitutiveModelType.PLANE_STRESS
)

Build docs developers (and LLMs) love