generated from ansys/template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pr_metalforming
- Loading branch information
Showing
20 changed files
with
5,095 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
# Contributors | ||
|
||
## Individual contributors | ||
## Project Lead | ||
|
||
* [Zhanqun Zhang](https://github.com/zhangzhanqun) | ||
* [Wenhui Yu](https://github.com/wenhuiuy) | ||
* [Srikanth Adya](https://github.com/kanthadya) | ||
* [Wenhui Yu](https://github.com/wenhuiuy) | ||
* [Zhanqun Zhang](https://github.com/zhangzhanqun) | ||
|
||
## Individual Contributors | ||
|
||
* [Alexander Kaszynski](https://github.com/akaszynski) | ||
* [Dominik Gresch](https://github.com/greschd) | ||
* [Fabian de Leon](https://github.com/fdeleonm) | ||
* [Jorge Martínez](https://github.com/jorgepiloto) | ||
* [Maxime Rey](https://github.com/MaxJPRey) | ||
* [Revathy Venugopal](https://github.com/Revathyvenugopal162) | ||
* [Roberto Pastor](https://github.com/RobPasMue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Use PyDYNA to run LSDYNA locally | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Run LS-DYNA using ansys.dyna.core.run | ||
************************************* | ||
|
||
.. code:: python | ||
import os | ||
from ansys.dyna.core.run import run_dyna | ||
dynafile = "input.k" | ||
working_directory = os.path.getcwd() | ||
filepath = run_dyna(dynafile, working_directory=dynadir) | ||
...... | ||
How it works | ||
************ | ||
|
||
``run_dyna`` attempts to find an installation of the LS-DYNA solver on your machine. | ||
It uses the Python dependency ``ansys-tools-path`` to discover where LS-DYNA is installed. | ||
After installing ``ansys-tools-path``, the location of LS-DYNA can be saved by running | ||
``save-ansys-path --name dyna {path/to/dyna}`` so that subsequent usages of ``run_dyna`` | ||
look there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
markers = | ||
run: tests that exercise the `run` subpackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
from .local_solver import run_dyna # noqa: F401 | ||
from .options import MemoryUnit, MpiOption, Precision # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
"""Base runner class.""" | ||
|
||
from ansys.dyna.core.run.options import MemoryUnit, MpiOption, Precision | ||
|
||
|
||
class BaseRunner: | ||
def __init__(self, **kwargs): | ||
# TODO - split mpi option into precision? | ||
self.mpi_option = kwargs.get("mpi_option", MpiOption.SMP) | ||
self.ncpu = kwargs.get("ncpu", 1) | ||
self.memory = kwargs.get("memory", 20) | ||
self.memory_unit = kwargs.get("memory_unit", MemoryUnit.MB) | ||
self.precision = kwargs.get("precision", Precision.DOUBLE) | ||
|
||
def get_memory_string(self) -> str: | ||
unit = {MemoryUnit.MB: "m", MemoryUnit.GB: "G"}[self.memory_unit] | ||
return f"{self.memory}{unit}" |
Oops, something went wrong.