Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/MartinAchondo/XPPBE
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinAchondo committed Oct 22, 2024
2 parents 2adf1f4 + f826c85 commit 6c05ebf
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions papers/PINN_PB_paper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
from xppbe import Simulation

yaml_path = 'path_to_input_file.yaml' # example 'input_files/BI/BI_WA_TF_FF_SI_SO.yaml'
yaml_path = 'input_files/BI/BI_WA_TF_FF_SI_SO.yaml'

molecule_dir = None # Use default molecule directory if None, calling xppbe/Molecules/

results_path = f'results/{yaml_path.split("/")[-1].replace(".yaml","")}' # example to use the name of the .yaml file

# Creation of the simulation object
simulation = Simulation(yaml_path, molecule_dir)
simulation = Simulation(yaml_path, molecule_dir, results_path)

# Setup the PINN model and parameters from the YAML configuration
simulation.create_simulation()
Expand All @@ -30,15 +34,21 @@
post.plot_G_solv_history();

# Different plots of the reaction field
post.plot_phi_line(value='react');
import numpy as np
post.plot_phi_line(value='react', theta=0, phi=np.pi/2);
post.plot_phi_contour(value='react');
post.plot_interface_3D(value='react', ext='png');
post.plot_interface_3D(value='react', ext='html');

# Save relevant information
post.save_values_file()
post.save_model_summary();





# To compare to a known method, use known_method as 'analytic_Born_Ion', 'Spherical_Harmonics', 'PBJ', 'APBS'
known_method = 'analytic_Born_Ion'
post.values_for_paper(err_method=known_method)
post.plot_G_solv_history(known_method);
post.plot_phi_line_aprox_known(known_method, value='react',theta=0, phi=np.pi/2)
post.plot_phi_line_aprox_known(known_method, value='react',theta=np.pi/2, phi=np.pi/2)
post.plot_phi_line_aprox_known(known_method, value='react', theta=np.pi/2, phi=np.pi)
post.plot_interface_error(known_method, type_e='absolute', scale='log', ext='png')

0 comments on commit 6c05ebf

Please sign in to comment.