Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain initial data resolution in control loop. #6162

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions support/Pipelines/Bbh/ControlId.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def control_id(
id_run_dir: Optional[Union[str, Path]] = None,
residual_tolerance: float = DEFAULT_RESIDUAL_TOLERANCE,
max_iterations: int = DEFAULT_MAX_ITERATIONS,
refinement_level: int = 1,
polynomial_order: int = 6,
):
"""Control BBH physical parameters.

Expand Down Expand Up @@ -52,6 +54,8 @@ def control_id(
max_iterations: Maximum of iterations allowed. Note: each iteration is
very expensive as it needs to solve an entire initial data problem.
(Default: 30)
refinement_level: h-refinement used in control loop.
polynomial_order: p-refinement used in control loop.
"""

# Read input file
Expand Down Expand Up @@ -111,6 +115,8 @@ def Residual(
control=False,
evolve=False,
scheduler=None,
refinement_level=refinement_level,
polynomial_order=polynomial_order,
)

# Get black hole physical parameters
Expand Down
2 changes: 2 additions & 0 deletions support/Pipelines/Bbh/InitialData.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Next:
id_run_dir: ./
pipeline_dir: {{ pipeline_dir | default("None") }}
control: {{ control }}
control_refinement_level: {{ L }}
control_polynomial_order: {{ P }}
evolve: {{ evolve }}
scheduler: {{ scheduler | default("None") }}
copy_executable: {{ copy_executable | default("None") }}
Expand Down
6 changes: 6 additions & 0 deletions support/Pipelines/Bbh/PostprocessId.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def postprocess_id(
control: bool = True,
control_residual_tolerance: float = DEFAULT_RESIDUAL_TOLERANCE,
control_max_iterations: int = DEFAULT_MAX_ITERATIONS,
control_refinement_level: int = 1,
control_polynomial_order: int = 6,
evolve: bool = False,
pipeline_dir: Optional[Union[str, Path]] = None,
**scheduler_kwargs,
Expand Down Expand Up @@ -69,6 +71,8 @@ def postprocess_id(
control: Control BBH physical parameters (default: False).
control_residual_tolerance: Residual tolerance used for control.
control_max_iterations: Maximum of iterations allowed for control.
control_refinement_level: h-refinement used for control.
control_polynomial_order: p-refinement used for control.
evolve: Evolve the initial data after postprocessing (default: False).
pipeline_dir: Directory where steps in the pipeline are created.
Required if 'evolve' is set to True.
Expand Down Expand Up @@ -126,6 +130,8 @@ def postprocess_id(
id_run_dir=id_run_dir,
residual_tolerance=control_residual_tolerance,
max_iterations=control_max_iterations,
refinement_level=control_refinement_level,
polynomial_order=control_polynomial_order,
)
id_run_dir = last_control_run_dir
id_input_file_path = f"{last_control_run_dir}/InitialData.yaml"
Expand Down
2 changes: 2 additions & 0 deletions tests/support/Pipelines/Bbh/Test_InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def test_cli(self):
"id_run_dir": "./",
"pipeline_dir": str(self.test_dir.resolve() / "Pipeline"),
"control": True,
"control_refinement_level": 1,
"control_polynomial_order": 5,
"evolve": True,
"scheduler": "None",
"copy_executable": "None",
Expand Down
Loading