Skip to content

Instantly share code, notes, and snippets.

@shkiefer
Created January 20, 2022 07:00
Show Gist options
  • Save shkiefer/3e7ea4521b4f424db22c53e543bc3737 to your computer and use it in GitHub Desktop.
Save shkiefer/3e7ea4521b4f424db22c53e543bc3737 to your computer and use it in GitHub Desktop.
app.layout = dbc.Container([
html.H1('PyAnsys MAPDL in a Dash App', className="mt-3"),
html.P('Design your solar array! (not really, dont use these assumed properties)'),
dbc.Row([
dbc.Col([
dbc.Form([
dbc.Label('Number of Panels', html_for=f'{APP_ID}_n_panels_input'),
dbc.Input(id=f'{APP_ID}_n_panels_input', type="number", min=0, max=10, step=1, value=2)
])
]),
dbc.Col([
dbc.Form([
dbc.Label('Panel Width (in)', html_for=f'{APP_ID}_w_panel_input'),
dbc.Input(id=f'{APP_ID}_w_panel_input', type="number", min=1., value=20, step='any'),
dbc.FormText("Y direction"),
])
]),
dbc.Col([
dbc.Form([
dbc.Label('Panel Height (in)', html_for=f'{APP_ID}_h_panel_input'),
dbc.Input(id=f'{APP_ID}_h_panel_input', type="number", min=1., value=20, step='any'),
dbc.FormText("X / deployment direction")
])
]),
dbc.Col([
dbc.Form([
dbc.Label('Panel Core Thickness (in)', html_for=f'{APP_ID}_tc_input'),
dbc.Input(id=f'{APP_ID}_tc_input', type="number", min=.125, value=.25, step='any'),
])
]),
]),
dbc.ButtonGroup([
dbc.Button('Hide / Show Additional Options', id=f'{APP_ID}_options_collapse_button', color='secondary'),
dbc.Button('Solve', id=f'{APP_ID}_solve_button', color='primary'),
]),
dbc.Collapse(
id=f'{APP_ID}_options_collapse',
is_open=False,
children=[
dbc.Row([
dbc.Col([
dbc.Form([
html.Div([
dbc.Label('Non Structural Mass (lbs/in^2)', html_for=f'{APP_ID}_nsm_input'),
dbc.Input(id=f'{APP_ID}_nsm_input', type="number", min=0., value=0.002, step='any'),
dbc.FormText("Photo-voltaics, harness, etc"),
], className="mb-3",
)
]),
dbc.Form([
html.Div([
dbc.Label('Facesheet Thickness (in)', html_for=f'{APP_ID}_tfs_input'),
dbc.Input(id=f'{APP_ID}_tfs_input', type="number", min=0.01, value=0.030, step='any'),
dbc.FormText("per skin, 2 skins per panel")
], className="mb-3",
)
])
]),
dbc.Col([
dbc.Form([
html.Div([
dbc.Label('Hinge Effective Rotational Stiffness (in-lbs/rad)', html_for=f'{APP_ID}_k_hinge_input'),
dbc.Input(id=f'{APP_ID}_k_hinge_input', type="number", min=1000, value=10e3, step=1000),
dbc.FormText("Stiffness about pin axis"),
], className="mb-3",
)
]),
dbc.Form([
html.Div([
dbc.Label('Panel Separation (in)', html_for=f'{APP_ID}_dx_panel_input'),
dbc.Input(id=f'{APP_ID}_dx_panel_input', type="number", min=0., value=2., step='any'),
], className="mb-3",
)
])
]),
dbc.Col([
dbc.Form([
html.Div([
dbc.Label('Displacement Scale Factor', html_for=f'{APP_ID}_scale_input'),
dbc.Input(id=f'{APP_ID}_scale_input', type="number", value=5.),
], className="mb-3",
)
]),
dbc.Form([
html.Div([
dbc.Label('Show Edges', html_for=f'{APP_ID}_show_edges_switch'),
dbc.Switch(
id=f'{APP_ID}_show_edges_switch',
label='Show Edges',
value=True,
),
], className="mb-3",
)
])
]),
], className="mt-3",
)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment