diff --git a/controller_utils.zip b/controller_utils.zip new file mode 100644 index 0000000..b4ea887 Binary files /dev/null and b/controller_utils.zip differ diff --git a/controller_utils/precice_struct/PS_CouplingScheme.py b/controller_utils/precice_struct/PS_CouplingScheme.py index 914ee7c..ba3dcec 100644 --- a/controller_utils/precice_struct/PS_CouplingScheme.py +++ b/controller_utils/precice_struct/PS_CouplingScheme.py @@ -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 @@ -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 diff --git a/controller_utils/precice_struct/PS_PreCICEConfig.py b/controller_utils/precice_struct/PS_PreCICEConfig.py index fa6197d..6e93a1c 100644 --- a/controller_utils/precice_struct/PS_PreCICEConfig.py +++ b/controller_utils/precice_struct/PS_PreCICEConfig.py @@ -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] @@ -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): @@ -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 @@ -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 @@ -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