Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions examples/complex-multi-coupling/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,43 @@ participants:
exchanges:
- from: NASTIN
to: SOLIDZ1
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Forces1
type: strong
data-type: vector
- from: NASTIN
to: SOLIDZ2
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Forces2
type: strong
data-type: vector
- from: NASTIN
to: SOLIDZ3
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Forces3
type: strong
data-type: vector
- from: SOLIDZ1
to: NASTIN
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Displacements1
type: strong
data-type: vector
- from: SOLIDZ2
to: NASTIN
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Displacements2
type: strong
data-type: vector
- from: SOLIDZ3
to: NASTIN
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Displacements3
type: strong
data-type: vector
16 changes: 8 additions & 8 deletions examples/multi-coupling/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ participants:

exchanges:
- from: Fluid-Top
from-location-name: surface
from-location-names: [surface]
to: Solid
to-location-name: interface
to-location-names: [interface]
data: Temperature-Top # Solid reads temperature
type: strong
- from: Solid
from-location-name: surface
from-location-names: [surface]
to: Fluid-Top
to-location-name: interface
to-location-names: [interface]
data: HeatTransfer-Top # Solid reads temperature
type: strong
- from: Fluid-Bottom
from-location-name: surface
from-location-names: [surface]
to: Solid
to-location-name: interface
to-location-names: [interface]
data: Temperature-Bottom # Solid reads temperature
type: strong
- from: Solid
from-location-name: interface
from-location-names: [interface]
to: Fluid-Bottom
to-location-name: surface
to-location-names: [surface]
data: HeatTransfer-Bottom # Fluid reads heat flux
type: strong
8 changes: 4 additions & 4 deletions examples/strong-coupling/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ participants:
solver: Calculix
exchanges:
- from: Fluid
from-location-name: interface
from-location-names: [interface]
to: Solid
to-location-name: surface
to-location-names: [surface]
data: Force
type: strong
- from: Solid
from-location-name: surface
from-location-names: [surface]
to: Fluid
to-location-name: interface
to-location-names: [interface]
data: Displacement
type: strong
4 changes: 2 additions & 2 deletions examples/tutorial1/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ participants:
exchanges:
- from: Generator
to: Propagator
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Color
type: weak
data-type: scalar
8 changes: 4 additions & 4 deletions examples/tutorial2/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ participants:
exchanges:
- from: Generator-Left
to: Propagator
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Color
type: weak
data-type: scalar
- from: Generator-Right
to: Propagator
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Color
type: weak
data-type: scalar
8 changes: 4 additions & 4 deletions examples/tutorial3/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ participants:
exchanges:
- from: Fluid
to: Solid
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Temperature
type: strong
data-type: scalar
- from: Solid
to: Fluid
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
data: Heat-Flux
type: strong
data-type: scalar
4 changes: 2 additions & 2 deletions examples/tutorial4/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ exchanges:
data: Data
type: weak
data-type: scalar
from-location-name: interface
to-location-name: interface
from-location-names: [interface]
to-location-names: [interface]
8 changes: 4 additions & 4 deletions examples/volume-coupling/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ participants:
exchanges:
- from: Fluid
to: PorousMedia
from-location-name: overlapping-domain
to-location-name: overlapping-domain
from-location-names: [overlapping-domain]
to-location-names: [overlapping-domain]
from-location-type: volume
to-location-type: volume
type: weak
data: Velocity
data-type: vector
- from: PorousMedia
to: Fluid
from-location-name: overlapping-domain
to-location-name: overlapping-domain
from-location-names: [overlapping-domain]
to-location-names: [overlapping-domain]
from-location-type: volume
to-location-type: volume
type: weak
Expand Down
22 changes: 12 additions & 10 deletions precicecasegenerate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from precicecasegenerate import cli_helper
from precicecasegenerate.logging_setup import setup_logging
from precicecasegenerate.input_handler.topology_reader import TopologyReader
from precicecasegenerate.input_handler.topology_processor import TopologyProcessor
from precicecasegenerate.node_creator import NodeCreator
from precicecasegenerate.file_creators.config_creator import ConfigCreator
from precicecasegenerate.file_creators.adapter_config_creator import AdapterConfigCreator
Expand Down Expand Up @@ -68,18 +69,19 @@ def generate_case(input_file: Path, output_root: Path) -> int:
logger.debug(f"Created output directory at {output_root}")

logger.debug("Starting topology reader.")
topology_reader: TopologyReader = TopologyReader(input_file.resolve())
return_value: int = topology_reader.validate_topology()
if return_value != 0:
return return_value
return_value: int = topology_reader.check_topology()
# Read the topology file
topology_reader = TopologyReader(input_file.resolve())
topology = topology_reader.get_topology()
logger.debug("Topology reader finished.")

logger.debug("Starting topology processing.")
# Process and validate the topology
processor = TopologyProcessor(topology, input_file.resolve())
return_value = processor.process()

if return_value != 0:
return return_value
# Preprocess the participant names to ensure they have the correct format.
# This needs to be done before creating the nodes.
topology_reader.preprocess_participant_names()
topology: dict = topology_reader.get_topology()
logger.debug("Topology reader finished.")
logger.debug("Topology processing finished.")

logger.debug("Starting node creator.")
node_creator: NodeCreator = NodeCreator(topology)
Expand Down
Loading
Loading