Skip to content

Commit

Permalink
Changed namings (#64)
Browse files Browse the repository at this point in the history
* changed names of meshes and removed prefixes of displacement and force

* changed mesh-name to mesh and from_ to from
  • Loading branch information
VanLaareN authored Jan 22, 2025
1 parent ad2ef43 commit a814d0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Binary file added controller_utils.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions controller_utils/precice_struct/PS_CouplingScheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def write_participants_and_coupling_scheme(self, tag: etree, config, coupling_st
pass
# the solver with the higher complexity should be first
if mycomplexity[0] < mycomplexity[1]:
i = etree.SubElement(coupling_scheme, "participant", first=mylist[0],
i = etree.SubElement(coupling_scheme, "participants", first=mylist[0],
second=mylist[1])
else:
i = etree.SubElement(coupling_scheme, "participant", first=mylist[1],
i = etree.SubElement(coupling_scheme, "participants", first=mylist[1],
second=mylist[0])
else:
# TODO: is "multi" good for all
Expand All @@ -58,9 +58,9 @@ def write_participants_and_coupling_scheme(self, tag: etree, config, coupling_st
for participant_name in config.solvers:
participant = config.solvers[participant_name]
if participant.name == control_participant_name:
i = etree.SubElement(coupling_scheme, "participant", name=participant_name, control="yes")
i = etree.SubElement(coupling_scheme, "participants", name=participant_name, control="yes")
else:
i = etree.SubElement(coupling_scheme, "participant", name=participant_name)
i = etree.SubElement(coupling_scheme, "participants", name=participant_name)
pass
pass
pass
Expand Down
10 changes: 5 additions & 5 deletions controller_utils/precice_struct/PS_PreCICEConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_coupling_quantitiy(self, quantity_name:str, source_mesh_name:str, bc: st
# add always as a prefix the name of the mesh such that it will become unique
# IMPORTANT: we need to specify the source mesh of the quantity not other mesh

concat_quantity_name = source_mesh_name + "-" + quantity_name
concat_quantity_name = quantity_name
# print(" Q=", quantity_name, " T=", concat_quantity_name)
if concat_quantity_name in self.coupling_quantities:
ret = self.coupling_quantities[concat_quantity_name]
Expand Down Expand Up @@ -71,7 +71,7 @@ def get_mesh_name_by_participants(self, source_participant:str, participant2:str
# first participant is the source (provider) of the mesh
# list = [ participant1, participant2]
# list.sort()
mesh_name = source_participant + "-" + participant2 + "-Mesh"
mesh_name = source_participant + "-Mesh"
return mesh_name

def get_mesh_by_participant_names(self, source_participant:str, participant2:str):
Expand Down Expand Up @@ -222,7 +222,7 @@ def write_precice_xml_config(self, filename:str, log:UT_PCErrorLogging, sync_mod
for q_name in solver.quantities_read:
q = solver.quantities_read[q_name]
read_tag = etree.SubElement(solver_tag,
"read-data", name=q.name, mesh_name=solvers_mesh_name)
"read-data", name=q.name, mesh=solvers_mesh_name)
for other_solvers_name in q.list_of_solvers:
other_solver = q.list_of_solvers[other_solvers_name]
# consistent only read
Expand All @@ -245,7 +245,7 @@ def write_precice_xml_config(self, filename:str, log:UT_PCErrorLogging, sync_mod
for q_name in solver.quantities_write:
q = solver.quantities_write[q_name]
write_tag = etree.SubElement(solver_tag,
"write-data", name=q.name, mesh_name=solvers_mesh_name)
"write-data", name=q.name, mesh=solvers_mesh_name)
for other_solvers_name in q.list_of_solvers:
other_solver = q.list_of_solvers[other_solvers_name]
# conservative only write
Expand All @@ -267,7 +267,7 @@ def write_precice_xml_config(self, filename:str, log:UT_PCErrorLogging, sync_mod
mapping_string = type_of_the_mapping_read[other_solver_name]
other_solver_mesh_name = self.get_mesh_name_by_participants(other_solver_name, solver_name)
mapped_tag = etree.SubElement(solver_tag, "mapping:nearest-neighbor", direction = "read",
from_ = other_solver_mesh_name, to= solvers_mesh_name,
from___ = other_solver_mesh_name, to= solvers_mesh_name,
constraint = mapping_string)
pass
# WRITES
Expand Down

0 comments on commit a814d0c

Please sign in to comment.