JinshuaiBai / PINN_Comp_Mech

PINN program for computational mechanics
87 stars 22 forks source link

Boundary condition #2

Open renjiahaozju opened 3 months ago

renjiahaozju commented 3 months ago

I have some trouble about how is u(x=0)=0 implemented? If I want u(x=1)=0, or if I want u(x=0) is freedom, how to achieve?

JinshuaiBai commented 3 months ago

For your question:

  1. We apply the hard boundary condition technique in PINN; that is, we let the output of FNN as intermediate output and multiply it with x ( u=FNN(x, y)*x ). By doing so, the boundary condition u(x=0)=0 can be naturally satisfied without introducing additional loss terms to impose this condition.
  2. If you want to impost u(x=1)=0, you can let ( u = FNN(x, y)*(x-1) ). Hope these can answer your questions.
renjiahaozju commented 3 months ago

Thanks for your patient answer!

A474852023 commented 1 month ago

For your question:

  1. We apply the hard boundary condition technique in PINN; that is, we let the output of FNN as intermediate output and multiply it with x ( u=FNN(x, y)*x ). By doing so, the boundary condition u(x=0)=0 can be naturally satisfied without introducing additional loss terms to impose this condition.
  2. If you want to impost u(x=1)=0, you can let ( u = FNN(x, y)*(x-1) ). Hope these can answer your questions.

Hi, for the boundary condition, if I want to set both u(x=0)=0 and u(x=1)=0, can I just make u=FNN(x, y)x (x-1)? Also I would like to ask how the FEA.mat file is organized?

JinshuaiBai commented 1 month ago

For your question:

  1. We apply the hard boundary condition technique in PINN; that is, we let the output of FNN as intermediate output and multiply it with x ( u=FNN(x, y)*x ). By doing so, the boundary condition u(x=0)=0 can be naturally satisfied without introducing additional loss terms to impose this condition.
  2. If you want to impost u(x=1)=0, you can let ( u = FNN(x, y)*(x-1) ). Hope these can answer your questions.

Hi, for the boundary condition, if I want to set both u(x=0)=0 and u(x=1)=0, can I just make u=FNN(x, y)x (x-1)? Also I would like to ask how the FEA.mat file is organized?

For your questions:

  1. Yes, you can use u=FNN(x, y)x (x-1) to fix the u prediction at x=0 and x=1.
  2. The FEA.mat is used to store the reference results from the FEA. In the visualisation, the FEA node coordinate is faded into the well-trained neural networks so that you can easily compare the results of PINN with respect to the reference results.

Hope these can answer your questions.

A474852023 commented 1 month ago

Thank you very much for your reply! I would like to know in what format should I generate the FEA.mat file for my model? I would like to know what columns 'E' and 'X' in your FEA.mat represent respectively? Taking the 3D data as an example, why the shape of 'E' is (125000,3) and 'X' is (522801,3)?

JinshuaiBai commented 1 month ago

Thank you very much for your reply! I would like to know in what format should I generate the FEA.mat file for my model? I would like to know what columns 'E' and 'X' in your FEA.mat represent respectively? Taking the 3D data as an example, why the shape of 'E' is (125000,3) and 'X' is (522801,3)?

Here are the answers:

  1. Normally, I do visualisation in MATLAB (cause I am good at using MATLAB). In this case, I output the coordinates information from ABAQUS and load them into my MATLAB. The .mat file format is directly saved from MATLAB, you may use the "save" commend to save all the variables in your MATLAB.
  2. 'E' and 'X' are coordinates information, where 'X' is the coordinates of my FEA nodes and 'E' is the coordinates of my FEA element centres. In this case, you can see why the size of 'X' is larger then 'E'. Hope these can help.
JinshuaiBai commented 1 month ago

Thank you very much for your reply! I would like to know in what format should I generate the FEA.mat file for my model? I would like to know what columns 'E' and 'X' in your FEA.mat represent respectively? Taking the 3D data as an example, why the shape of 'E' is (125000,3) and 'X' is (522801,3)?

But I have to say, it is not necessary to use my way to do the visualisation. If you are more familiar with another coding language, for example, python or cpp, you can use your way. All you need to know is that the output of your neural network is already stored in .mat file and you can use it in anywhere.

A474852023 commented 1 month ago

Thank you very much for your patience!