Skip to content

Commit

Permalink
rename function processing sources
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdark committed Feb 25, 2025
1 parent 422e4f3 commit d004c62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/festim/hydrogen_transport_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def initialise(self):

self.define_temperature()
self.define_boundary_conditions()
self.create_source_values_fenics()
self.convert_source_input_values_to_fenics_objects()
self.create_flux_values_fenics()
self.create_initial_conditions()
self.create_formulation()
Expand Down Expand Up @@ -612,7 +612,7 @@ def create_dirichletbc_form(self, bc):

return form

def create_source_values_fenics(self):
def convert_source_input_values_to_fenics_objects(self):
"""For each source create the value_fenics"""
for source in self.sources:
# create value_fenics for all F.ParticleSource objects
Expand Down Expand Up @@ -938,7 +938,7 @@ def initialise(self):
self.define_function_spaces(subdomain)

self.define_temperature()
self.create_source_values_fenics()
self.convert_source_input_values_to_fenics_objects()
self.create_flux_values_fenics()
self.create_initial_conditions()

Expand Down Expand Up @@ -1059,7 +1059,7 @@ def define_function_spaces(self, subdomain: _subdomain.VolumeSubdomain):
name = f"{species.name}_{subdomain.id}"
species.subdomain_to_post_processing_solution[subdomain].name = name

def create_source_values_fenics(self):
def convert_source_input_values_to_fenics_objects(self):
"""For each source create the value_fenics"""
for source in self.sources:
# create value_fenics for all F.ParticleSource objects
Expand Down
2 changes: 1 addition & 1 deletion src/festim/problem_change_of_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def initialise(self):

self.define_temperature()
self.define_boundary_conditions()
self.create_source_values_fenics()
self.convert_source_input_values_to_fenics_objects()
self.create_flux_values_fenics()
self.create_initial_conditions()
self.create_formulation()
Expand Down
8 changes: 4 additions & 4 deletions test/test_h_transport_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def test_update_time_dependent_values_source(source_value, expected_values):
my_model.define_meshtags_and_measures()
my_model.assign_functions_to_species()
my_model.define_temperature()
my_model.create_source_values_fenics()
my_model.convert_source_input_values_to_fenics_objects()

for i in range(3):
# RUN
Expand Down Expand Up @@ -727,7 +727,7 @@ def test_update_sources_with_time_dependent_temperature(
my_model.define_function_spaces()
my_model.assign_functions_to_species()
my_model.define_meshtags_and_measures()
my_model.create_source_values_fenics()
my_model.convert_source_input_values_to_fenics_objects()

for i in range(3):
# RUN
Expand All @@ -740,7 +740,7 @@ def test_update_sources_with_time_dependent_temperature(
assert np.isclose(computed_value, expected_values[i])


def test_create_source_values_fenics_multispecies():
def test_convert_source_input_values_to_fenics_objects_multispecies():
"""Test that the define_sources method correctly sets the value_fenics attribute in
a multispecies case"""
# BUILD
Expand All @@ -764,7 +764,7 @@ def test_create_source_values_fenics_multispecies():
my_model.define_temperature()

# RUN
my_model.create_source_values_fenics()
my_model.convert_source_input_values_to_fenics_objects()

# TEST
assert np.isclose(float(my_model.sources[0].value.fenics_object), 5)
Expand Down

0 comments on commit d004c62

Please sign in to comment.