当前位置: 首页 > news >正文

PINN求解固体力学问题——论文加代码

PINN求解固体力学问题——论文加代码

  • 1. 训练
  • 2. 可视化

论文:Physics-Informed Deep Learning and its Application in Computational Solid and Fluid Mechanics

基本问题:

在这里插入图片描述

网格:
在这里插入图片描述

1. 训练

# %load Plane_Stress_W-PINNs.py
"""
Forward Problem for Plane Stress Linear Elasticity Boundary Value Problem
Weighted-Physics-Informed Neural Networks (W-PINNs)
Author: Alexandros D.L PapadosIn this code we solve for the deformation of a material with Young's Modulus
of E = 1.0 GPA and Poisson Ratio of nu = 0.3. The deformation are represented
by u and v in the x and y directions respectively. We solve the following PDE using
W-PINNs:G[u_xx + u_yy] + G((1+nu)/(1-nu))[u_xx + v_yx] = sin(2pi*x)sin(2pi*y)G[v_xx + v_yy] + G((1+nu)/(1-nu))[v_yy + u_xy] = sin(pi*x)+ sin(2pi*y)with Dirichlet boundary conditions.The Neural Network is constructed as follows:( sigma(x,y,theta) )(  u(x,y)  )( x )                             ( sigma(x,y,theta) )                          (          )Input:            ----> Activation Layers:          .               ----> Output Layer:   (          )( y )                                     .                                     (          ).                                     (  v(x,y)  )( sigma(x,y,theta) )The final output will be [x,y,u,v,e_x,e_y], where e_x and e_y are the strains in the x and y directions
respectively.Default example is Domain I (Square Domain, [0,1]^2)
"""
import torch
import torch.nn as nn
import numpy as np
import time
import scipy.iotorch.manual_seed(123456)
np.random.seed(123456)E = 1                                       # Young's Modulus
nu = 0.3                                    # Poisson Ratio
G = ((E/(2*(1+nu))))                        # LEBVP coefficientclass Model(nn.Module):def __init__(self):super(Model, self).__init__()self.net = nn.Sequential()                                                  # Define neural networkself.net.add_module('Linear_layer_1', nn.Linear(2, 30))                     # First linear layerself.net.add_module('Tanh_layer_1', nn.Tanh())                              # First activation Layerfor num in range(2, 7):                                                     # Number of layers (2 through 7)self.net.add_module('Linear_layer_%d' % (num), nn.Linear(30, 30))       # Linear layerself.net.add_module('Tanh_layer_%d' % (num), nn.Tanh())                 # Activation Layerself.net.add_module('Linear_layer_final', nn.Linear(30, 3))                 # Output Layer# Forward Feeddef forward(self, x):return self.net(x)# Loss of PDE and BCsdef loss(self, x, x_b, b_u,b_v,epoch):y = self.net(x)                             # Interior Solutiony_b= (self.net(x_b))                        # Boundary Solutionu_b, v_b = y_b[:, 0], y_b[:, 1]             # u and v boundaryu,v = y[:,

http://www.mrgr.cn/news/92469.html

相关文章:

  • Spring Retry 实现乐观锁重试
  • 2025-02-26 学习记录--C/C++-C 库函数gets()、fgets()、strcspn()、puts()
  • Linux系统里怎么截图
  • Framework层JNI侧Binder
  • 顾客关系管理CRM思维导图模版
  • Vxe UI 根据vxe-tabs 绑定不同的值,渲染生成不同的 tabls(页签)内容
  • XXE漏洞:原理、危害与修复方法详解
  • 影响板材的热导率有哪些因素?
  • Java中的函数式编程:Lambda与Stream API实战
  • Java中的异常处理:最佳实践与常见误区
  • docker安装MongoDB
  • 操作定制万年历投屏模拟点单叫号器
  • 计算机组成与接口10
  • 用AI写游戏3——deepseek实现kotlin android studio greedy snake game 贪吃蛇游戏
  • (亲测有效)android studio gradle下载慢的解决方法
  • <网络> 网络基础3
  • 冒泡排序算法
  • 前端实现rsa加密功能
  • 【学写LibreCAD】1 LibreCAD主程序
  • 力扣-动态规划-494 目标和