From 45883a75471be4ff05066496312182672fa3768f Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Wed, 1 Nov 2023 16:54:26 -0400 Subject: [PATCH 1/2] removed collapse for post_processing_solution --- festim/hydrogen_transport_problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/festim/hydrogen_transport_problem.py b/festim/hydrogen_transport_problem.py index d21c53874..337a748ac 100644 --- a/festim/hydrogen_transport_problem.py +++ b/festim/hydrogen_transport_problem.py @@ -285,7 +285,7 @@ def assign_functions_to_species(self): 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() From 3ce66cd0626b52dad8b99a81060a744edcbae9a0 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Wed, 1 Nov 2023 17:01:07 -0400 Subject: [PATCH 2/2] removed un-needed lines --- festim/hydrogen_transport_problem.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/festim/hydrogen_transport_problem.py b/festim/hydrogen_transport_problem.py index 337a748ac..1315a50bb 100644 --- a/festim/hydrogen_transport_problem.py +++ b/festim/hydrogen_transport_problem.py @@ -277,7 +277,7 @@ 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)) @@ -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]