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

Added current working directory option for launch_fluent API. #978

Merged
merged 4 commits into from
Oct 10, 2022
Merged
Changes from 2 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 src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def launch_fluent(
server_info_filepath: str = None,
password: str = None,
py: bool = None,
cwd: str = None,
) -> Union[_BaseSession, Session]:
"""Launch Fluent locally in server mode or connect to a running Fluent
server instance.
Expand Down Expand Up @@ -506,6 +507,10 @@ def launch_fluent(
Passes ``"-py"`` as an additional_argument to launch fluent in python mode.
The default is ``None``.

cwd: str, Optional
Path to specify current working directory to launch fluent from the defined directory as
current working directory.

Returns
-------
ansys.fluent.session.Session
Expand Down Expand Up @@ -536,6 +541,7 @@ def launch_fluent(
if mode != LaunchModes.SOLVER_ICING:
env["APP_LAUNCHED_FROM_CLIENT"] = "1" # disables flserver datamodel
kwargs = _get_subprocess_kwargs_for_fluent(env)
kwargs.update(cwd=cwd)
abhishekchitwar marked this conversation as resolved.
Show resolved Hide resolved
subprocess.Popen(launch_string, **kwargs)

_await_fluent_launch(server_info_filepath, start_timeout, sifile_last_mtime)
Expand Down