diff --git a/examples/tutorials/quick_start.py b/examples/tutorials/quick_start.py index 553800ffc..a43c57b19 100644 --- a/examples/tutorials/quick_start.py +++ b/examples/tutorials/quick_start.py @@ -60,4 +60,4 @@ ) # Step 5: Run the simulation case with the specified parameters -project.run_case(params=params, name="Case of Simple Airplane from Python") +project.run_case(params=params, name="Case of Simple Airplane from Python", use_beta_mesher=False) diff --git a/flow360/component/project.py b/flow360/component/project.py index a1da4a331..34001e11f 100644 --- a/flow360/component/project.py +++ b/flow360/component/project.py @@ -559,12 +559,14 @@ def _get_root_simulation_json(self): # pylint: disable=too-many-arguments, too-many-locals def _run( self, + *, params: SimulationParams, target: AssetOrResource, - draft_name: str = None, - fork_from: Case = None, - run_async: bool = True, - solver_version: str = None, + draft_name: str, + fork_from: Case, + run_async: bool, + solver_version: str, + use_beta_mesher: bool, ): """ Runs a simulation for the project. @@ -629,7 +631,7 @@ def _run( draft.update_simulation_params(params) - destination_id = draft.run_up_to_target_asset(target) + destination_id = draft.run_up_to_target_asset(target, use_beta_mesher=use_beta_mesher) self._project_webapi.patch( # pylint: disable=protected-access @@ -660,6 +662,7 @@ def generate_surface_mesh( name: str = "SurfaceMesh", run_async: bool = True, solver_version: str = None, + use_beta_mesher: bool = False, ): """ Runs the surface mesher for the project. @@ -693,6 +696,7 @@ def generate_surface_mesh( run_async=run_async, fork_from=None, solver_version=solver_version, + use_beta_mesher=use_beta_mesher, ) ) @@ -703,6 +707,7 @@ def generate_volume_mesh( name: str = "VolumeMesh", run_async: bool = True, solver_version: str = None, + use_beta_mesher: bool = False, ): """ Runs the volume mesher for the project. @@ -736,6 +741,7 @@ def generate_volume_mesh( run_async=run_async, fork_from=None, solver_version=solver_version, + use_beta_mesher=use_beta_mesher, ) ) @@ -747,6 +753,7 @@ def run_case( run_async: bool = True, fork_from: Case = None, solver_version: str = None, + use_beta_mesher: bool = False, ): """ Runs a case for the project. @@ -773,5 +780,6 @@ def run_case( run_async=run_async, fork_from=fork_from, solver_version=solver_version, + use_beta_mesher=use_beta_mesher, ) ) diff --git a/flow360/component/simulation/web/draft.py b/flow360/component/simulation/web/draft.py index 0238adea2..fc7d5f481 100644 --- a/flow360/component/simulation/web/draft.py +++ b/flow360/component/simulation/web/draft.py @@ -142,13 +142,18 @@ def get_simulation_dict(self) -> dict: response = self.get(method="simulation/file", params={"type": "simulation"}) return json.loads(response["simulationJson"]) - def run_up_to_target_asset(self, target_asset: type) -> str: + def run_up_to_target_asset(self, target_asset: type, use_beta_mesher: bool) -> str: """run the draft up to the target asset""" try: # pylint: disable=protected-access + if use_beta_mesher is True: + log.info("Selecting beta/inhouse mesher for possible meshing tasks.") run_response = self.post( - json={"upTo": target_asset._cloud_resource_type_name, "useInHouse": False}, + json={ + "upTo": target_asset._cloud_resource_type_name, + "useInHouse": use_beta_mesher, + }, method="run", ) except Flow360WebError as err: