Skip to content

Commit

Permalink
Merge pull request #624 from RemDelaporteMathurin/fix-vtx-outputs-zero
Browse files Browse the repository at this point in the history
Fix vtx outputs zero
  • Loading branch information
RemDelaporteMathurin authored Nov 2, 2023
2 parents 1dbe47d + 3ce66cd commit 798a5cb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions festim/hydrogen_transport_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ def assign_functions_to_species(self):
sub_prev_solution = [self.u_n]
sub_test_functions = [ufl.TestFunction(self.function_space)]
self.species[0].sub_function_space = self.function_space
self.species[0].post_processing_solution = fem.Function(self.function_space)
self.species[0].post_processing_solution = self.u
else:
sub_solutions = list(ufl.split(self.u))
sub_prev_solution = list(ufl.split(self.u_n))
sub_test_functions = list(ufl.TestFunctions(self.function_space))

for idx, spe in enumerate(self.species):
spe.sub_function_space = self.function_space.sub(idx)
spe.post_processing_solution = self.u.sub(idx).collapse()
spe.post_processing_solution = self.u.sub(idx)
spe.collapsed_function_space, _ = self.function_space.sub(
idx
).collapse()
Expand Down Expand Up @@ -498,16 +498,11 @@ def iterate(
self.mesh.mesh, self.temperature_fenics, self.species[0]
)
cm = self.u
self.species[0].post_processing_solution = self.u

surface_flux = form(D_D * dot(grad(cm), self.mesh.n) * self.ds(2))
flux = assemble_scalar(surface_flux)
self.flux_values.append(flux)
self.times.append(float(self.t))
else:
for idx, spe in enumerate(self.species):
spe.post_processing_solution = self.u.sub(idx)

cm_1, cm_2 = self.u.split()
D_1 = self.subdomains[0].material.get_diffusion_coefficient(
self.mesh.mesh, self.temperature_fenics, self.species[0]
Expand Down

0 comments on commit 798a5cb

Please sign in to comment.