|
13 | 13 | import tqdm.autonotebook |
14 | 14 | import ufl |
15 | 15 | from dolfinx import fem |
16 | | -from dolfinx.nls.petsc import NewtonSolver |
17 | 16 | from packaging.version import Version |
18 | 17 | from scifem import BlockedNewtonSolver |
19 | 18 |
|
20 | | -import festim.boundary_conditions |
21 | | -import festim.problem |
22 | 19 | from festim import ( |
23 | 20 | boundary_conditions, |
24 | 21 | exports, |
|
37 | 34 | ) |
38 | 35 | from festim.advection import AdvectionTerm |
39 | 36 | from festim.helpers import ( |
| 37 | + KSPMonitor, |
| 38 | + SnesMonitor, |
40 | 39 | as_fenics_constant, |
| 40 | + convergenceTest, |
41 | 41 | get_interpolation_points, |
42 | 42 | is_it_time_to_export, |
43 | | - SnesMonitor, |
44 | | - KSPMonitor, |
45 | | - convergenceTest, |
46 | 43 | nmm_interpolate, |
47 | 44 | ) |
48 | 45 | from festim.material import SolubilityLaw |
@@ -433,7 +430,7 @@ def initialise_exports(self): |
433 | 430 | self.settings.stepsize.milestones.append(time) |
434 | 431 | self.settings.stepsize.milestones.sort() |
435 | 432 |
|
436 | | - if isinstance(export, festim.VTXTemperatureExport): |
| 433 | + if isinstance(export, exports.VTXTemperatureExport): |
437 | 434 | self._temperature_as_function = ( |
438 | 435 | self._get_temperature_field_as_function() |
439 | 436 | ) |
@@ -819,7 +816,7 @@ def create_formulation(self): |
819 | 816 |
|
820 | 817 | for reaction in self.reactions: |
821 | 818 | for reactant in reaction.reactant: |
822 | | - if isinstance(reactant, festim.species.Species): |
| 819 | + if isinstance(reactant, _species.Species): |
823 | 820 | self.formulation += ( |
824 | 821 | reaction.reaction_term(self.temperature_fenics) |
825 | 822 | * reactant.test_function |
@@ -976,7 +973,7 @@ def post_processing(self): |
976 | 973 | else: |
977 | 974 | export.writer.write(float(self.t)) |
978 | 975 | elif ( |
979 | | - isinstance(export, festim.VTXTemperatureExport) |
| 976 | + isinstance(export, exports.VTXTemperatureExport) |
980 | 977 | and self.temperature_time_dependent |
981 | 978 | ): |
982 | 979 | self._temperature_as_function.interpolate( |
@@ -1422,14 +1419,14 @@ def create_subdomain_formulation(self, subdomain: _subdomain.VolumeSubdomain): |
1422 | 1419 | if reaction.volume != subdomain: |
1423 | 1420 | continue |
1424 | 1421 | for species in reaction.reactant + reaction.product: |
1425 | | - if isinstance(species, festim.species.Species): |
| 1422 | + if isinstance(species, _species.Species): |
1426 | 1423 | # TODO remove |
1427 | 1424 | # temporarily overide the solution to the one of the subdomain |
1428 | 1425 | species.solution = species.subdomain_to_solution[subdomain] |
1429 | 1426 |
|
1430 | 1427 | # reactant |
1431 | 1428 | for reactant in reaction.reactant: |
1432 | | - if isinstance(reactant, festim.species.Species): |
| 1429 | + if isinstance(reactant, _species.Species): |
1433 | 1430 | form += ( |
1434 | 1431 | reaction.reaction_term(self.temperature_fenics) |
1435 | 1432 | * reactant.subdomain_to_test_function[subdomain] |
@@ -2093,7 +2090,7 @@ def get_concentrations(species_list) -> list: |
2093 | 2090 | # add reaction term to formulation |
2094 | 2091 | # reactant |
2095 | 2092 | for reactant in reaction.reactant: |
2096 | | - if isinstance(reactant, festim.species.Species): |
| 2093 | + if isinstance(reactant, _species.Species): |
2097 | 2094 | self.formulation += ( |
2098 | 2095 | reaction_term * reactant.test_function * self.dx(reaction.volume.id) |
2099 | 2096 | ) |
@@ -2123,7 +2120,7 @@ def override_post_processing_solution(self): |
2123 | 2120 | K_S0.x.array[entities] = subdomain.material.get_K_S_0(spe) |
2124 | 2121 | E_KS.x.array[entities] = subdomain.material.get_E_K_S(spe) |
2125 | 2122 |
|
2126 | | - K_S = K_S0 * ufl.exp(-E_KS / (festim.k_B * self.temperature_fenics)) |
| 2123 | + K_S = K_S0 * ufl.exp(-E_KS / (k_B * self.temperature_fenics)) |
2127 | 2124 |
|
2128 | 2125 | theta = spe.solution |
2129 | 2126 |
|
@@ -2164,7 +2161,7 @@ def create_dirichletbc_form(self, bc: festim.FixedConcentrationBC): |
2164 | 2161 | K_S0.x.array[entities] = subdomain.material.get_K_S_0(bc.species) |
2165 | 2162 | E_KS.x.array[entities] = subdomain.material.get_E_K_S(bc.species) |
2166 | 2163 |
|
2167 | | - K_S = K_S0 * ufl.exp(-E_KS / (festim.k_B * self.temperature_fenics)) |
| 2164 | + K_S = K_S0 * ufl.exp(-E_KS / (k_B * self.temperature_fenics)) |
2168 | 2165 |
|
2169 | 2166 | # create value_fenics |
2170 | 2167 | bc.create_value( |
|
0 commit comments