Esempio n. 1
0
# Structure

mdl = Structure(name='mesh_planar', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl,
                                     mesh_type='ShellElement',
                                     layers=['elset_mesh', 'elset_plates'])
rhino.add_nodes_elements_from_layers(mdl,
                                     line_type='TrussElement',
                                     layers=['elset_tie'])

# Sets

rhino.add_sets_from_layers(mdl, layers=['nset_pin', 'nset_roller'])

# Materials

mdl.add([
    Concrete(name='mat_concrete', fck=50),
    Steel(name='mat_steel', fy=460),
])

# Sections

mdl.add([
    ShellSection(name='sec_planar', t=0.050),
    TrussSection(name='sec_tie', A=0.0001),
])
Esempio n. 2
0
import rhinoscriptsyntax as rs

# Author(s): Andrew Liew (github.com/andrewliew)

# Structure

mdl = Structure(name='block_tets', path='C:/Temp/')

# Tetrahedrons

mesh = rs.ObjectsByLayer('base_mesh')[0]
rhino.add_tets_from_mesh(mdl, name='elset_tets', mesh=mesh, volume=10**(-4))

# Sets

rhino.add_sets_from_layers(mdl, layers=['nset_base', 'nset_top'])

# Materials

mdl.add(ElasticIsotropic(name='mat_elastic', E=10 * 10**9, v=0.3, p=1))

# Sections

mdl.add(SolidSection(name='sec_solid'))

# Properties

mdl.add(
    Properties(name='ep_tets',
               material='mat_elastic',
               section='sec_solid',
Esempio n. 3
0
__license__   = 'MIT License'
__email__     = '*****@*****.**'


# Structure

mdl = Structure(name='beam_frame', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers='elset_lines')

# Sets

layers = ['nset_pins', 'nset_load_v', 'nset_load_h', 'nset_rollers', 'elset_top']
rhino.add_sets_from_layers(mdl, layers=layers)

# Materials

mdl.add_material(Steel(name='mat_steel'))

# Sections

mdl.add_section(PipeSection(name='sec_pipe', r=0.100, t=0.005))

# Properties

ep = Properties(name='ep', material='mat_steel', section='sec_pipe', elsets='elset_lines')
mdl.add_element_properties(ep)

# Displacements
Esempio n. 4
0
# Structure

mdl = Structure(name='beam_simple', path='C:/Temp/')

# Elements

network = rhino.network_from_lines(layer='elset_lines')
mdl.add_nodes_elements_from_network(network=network,
                                    element_type='BeamElement',
                                    elset='elset_lines',
                                    axes={'ex': [0, -1, 0]})

# Sets

rhino.add_sets_from_layers(mdl,
                           layers=['nset_left', 'nset_right', 'nset_weights'])

# Materials

mdl.add(ElasticIsotropic(name='mat_elastic', E=20 * 10**9, v=0.3, p=1500))

# Sections

_, ekeys, L, Lt = rhino.ordered_network(mdl,
                                        network=network,
                                        layer='nset_left')

for i, Li in zip(ekeys, L):
    ri = (1 + Li / Lt) * 0.020
    sname = 'sec_{0}'.format(i)
    mdl.add(CircularSection(name=sname, r=ri))
# Francesco Ranaudo (github.com/nefelogeta)
# Andrew Liew (github.com/andrewliew)


# Structure

mdl = Structure(name='mesh_modal_from_mesh', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_concrete', pA=100)
rhino.add_nodes_elements_from_layers(mdl, mesh_type='MassElement', layers='elset_mass',pA=1000)

# Sets

rhino.add_sets_from_layers(mdl, layers='nset_pins')

# Materials

mdl.add(ElasticIsotropic(name='mat_concrete', E=40*10**9, v=0.2, p=2400))

# Sections

mdl.add([ShellSection(name='sec_concrete', t=0.250),
        MassSection(name='sec_mass')])

# Properties

mdl.add([Properties(name='ep_concrete', material='mat_concrete', section='sec_concrete', elset='elset_concrete'),
        Properties(name='ep_mass', section='sec_mass', elset='elset_mass')])
Esempio n. 6
0
__copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich'
__license__   = 'MIT License'
__email__     = '*****@*****.**'


# Structure 

mdl = Structure(name='mesh_mould', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers=['elset_wall', 'elset_plinth'])

# Sets

rhino.add_sets_from_layers(mdl, layers=['nset_fixed'])

# Materials

mdl.add_materials([
    Concrete(name='mat_concrete', fck=40),
    Steel(name='mat_rebar', fy=500, id='r')])

# Sections

mdl.add_sections([
    ShellSection(name='sec_wall', t=0.150),
    ShellSection(name='sec_plinth', t=0.300)])

# Properties
Esempio n. 7
0
# Author(s): Tomas Mendez Echenagucia (github.com/tmsmendez)

# Structure

mdl = Structure(name='meshpillow_from_rhino', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl,
                                     mesh_type='ShellElement',
                                     layers=['mesh'])

# Sets

rhino.add_sets_from_layers(mdl, layers=['supports', 'lpts1', 'lpts2'])

# Materials

mdl.add(ElasticIsotropic(name='mat_elastic', E=20 * 10**9, v=0.3, p=1500))

# Sections

mdl.add(ShellSection(name='sec_shell', t=0.050))

# Properties

mdl.add(
    Properties(name='ep_shell',
               material='mat_elastic',
               section='sec_shell',
Esempio n. 8
0

# Author(s): Andrew Liew (github.com/andrewliew)


# Structure

mdl = Structure(name='beam_shell_rhino', path='C:/Temp/')

# Elements
layers = ['beams', 'shell']
rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', mesh_type='ShellElement', layers=layers)

# Sets

rhino.add_sets_from_layers(mdl, layers=['supports'])

# Materials

mdl.add(ElasticIsotropic(name='mat_1', E=20*10**9, v=0.3, p=1500))
mdl.add(ElasticIsotropic(name='mat_2', E=30*10**9, v=0.3, p=1500))

# Sections

mdl.add(RectangularSection(name='bsec', b=0.1, h=.2))
mdl.add(Properties(name='ep_1', material='mat_1', section='bsec', elsets=['beams']))

mdl.add(ShellSection(name='ssec', t=.1))
mdl.add(Properties(name='ep_2', material='mat_2', section='ssec', elsets=['shell']))

# Displacements
mdl = Structure(name='spring_simple', path='C:/Temp/')

# Elements

springs = [
    'spring_bot_left', 'spring_bot_right', 'spring_top_left',
    'spring_top_right'
]
rhino.add_nodes_elements_from_layers(mdl,
                                     line_type='SpringElement',
                                     layers=springs)

# Sets

rhino.add_sets_from_layers(mdl, layers=['pins', 'middle'])

# Sections

mdl.add_section(
    SpringSection(name='spring_elastic', stiffness={'axial': 10000}))
mdl.add_section(SpringSection(name='spring_soft', stiffness={'axial': 1000}))

# Properties

mdl.add_element_properties([
    Properties(name='ep_bl',
               section='spring_elastic',
               elsets='spring_bot_left'),
    Properties(name='ep_br', section='spring_soft', elsets='spring_bot_right'),
    Properties(name='ep_tl',
Esempio n. 10
0
mdl = Structure(name='beam_tree', path='C:/Temp/')

# Elements

layers = [
    'struts_mushroom', 'struts_bamboo', 'joints_mushroom', 'joints_bamboo',
    'joints_grid'
]
rhino.add_nodes_elements_from_layers(mdl,
                                     line_type='BeamElement',
                                     layers=layers)

# Sets

rhino.add_sets_from_layers(mdl, layers=['supports_bot', 'supports_top'])

# Sections

mdl.add_sections([
    TrapezoidalSection(name='sec_mushroom', b1=0.001, b2=0.150, h=0.225),
    RectangularSection(name='sec_bamboo', b=0.020, h=0.100),
    RectangularSection(name='sec_joints', b=0.020, h=0.075)
])

# Materials

fm = [i * 10000 for i in [5, 9, 12, 14, 16, 18, 19, 20, 21, 22]]
em = [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09]
mdl.add_materials([
    ElasticIsotropic(name='mat_bamboo', E=20 * 10**9, v=0.35, p=1100),
Esempio n. 11
0
__license__ = 'MIT License'
__email__ = '*****@*****.**'

# Structure

mdl = Structure(name='mesh_principal', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl,
                                     mesh_type='ShellElement',
                                     layers='elset_mesh')

# Sets

rhino.add_sets_from_layers(mdl, layers=['nset_corners'])

# Materials

mdl.add_material(
    ElasticIsotropic(name='mat_elastic', E=100 * 10**9, v=0.3, p=1000))

# Sections

mdl.add_section(ShellSection(name='sec_plate', t=0.010))

# Properties

ep = Properties(name='ep_plate',
                material='mat_elastic',
                section='sec_plate',
Esempio n. 12
0
beams = [i for i in rs.LayerNames() if i[:2] in ['BX', 'BY']]
for beam in beams:
    network = rhino.network_from_lines(rs.ObjectsByLayer(beam))
    axes = {'ex': [0, 1, 0]} if 'X' in beam else {'ex': [1, 0, 0]}
    mdl.add_nodes_elements_from_network(network=network,
                                        element_type='BeamElement',
                                        elset=beam,
                                        axes=axes)
    xyzs = [network.vertex_coordinates(i) for i in network.leaves()]
    ends = [mdl.check_node_exists(i) for i in xyzs]
    mdl.add_set('{0}_ends'.format(beam), type='node', selection=ends)

# Sets

rhino.add_sets_from_layers(mdl, layers=['lift_points'] + beams)

# Materials

mdl.add_material(
    ElasticIsotropic(name='mat_elastic', E=5 * 10**9, v=0.3, p=1000))

# Sections

mdl.add_section(RectangularSection(name='sec_rectangular', h=0.005, b=0.005))

# Properties

ep = Properties(name='ep',
                material='mat_elastic',
                section='sec_rectangular',
Esempio n. 13
0
mdl = Structure(name='block_tets', path='C:/Temp/')

# Tetrahedrons

mesh = rs.ObjectsByLayer('mesh')[0]
rhino.add_tets_from_mesh(mdl,
                         name='elset_tets',
                         mesh=mesh,
                         draw_tets=0,
                         layer='tets',
                         volume=None)

# Sets

rhino.add_sets_from_layers(mdl, layers=['base', 'top'])

# Materials

mdl.add_material(
    ElasticIsotropic(name='mat_elastic', E=100 * 10**9, v=0.3, p=1))

# Sections

mdl.add_section(SolidSection(name='sec_solid'))

# Properties

mdl.add_element_properties(
    Properties(name='ep_tets',
               material='mat_elastic',
Esempio n. 14
0
    rs.ObjectName(i, '_{0}'.format(json.dumps({'ex': ex})))
#-------------------------------------------------------------------------------

# Structure
# For the path in the command below, select the location you prefer
mdl = Structure(name='Nexorades', path='C:/TEMP/')
#-------------------------------------------------------------------------------

# Elements
rhino.add_nodes_elements_from_layers(mdl,
                                     line_type='BeamElement',
                                     layers='elset_beams')
#-------------------------------------------------------------------------------

# Sets
rhino.add_sets_from_layers(mdl, layers=['nset_support', 'nset_load'])
#-------------------------------------------------------------------------------

# Materials
mdl.add(ElasticIsotropic(name='mat_elastic', E=11000000, v=10**(-5), p=0.01))
#-------------------------------------------------------------------------------

# Sections
mdl.add(CircularSection(name='sec_beam', r=0.2))
#-------------------------------------------------------------------------------

# Properties
mdl.add(
    Properties(name='ep_beam',
               material='mat_elastic',
               section='sec_beam',
Esempio n. 15
0
# Author(s): Andrew Liew (github.com/andrewliew)

# Structure

mdl = Structure(name='mesh_strip', path='C:/Temp/')

# Elements

rhino.add_nodes_elements_from_layers(mdl,
                                     mesh_type='ShellElement',
                                     layers='elset_mesh')

# Sets

rhino.add_sets_from_layers(mdl,
                           layers=['nset_left', 'nset_right', 'nset_middle'])

# Materials

mdl.add(ElasticIsotropic(name='mat_elastic', E=75 * 10**9, v=0.3, p=2700))

# Sections

mdl.add(ShellSection(name='sec_plate', t=0.001))

# Properties

mdl.add(
    Properties(name='ep_plate',
               material='mat_elastic',
               section='sec_plate',
from compas_fea.structure import PinnedDisplacement
from compas_fea.structure import GravityLoad
from compas_fea.structure import PointLoad
from compas_fea.structure import AreaLoad
from compas_fea.structure import GeneralStep
from compas_fea.structure import BucklingStep
from compas_fea.structure import ModalStep

# Author(s): Andrew Liew (github.com/andrewliew)

mdl = Structure(name='example_shell', path='C:/Temp/')

rhino.add_nodes_elements_from_layers(mdl,
                                     mesh_type='ShellElement',
                                     layers='mesh')
rhino.add_sets_from_layers(mdl, layers=['loads', 'supports', 'area'])

#print(mdl.sets['loads'])
#print(mdl.sets['supports'])
#print(mdl.sets['area'])

mdl.add(Concrete(name='concrete', fck=50))

#print(mdl.materials['concrete'])

mdl.add(ShellSection(name='shell', t=0.100))

#print(mdl.sections['shell'])

mdl.add(
    ElementProperties(name='ep',
Esempio n. 17
0
__email__ = '*****@*****.**'

# Structure

mdl = Structure(name='truss_frame', path='C:/Temp/')

# Elements

layers = ['elset_main', 'elset_diag', 'elset_stays']
rhino.add_nodes_elements_from_layers(mdl,
                                     line_type='TrussElement',
                                     layers=layers)

# Sets

rhino.add_sets_from_layers(mdl,
                           layers=['nset_pins', 'nset_load_v', 'nset_load_h'])

# Materials

mdl.add_material(Steel(name='mat_steel', fy=355))

# Sections

mdl.add_sections([
    TrussSection(name='sec_main', A=0.0008),
    TrussSection(name='sec_diag', A=0.0005),
    TrussSection(name='sec_stays', A=0.0001)
])

# Properties