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 Jun 26, 2024
2 parents 32b9d60 + 0a6f369 commit c519501
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ build/
.pytest_cache
/.Lab

/thesis
/thesis

/.achom
4 changes: 4 additions & 0 deletions xppbe/NN/PINN.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def solve(self,N=1000, N2=0, save_model=0, G_solve_iter=100):

self.main_loop(N,N2)

import os
dir_save = os.path.join(self.results_path,'iterations',f'iter_{self.iter}')
self.save_model(dir_save)

logger = logging.getLogger(__name__)
logger.info(f' Iterations: {self.iter}')
logger.info(" Loss: {:6.4e}".format(self.losses['TL'][self.iter-1]))
Expand Down
8 changes: 5 additions & 3 deletions xppbe/Post/Postcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def run_all(self,plot_mesh,known_method):
self.plot_loss_validation_history(domain=1,loss='TL');
self.plot_loss_validation_history(domain=2,loss='TL');

self.save_values_file(L2_err_method=known_method);

if plot_mesh:
self.plot_collocation_points_3D();
self.plot_vol_mesh_3D();
Expand All @@ -95,20 +93,24 @@ def run_all(self,plot_mesh,known_method):
self.plot_phi_contour(value='react');
self.plot_interface_3D(variable='phi');
self.plot_interface_3D(variable='dphi');
self.save_values_file();

if not known_method is None:

if known_method == 'analytic_Born_Ion':
self.plot_G_solv_history('analytic_Born_Ion');
self.save_values_file(L2_err_method='analytic_Born_Ion');
self.plot_aprox_analytic();
self.plot_aprox_analytic(value='react');
self.plot_aprox_analytic(zoom=True);
self.plot_aprox_analytic(zoom=True, value='react');
self.plot_line_interface();
self.plot_line_interface(value='react');
self.plot_line_interface(plot='du');
self.plot_G_solv_history(method='analytic_Born_Ion');

else:
self.plot_G_solv_history(known_method);
self.save_values_file(L2_err_method=known_method);
self.plot_phi_line_aprox_known(known_method, value='react',theta=0, phi=np.pi/2)
self.plot_phi_line_aprox_known(known_method, value='react',theta=np.pi/2, phi=np.pi/2)
self.plot_phi_line_aprox_known(known_method, value='react', theta=np.pi/2, phi=np.pi)
Expand Down
1 change: 1 addition & 0 deletions xppbe/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def postprocessing(self, run_all=False, jupyter=False, plot_mesh=False, known_me

if self.domain_properties['molecule'] == 'born_ion':
from xppbe.Post.Postcode import Born_Ion_Postprocessing as Postprocessing
known_method='analytic_Born_Ion'
else:
from xppbe.Post.Postcode import Postprocessing

Expand Down

0 comments on commit c519501

Please sign in to comment.