From 6deae68f120b38060479fc47855668c4225afc55 Mon Sep 17 00:00:00 2001
From: thivin
Our FastVPINNs framework is built using
- TensorFlow-v2.0( Our FastVPINNs framework is built using TensorFlow-v2.0
+ ( With the higher level of abstraction provided by the FastVPINNs
- framework, users can solve a PDE with just six API calls. Shown below
- is a minimal working example to solve the Poisson equation using the
- FastVPINNs framework. 0ze==Wt;-Sbma=6fam@{kCZpKjBFdayw@F6;F
zlY|3W-W1h0(b5pv;L%D{iaMa3Kk=TuHjNKeF;IL_N02!ttv>y2r52AD@b-JpaAu
zhOPy0`GRDHtE+3O7Fkjv!=z>`oOSlKP^u02qFDSZeKVc8FI={K2|AsR{ILgLOv7sx
zBG*^Zr};z-FL|EfF$`Z*V^}#^y1BbrnZ3h+b%Y?HA%J;dq$h~9L|{G|ZW>J*E=?=9
z_a3emR&F#vFa)N0f+z;%{f9 y q?|j
zl=K~2Cr-i&+znM-63rt?7hd9a=wqunmPK@*t|QPD9IZ^GUVr;^Vx5xA%-0>6#cJ4U
z(3_KFwx9*(bZ7Bfn??J=p_db#Z4OOBddYp)y80Ul>6hO+A&OzACMAzI%OXw7PuGkl
z+jj2dON6_0_XbGqK$m?VC~byB3!U#zgjLJCj_hWJFU*8g%kP_Ki*BOJZ~UgLU0+(8
zf3RVzR*%n^Y$c3Z_fY3CdGfucbbeh8v^J^sHMEyrk6e}LTbzeT!rk`+oeR-}`Sn+Q
z!!%}xrFlJQK#2E)m83lKM=k#6zS-2CUb$voFa1}KxHS*0P3{0AVj={s`=s1_YD?Aa
zg!k+Rc1?qRZC5;8d5ddrCcJjv-gNC^=A@@wxd<6t$?8p-w6@gfM0u#Cu)6qcw60YQ
zRNK#WerjypGrUrgob3II2&+ah)vLMTM2L6ZkPz`{e*+2DuDdAn&zXOo+YW6FHgnVM
zOnW81=+G^vr}OHB>Y{qYDuTGmU8IVQU}oV;@PH5PO`G*-EQy$%SCBxBhr`GImqEuG
zV(O6?PrDXdE3sWuG&9QvPCCB1Fg4Y-4chtICCtv%eC>WcTC;3+4=m^rRGvqBc;*k9
z&TpUd;y8lTKY&R#5my{-T~r_L%*o|xKj)8r(W3lCsc+}vRkgyc3B*qow~6AOkX~_U
z*>-M4QS42S(%WezCfkUE7-b{W<)@2L-zR6u47=%$Xl%0u+*B$N-8$0Vcga;>vR#g8
zMf!yYFz3o0fE%SUt5mECcWq@ozk$WL0mz~xw^rS@DQ_| r-Ko<~#iIvrV3et5d_
z&iMw7fEt3wwU8Ec*Y_gvVn^LUa|!%w&JK2rkgCXw(n83i>O+f*E%>%QoHzwQwXlR8
z^UWNrhp@-eD0OKYN^b8Fb%r3weassk$n`eJXopXEx;|GgmRAcurNvzv08x;TL}cz}
zQpyrzP_M7s8>H!1dBMgqgt?ujYtL8riiEqEHSC9QM#load the geometry
-domain = Geometry_2D("quadrilateral", "internal",
- 100, 100, "./")
-cells, boundary_points =
- domain.generate_quad_mesh_internal(\
- x_limits=[0, 1], y_limits=[0, 1],\
- n_cells_x=4, n_cells_y=4,\
- num_boundary_points=400)
-
-# Note: Users need to provide the necessary
-# boundary values and the forcing function
-
-# load the FEspace
-fespace = Fespace2D(domain.mesh,cells,boundary_points,\
- domain.mesh_type,fe_order=5,\
- fe_type="jacobi",quad_order=5,\
- quad_type="legendre", \
- fe_transformation_type="bilinear"\
- bound_function_dict=bound_function_dict,\
- bound_condition_dict=bound_condition_dict,\
- forcing_function=rhs,\
- output_path=i_output_path,\
- generate_mesh_plot=True)
-
-# Instantiate Data handler
-dh = datahandler2D(fespace, domain, dtype=tf.float32)
-
-# Instantiate the model with the loss function for the model
-model = DenseModel(layer_dims=[2, 30, 30, 30, 1],\
- learning_rate_dict=0.01,params_dict=params_dict,
- ## Loss function of poisson2D
- loss_function=pde_loss_poisson,
- input_tensors_list=\
- [in_tensor,
- dir_in,
- dir_out],
- orig_factor_matrices=\
- [dh.shape_val_mat_list,
- dh.grad_x_mat_list,
- dh.grad_y_mat_list],
- force_function_list=dh.forcing_function_list,\
- tensor_dtype=tf.float32,
- use_attention=i_use_attention,
- activation=i_activation,
- hessian=False)
-
-# Train the model
-for epoch in range(1000):
- model.train_step()
+ framework, users can solve a PDE with just six API calls. A Minimal
+ working example to solve the Poisson equation using the FastVPINNs
+ framework ca be found
+ >HGpaV-tj&ZE
zv8GCPd=MC~Px8r%9CeT*h}%yrl!Y91y(SXIN^i7?Bh+o?_d@!{h-<|Khi9>gLWoN$
zjE#%1$To3I*#KYCDv-9XZntA|8G@PInyFVy%{mkXrPra(Ds&lIKNN=B$+HiD(YieA
zg-G7qcZloEJxj#LBRG-GMgmoR&EoBGY4B>We4UpsDmQYTFe2jJAbaD87nw1R@Vt=K
zx6%{ZEESRHVXOxTktneEQqhY!G3|ce8Qc?vvL#(V!();7#qFhLIWB)A-WCd)+qzeS
zDK#8WQtRmsKb)4##O>3mf*-`!DmaJe(Xxu8Ps^GgC^9LSJ0<&T@0C6v!-yX{m@PS~
z2gj^uoI&J%LpR8b$|J!dXdAq