Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][Add]Add forward analysis of control arm example #642

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ PaddleScience 是一个基于深度学习框架 PaddlePaddle 开发的科学计
| 受力分析 | [3D 连接件变形](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/bracket) | 机理驱动 | MLP | 无监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/bracket/bracket_dataset.tar) | [Tutorial](https://docs.nvidia.com/deeplearning/modulus/modulus-v2209/user_guide/foundational/linear_elasticity.html) |
| 受力分析 | [结构震动模拟](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/phylstm) | 机理驱动 | PhyLSTM | 监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat) | [Paper](https://arxiv.org/abs/2002.10253) |
| 受力分析 | [2D 弹塑性结构](https://paddlescience-docs.readthedocs.io/zh/examples/epnn.md) | 机理驱动 | EPNN | 无监督学习 | [Train Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/epnn/dstate-16-plas.dat)<br>[Eval Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/epnn/dstress-16-plas.dat) | [Paper](https://arxiv.org/abs/2204.12088) |
| 受力分析和逆问题 | [3D 汽车控制臂变形](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/control_arm.md) | 机理驱动 | MLP | 无监督学习 | - | - |
| 拓扑优化 | [2D 拓扑优化](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/topopt.md) | 数据驱动 | TopOptNN | 监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/topopt/top_dataset.h5) | [Paper](https://arxiv.org/pdf/1709.09578) |

<br>
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
| 受力分析 | [3D 连接件变形](./zh/examples/bracket.md) | 机理驱动 | MLP | 无监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/bracket/bracket_dataset.tar) | [Tutorial](https://docs.nvidia.com/deeplearning/modulus/modulus-v2209/user_guide/foundational/linear_elasticity.html) |
| 受力分析 | [结构震动模拟](./zh/examples/phylstm.md) | 机理驱动 | PhyLSTM | 监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat) | [Paper](https://arxiv.org/abs/2002.10253) |
| 受力分析 | [2D 弹塑性结构](./zh/examples/epnn.md) | 机理驱动 | EPNN | 无监督学习 | [Train Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/epnn/dstate-16-plas.dat)<br>[Eval Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/epnn/dstress-16-plas.dat) | [Paper](https://arxiv.org/abs/2204.12088) |
| 受力分析和逆问题 | [3D 汽车控制臂变形](./zh/examples/control_arm.md) | 机理驱动 | MLP | 无监督学习 | - | - |
| 拓扑优化 | [2D 拓扑优化](./zh/examples/topopt.md) | 数据驱动 | TopOptNN | 监督学习 | [Data](https://paddle-org.bj.bcebos.com/paddlescience/datasets/topopt/top_dataset.h5) | [Paper](https://arxiv.org/pdf/1709.09578) |

<br>
Expand Down
521 changes: 521 additions & 0 deletions docs/zh/examples/control_arm.md

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions examples/control_arm/conf/forward_analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
hydra:
run:
# dynamic output directory according to running time and override name
dir: outputs_control_arm/forward/${now:%Y-%m-%d}/${now:%H-%M-%S}/${hydra.job.override_dirname}
job:
name: ${mode} # name of logfile
chdir: false # keep current working direcotry unchaned
config:
override_dirname:
exclude_keys:
- TRAIN.checkpoint_path
- TRAIN.pretrained_model_path
- EVAL.pretrained_model_path
- mode
- output_dir
- log_freq
sweep:
# output directory for multirun
dir: ${hydra.run.dir}
subdir: ./

# general settings
mode: train # running mode: train/eval
seed: 2023
output_dir: ${hydra:run.dir}
log_freq: 100

# set working condition
NU: 0.3
E: 1
# T: [0, 0, 0.0025] # +Z axis
T: [-0.0025, 0, 0] # -X axis

# set geometry file path
GEOM_PATH: ./datasets/control_arm.stl

# set geometry parameter
CIRCLE_LEFT_CENTER_XY: [-4.4, 0]
CIRCLE_LEFT_RADIUS: 1.65
CIRCLE_RIGHT_CENTER_XZ: [15.8, 0]
CIRCLE_RIGHT_RADIUS: 2.21

# model settings
MODEL:
disp_net:
input_keys: ["x", "y", "z"]
output_keys: ["u", "v", "w"]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true
stress_net:
input_keys: ["x", "y", "z"]
output_keys: ["sigma_xx", "sigma_yy", "sigma_zz", "sigma_xy", "sigma_xz", "sigma_yz"]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true

# training settings
TRAIN:
epochs: 2000
iters_per_epoch: 1000
save_freq: 100
eval_freq: 100
eval_during_train: false
eval_with_no_grad: false
lr_scheduler:
epochs: ${TRAIN.epochs}
iters_per_epoch: ${TRAIN.iters_per_epoch}
learning_rate: 1.0e-4
gamma: 0.95
decay_steps: 15000
by_epoch: false
batch_size:
arm_left: 128
arm_right: 256
arm_surface: 4096
arm_interior: 2048
visualizer_vtu: 100000
weight:
arm_right: {"u": 1, "v": 1, "w": 1}
pretrained_model_path: null
checkpoint_path: null

# evaluation settings
EVAL:
eval_with_no_grad: true
pretrained_model_path: null
101 changes: 101 additions & 0 deletions examples/control_arm/conf/inverse_parameter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
hydra:
run:
# dynamic output directory according to running time and override name
dir: outputs_control_arm/inverse/${now:%Y-%m-%d}/${now:%H-%M-%S}/${hydra.job.override_dirname}
job:
name: ${mode} # name of logfile
chdir: false # keep current working direcotry unchaned
config:
override_dirname:
exclude_keys:
- TRAIN.checkpoint_path
- TRAIN.pretrained_model_path
- EVAL.pretrained_model_path
- mode
- output_dir
- log_freq
sweep:
# output directory for multirun
dir: ${hydra.run.dir}
subdir: ./

# general settings
mode: train # running mode: train/eval
seed: 2023
output_dir: ${hydra:run.dir}
log_freq: 100

# set working condition
NU: 0.3
E: 1

# set geometry file path
GEOM_PATH: ./datasets/control_arm.stl

# set geometry parameter
CIRCLE_LEFT_CENTER_XY: [-4.4, 0]
CIRCLE_LEFT_RADIUS: 1.65
CIRCLE_RIGHT_CENTER_XZ: [15.8, 0]
CIRCLE_RIGHT_RADIUS: 2.21

# model settings
MODEL:
disp_net:
input_keys: ["x", "y", "z"]
output_keys: ["u", "v", "w"]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true
stress_net:
input_keys: ["x", "y", "z"]
output_keys: ["sigma_xx", "sigma_yy", "sigma_zz", "sigma_xy", "sigma_xz", "sigma_yz"]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true
inverse_lambda_net:
input_keys: ["x", "y", "z"]
output_keys: ["lambda_",]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true
inverse_mu_net:
input_keys: ["x", "y", "z"]
output_keys: ["mu",]
num_layers: 6
hidden_size: 512
activation: "silu"
weight_norm: true

# training settings
TRAIN:
epochs: 100
iters_per_epoch: 100
save_freq: 1
eval_freq: 1
eval_during_train: true
eval_with_no_grad: false
lr_scheduler:
epochs: ${TRAIN.epochs}
iters_per_epoch: ${TRAIN.iters_per_epoch}
learning_rate: 1.0e-4
gamma: 0.95
decay_steps: 100
by_epoch: false
batch_size:
arm_interior: 2000
visualizer_vtu: 100000
pretrained_model_path: null
checkpoint_path: null

# evaluation settings
EVAL:
pretrained_model_path: null
eval_with_no_grad: true
total_size:
validator: 20000
batch_size:
validator: 1024
visualizer_vtu: 100000
Loading