Example #1
0
def ansys_remesh(mesh, output_path, filename, size=None):
    s = Structure()
    s.add_nodes_elements_from_mesh(mesh, 'ShellElement')
    s = areas_from_mesh(s, mesh)
    write_preprocess(output_path, filename)
    write_request_mesh_areas(s,
                             output_path,
                             filename,
                             size=size,
                             smart_size=None,
                             div=None)
    ansys_launch_process(s, output_path, filename)
    mesh = mesh_from_ansys_results(output_path)
    return mesh
Example #2
0
def ansys_remesh_3d(mesh, output_path, name, size=None, hex=False, div=None):

    s = Structure(output_path, name=name)

    s.add_nodes_elements_from_mesh(mesh, 'ShellElement')
    s = areas_from_mesh(s, mesh)
    filename = name + '.txt.'
    ansys_open_pre_process(output_path, filename)
    write_request_mesh_volume(s,
                              output_path,
                              name,
                              size=size,
                              hex=hex,
                              div=div)
    ansys_launch_process(output_path,
                         name,
                         cpus=4,
                         license='teaching',
                         delete=True)
    mesh = volmesh_from_ansys_results(output_path, name)
    return mesh
from compas_fea.structure import GravityLoad
from compas_fea.structure import GeneralStep

from compas_rhino.helpers import mesh_from_guid

# Author(s): Tomás Méndez Echenagucia (github.com/tmsmendez)

# get mesh from rhino layer ----------------------------------------------------

mesh = mesh_from_guid(Mesh, rs.ObjectsByLayer('mesh')[0])

# add shell elements from mesh -------------------------------------------------

name = 'shell_example'
s = Structure(name=name, path=compas_fea.TEMP)
shell_keys = s.add_nodes_elements_from_mesh(mesh, element_type='ShellElement')
s.add_set('shell', 'element', shell_keys)

# add supports from rhino layer-------------------------------------------------

pts = rs.ObjectsByLayer('pts')
pts = [rs.PointCoordinates(pt) for pt in pts]
nkeys = []
for pt in pts:
    nkeys.append(s.check_node_exists(pt))
s.add_set(name='support_nodes', type='NODE', selection=nkeys)
supppots = FixedDisplacement(name='supports', nodes='support_nodes')
s.add_displacement(supppots)

# add materials and sections -----------------------------------------------
E = 40 * 10**9
Example #4
0
from compas_fea.structure import ShellSection
from compas_fea.structure import Structure

import compas

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

# Structure

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

# Elements

mesh = Mesh.from_obj(compas.get('quadmesh.obj'))
mdl.add_nodes_elements_from_mesh(mesh=mesh,
                                 element_type='ShellElement',
                                 elset='elset_concrete')

# Sets

nodes = [i for i, node in mdl.nodes.items() if node.z < 0.01]
mdl.add_set(name='nset_pins', type='node', selection=nodes)

# 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.050))