# Interface Condition Coding Method

 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 12, 2022, 02:10 Interface Condition Coding Method #1 New Member   Ji-Hoon Han Join Date: Dec 2022 Posts: 1 Rep Power: 0 I am solving a magnetostatic problem using PINN. I have succeeded in solving a simple Poisson equation. However, in the analysis considering the geometry, a problem was found in which the interface condition loss did not converge. I know that the tangential component of the magnetic field strength between two media is continuous. Accordingly, the normal and tangent vectors were calculated in advance and multiplied according to the interface position. Is it correct to set the interface condition like this? Or, if you have an example considering interface conditions, please share. def physics_net_for_ic(self, xt,in_mu,nom,out_mu): x = xt[:, 0:1] t = xt[:, 1:2] with tf.GradientTape(persistent=True) as tape: tape.watch(t) tape.watch(x) xt_t = tf.concat([x,t], axis=1) out_u = self.ironmaxwell(xt_t) out_u_x = tape.gradient(out_u, x) out_u_y = tape.gradient(out_u, t) in_u = self.coilmaxwell(xt_t) in_u_x = tape.gradient(in_u, x) in_u_y = tape.gradient(in_u, t) del tape out_b_x = out_u_y out_b_y = out_u_x out_h_x = out_b_x/out_mu out_h_y = out_b_y/out_mu in_b_x = in_u_y in_b_y = in_u_x in_h_x = in_b_x/in_mu in_h_y = in_b_y/in_mu loss_b = tf.add(tf.multiply((in_b_x-out_b_x),nom),tf.multiply((in_b_y-out_b_y),(1-nom))) loss_h = tf.add(tf.multiply((in_h_x-out_h_x),(1-nom)),tf.multiply((in_h_y-out_h_y),nom))

 Tags electomagnetics, interface bc, pinn