From bd9ec0e9a493b923bbe58a04807c6511b3a9c0da Mon Sep 17 00:00:00 2001 From: Kerry McAdams Date: Tue, 5 Sep 2023 16:54:14 -0400 Subject: [PATCH 1/5] updated license headers & ran pre-commit checks --- .pre-commit-config.yaml | 5 + .reuse/dep5 | 72 ++ .reuse/templates/ansys.jinja2 | 27 + examples/00_additive_single_bead.py | 1 - examples/01_additive_porosity.py | 1 - examples/02_additive_microstructure.py | 1 - examples/03_additive_thermal_history.py | 1 - examples/04_additive_doe.py | 1 - examples/05_advanced_optimization_workflow.py | 1 - .../06_advanced_custom_material_tuning.py | 1 - examples/07_using_a_custom_material.py | 1 - scripts/update-copyright.py | 1 - src/ansys/additive/core/__init__.py | 23 +- src/ansys/additive/core/additive.py | 23 +- src/ansys/additive/core/conversions.py | 23 +- src/ansys/additive/core/download.py | 22 +- src/ansys/additive/core/examples/__init__.py | 23 +- src/ansys/additive/core/examples/downloads.py | 23 +- src/ansys/additive/core/geometry_file.py | 23 +- src/ansys/additive/core/machine.py | 23 +- src/ansys/additive/core/material.py | 23 +- src/ansys/additive/core/material_tuning.py | 23 +- src/ansys/additive/core/microstructure.py | 23 +- src/ansys/additive/core/misc.py | 23 +- .../core/parametric_study/__init__.py | 22 +- .../core/parametric_study/constants.py | 23 +- .../core/parametric_study/display/__init__.py | 22 +- .../display/_common_controls.py | 22 +- .../display/ave_grain_size_plot.py | 23 +- .../display/porosity_contour_plot.py | 23 +- .../parametric_study/display/show_table.py | 23 +- .../display/single_bead_eval_plot.py | 23 +- .../parametric_study/parametric_runner.py | 23 +- .../core/parametric_study/parametric_study.py | 23 +- .../core/parametric_study/parametric_utils.py | 23 +- src/ansys/additive/core/porosity.py | 23 +- src/ansys/additive/core/progress_logger.py | 23 +- src/ansys/additive/core/server_utils.py | 23 +- src/ansys/additive/core/simulation.py | 23 +- src/ansys/additive/core/single_bead.py | 23 +- src/ansys/additive/core/thermal_history.py | 23 +- src/ansys/additive/material.py | 845 ++++++++++++++++++ .../test_parametric_runner.py | 1 - .../parametric_study/test_parametric_study.py | 1 - .../parametric_study/test_parametric_utils.py | 1 - tests/test_additive.py | 1 - tests/test_download.py | 1 - tests/test_examples.py | 1 - tests/test_geometry_file.py | 1 - tests/test_machine.py | 1 - tests/test_material.py | 1 - tests/test_material_tuning.py | 1 - tests/test_microstructure.py | 1 - tests/test_misc.py | 1 - tests/test_porosity.py | 1 - tests/test_server_utils.py | 1 - tests/test_simulation.py | 1 - tests/test_single_bead.py | 1 - tests/test_thermal_history.py | 1 - tests/test_utils.py | 1 - 60 files changed, 1583 insertions(+), 56 deletions(-) create mode 100644 .reuse/dep5 create mode 100644 .reuse/templates/ansys.jinja2 create mode 100644 src/ansys/additive/material.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4c2da926..62a3f74a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,3 +55,8 @@ repos: rev: 0.24.1 hooks: - id: check-github-workflows + + - repo: https://github.com/ansys/pre-commit-hooks + rev: v0.1.2 + hooks: + - id: add-license-headers \ No newline at end of file diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 000000000..4e4743294 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,72 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pre-commit-hooks +Upstream-Contact: pyansys.core@ansys.com +Source: https://github.com/ansys/pre-commit-hooks + +Files: .github/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .reuse/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: doc/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: examples/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: LICENSES/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: tests/* +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .flake8 +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .gitattributes +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .gitignore +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .pre-commit-config.yaml +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: .pre-commit-hooks.yaml +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: CHANGELOG.md +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: CODE_OF_CONDUCT.md +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: CONTRIBUTING.md +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: pyproject.toml +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: README.rst +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: tox.ini +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT \ No newline at end of file diff --git a/.reuse/templates/ansys.jinja2 b/.reuse/templates/ansys.jinja2 new file mode 100644 index 000000000..6e33e1ec0 --- /dev/null +++ b/.reuse/templates/ansys.jinja2 @@ -0,0 +1,27 @@ +{% for copyright_line in copyright_lines %} +{{ copyright_line }} +{% endfor %} +{% for expression in spdx_expressions %} +SPDX-License-Identifier: {{ expression }} +{% endfor %} + + +{% if "MIT" in spdx_expressions %} +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. +{% endif %} \ No newline at end of file diff --git a/examples/00_additive_single_bead.py b/examples/00_additive_single_bead.py index 0d1691693..0081dc5c1 100644 --- a/examples/00_additive_single_bead.py +++ b/examples/00_additive_single_bead.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Single bead analysis ==================== diff --git a/examples/01_additive_porosity.py b/examples/01_additive_porosity.py index d37c64ad9..09e17a1f7 100644 --- a/examples/01_additive_porosity.py +++ b/examples/01_additive_porosity.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Porosity analysis ================= diff --git a/examples/02_additive_microstructure.py b/examples/02_additive_microstructure.py index 65219591a..6d80ac7d7 100644 --- a/examples/02_additive_microstructure.py +++ b/examples/02_additive_microstructure.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Microstructure analysis ####################### diff --git a/examples/03_additive_thermal_history.py b/examples/03_additive_thermal_history.py index c8ee26c7c..d68f12cb8 100644 --- a/examples/03_additive_thermal_history.py +++ b/examples/03_additive_thermal_history.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Thermal history analysis ======================== diff --git a/examples/04_additive_doe.py b/examples/04_additive_doe.py index 60d50fd5a..e4b6fff9d 100644 --- a/examples/04_additive_doe.py +++ b/examples/04_additive_doe.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Design of experiments ===================== diff --git a/examples/05_advanced_optimization_workflow.py b/examples/05_advanced_optimization_workflow.py index 2d8a46dc9..5d4971a3f 100644 --- a/examples/05_advanced_optimization_workflow.py +++ b/examples/05_advanced_optimization_workflow.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Optimization workflow analysis ============================== diff --git a/examples/06_advanced_custom_material_tuning.py b/examples/06_advanced_custom_material_tuning.py index 4bee31c7c..9c3e62380 100644 --- a/examples/06_advanced_custom_material_tuning.py +++ b/examples/06_advanced_custom_material_tuning.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Custom material tuning ====================== diff --git a/examples/07_using_a_custom_material.py b/examples/07_using_a_custom_material.py index 000049620..37b0bb988 100644 --- a/examples/07_using_a_custom_material.py +++ b/examples/07_using_a_custom_material.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. """ Using a custom material ======================= diff --git a/scripts/update-copyright.py b/scripts/update-copyright.py index 280bb61b4..85397910a 100644 --- a/scripts/update-copyright.py +++ b/scripts/update-copyright.py @@ -1,4 +1,3 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. import argparse import codecs from datetime import date diff --git a/src/ansys/additive/core/__init__.py b/src/ansys/additive/core/__init__.py index 4d9b37f45..b1b413425 100644 --- a/src/ansys/additive/core/__init__.py +++ b/src/ansys/additive/core/__init__.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + """Python client for the Ansys Additive service.""" import os diff --git a/src/ansys/additive/core/additive.py b/src/ansys/additive/core/additive.py index 353356f41..c3c95505d 100644 --- a/src/ansys/additive/core/additive.py +++ b/src/ansys/additive/core/additive.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + """Provides for interacting with the Additive service.""" import concurrent.futures from datetime import datetime diff --git a/src/ansys/additive/core/conversions.py b/src/ansys/additive/core/conversions.py index 6bc4327f7..d2a55a51a 100644 --- a/src/ansys/additive/core/conversions.py +++ b/src/ansys/additive/core/conversions.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + MM_TO_METER = 0.001 METER_TO_MM = 1000 diff --git a/src/ansys/additive/core/download.py b/src/ansys/additive/core/download.py index 28db59fc7..15704e952 100644 --- a/src/ansys/additive/core/download.py +++ b/src/ansys/additive/core/download.py @@ -1,4 +1,24 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. import hashlib import os diff --git a/src/ansys/additive/core/examples/__init__.py b/src/ansys/additive/core/examples/__init__.py index ce7aff513..d8d648083 100644 --- a/src/ansys/additive/core/examples/__init__.py +++ b/src/ansys/additive/core/examples/__init__.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + """Provides utilities for use with PyAdditive examples.""" from ansys.additive.core.examples.downloads import ( diff --git a/src/ansys/additive/core/examples/downloads.py b/src/ansys/additive/core/examples/downloads.py index 5fac79f89..69a3daa2e 100644 --- a/src/ansys/additive/core/examples/downloads.py +++ b/src/ansys/additive/core/examples/downloads.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + """Provides functions for downloading sample datasets from the PyAdditive repository.""" from http.client import HTTPMessage diff --git a/src/ansys/additive/core/geometry_file.py b/src/ansys/additive/core/geometry_file.py index ae36a2807..04aba2314 100644 --- a/src/ansys/additive/core/geometry_file.py +++ b/src/ansys/additive/core/geometry_file.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 enum import IntEnum from os.path import exists diff --git a/src/ansys/additive/core/machine.py b/src/ansys/additive/core/machine.py index fc3856ec6..90ca74596 100644 --- a/src/ansys/additive/core/machine.py +++ b/src/ansys/additive/core/machine.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import math from ansys.api.additive.v0.additive_domain_pb2 import MachineSettings as MachineMessage diff --git a/src/ansys/additive/core/material.py b/src/ansys/additive/core/material.py index 09da3ef18..629bdd1cf 100644 --- a/src/ansys/additive/core/material.py +++ b/src/ansys/additive/core/material.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import collections import csv import json diff --git a/src/ansys/additive/core/material_tuning.py b/src/ansys/additive/core/material_tuning.py index f060998be..c287cc765 100644 --- a/src/ansys/additive/core/material_tuning.py +++ b/src/ansys/additive/core/material_tuning.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import os from ansys.api.additive.v0.additive_domain_pb2 import ( diff --git a/src/ansys/additive/core/microstructure.py b/src/ansys/additive/core/microstructure.py index 92104ef7a..b8c8eb1ce 100644 --- a/src/ansys/additive/core/microstructure.py +++ b/src/ansys/additive/core/microstructure.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import math import os diff --git a/src/ansys/additive/core/misc.py b/src/ansys/additive/core/misc.py index ed672fe2e..0e5cb2f27 100644 --- a/src/ansys/additive/core/misc.py +++ b/src/ansys/additive/core/misc.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import random import socket import string diff --git a/src/ansys/additive/core/parametric_study/__init__.py b/src/ansys/additive/core/parametric_study/__init__.py index d5b06814f..ef7b3a3f5 100644 --- a/src/ansys/additive/core/parametric_study/__init__.py +++ b/src/ansys/additive/core/parametric_study/__init__.py @@ -1,4 +1,24 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 ansys.additive.core.parametric_study.constants import ( DEFAULT_ITERATION, diff --git a/src/ansys/additive/core/parametric_study/constants.py b/src/ansys/additive/core/parametric_study/constants.py index d673f1e9a..a4dade731 100644 --- a/src/ansys/additive/core/parametric_study/constants.py +++ b/src/ansys/additive/core/parametric_study/constants.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + class ColumnNames: """Provides column names for the parametric study data frame. diff --git a/src/ansys/additive/core/parametric_study/display/__init__.py b/src/ansys/additive/core/parametric_study/display/__init__.py index 0d8be8ff9..d0f7e0eee 100644 --- a/src/ansys/additive/core/parametric_study/display/__init__.py +++ b/src/ansys/additive/core/parametric_study/display/__init__.py @@ -1,4 +1,24 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 .ave_grain_size_plot import ave_grain_size_plot from .porosity_contour_plot import porosity_contour_plot diff --git a/src/ansys/additive/core/parametric_study/display/_common_controls.py b/src/ansys/additive/core/parametric_study/display/_common_controls.py index acf05ed22..3a4dc9934 100644 --- a/src/ansys/additive/core/parametric_study/display/_common_controls.py +++ b/src/ansys/additive/core/parametric_study/display/_common_controls.py @@ -1,4 +1,24 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. import pandas as pd import panel as pn diff --git a/src/ansys/additive/core/parametric_study/display/ave_grain_size_plot.py b/src/ansys/additive/core/parametric_study/display/ave_grain_size_plot.py index 33cbf6a7a..e6301ee66 100644 --- a/src/ansys/additive/core/parametric_study/display/ave_grain_size_plot.py +++ b/src/ansys/additive/core/parametric_study/display/ave_grain_size_plot.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Tuple import numpy as np diff --git a/src/ansys/additive/core/parametric_study/display/porosity_contour_plot.py b/src/ansys/additive/core/parametric_study/display/porosity_contour_plot.py index c8161d08a..8bdca21d3 100644 --- a/src/ansys/additive/core/parametric_study/display/porosity_contour_plot.py +++ b/src/ansys/additive/core/parametric_study/display/porosity_contour_plot.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Tuple import numpy as np diff --git a/src/ansys/additive/core/parametric_study/display/show_table.py b/src/ansys/additive/core/parametric_study/display/show_table.py index 2795d8d24..b80f5d7fc 100644 --- a/src/ansys/additive/core/parametric_study/display/show_table.py +++ b/src/ansys/additive/core/parametric_study/display/show_table.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Tuple import pandas as pd diff --git a/src/ansys/additive/core/parametric_study/display/single_bead_eval_plot.py b/src/ansys/additive/core/parametric_study/display/single_bead_eval_plot.py index 3bfdb2c50..46e39abdb 100644 --- a/src/ansys/additive/core/parametric_study/display/single_bead_eval_plot.py +++ b/src/ansys/additive/core/parametric_study/display/single_bead_eval_plot.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Tuple import numpy as np diff --git a/src/ansys/additive/core/parametric_study/parametric_runner.py b/src/ansys/additive/core/parametric_study/parametric_runner.py index 100a20e9d..ea59df0e1 100644 --- a/src/ansys/additive/core/parametric_study/parametric_runner.py +++ b/src/ansys/additive/core/parametric_study/parametric_runner.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import List, Optional, Union import numpy as np diff --git a/src/ansys/additive/core/parametric_study/parametric_study.py b/src/ansys/additive/core/parametric_study/parametric_study.py index 68c4fe8b8..30055cc69 100644 --- a/src/ansys/additive/core/parametric_study/parametric_study.py +++ b/src/ansys/additive/core/parametric_study/parametric_study.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Any, Dict, List, Optional, Union import dill diff --git a/src/ansys/additive/core/parametric_study/parametric_utils.py b/src/ansys/additive/core/parametric_study/parametric_utils.py index a665cecaf..716a954d6 100644 --- a/src/ansys/additive/core/parametric_study/parametric_utils.py +++ b/src/ansys/additive/core/parametric_study/parametric_utils.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Optional diff --git a/src/ansys/additive/core/porosity.py b/src/ansys/additive/core/porosity.py index bd1ba07cb..978d149e9 100644 --- a/src/ansys/additive/core/porosity.py +++ b/src/ansys/additive/core/porosity.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 ansys.api.additive.v0.additive_domain_pb2 import PorosityInput as PorosityInputMessage from ansys.api.additive.v0.additive_domain_pb2 import PorosityResult from ansys.api.additive.v0.additive_simulation_pb2 import SimulationRequest diff --git a/src/ansys/additive/core/progress_logger.py b/src/ansys/additive/core/progress_logger.py index 641b79d71..6d6d12f5d 100644 --- a/src/ansys/additive/core/progress_logger.py +++ b/src/ansys/additive/core/progress_logger.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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. + import logging from os import getenv diff --git a/src/ansys/additive/core/server_utils.py b/src/ansys/additive/core/server_utils.py index 1e47d3802..c7df4de7b 100644 --- a/src/ansys/additive/core/server_utils.py +++ b/src/ansys/additive/core/server_utils.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 datetime import datetime import os import subprocess diff --git a/src/ansys/additive/core/simulation.py b/src/ansys/additive/core/simulation.py index 8acafc561..cfb53b030 100644 --- a/src/ansys/additive/core/simulation.py +++ b/src/ansys/additive/core/simulation.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 typing import Union from ansys.additive.core.microstructure import MicrostructureInput diff --git a/src/ansys/additive/core/single_bead.py b/src/ansys/additive/core/single_bead.py index 5255e2a22..55375acc5 100644 --- a/src/ansys/additive/core/single_bead.py +++ b/src/ansys/additive/core/single_bead.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 ansys.api.additive.v0.additive_domain_pb2 import MeltPool as MeltPoolMessage from ansys.api.additive.v0.additive_domain_pb2 import SingleBeadInput as SingleBeadInputMessage from ansys.api.additive.v0.additive_simulation_pb2 import SimulationRequest diff --git a/src/ansys/additive/core/thermal_history.py b/src/ansys/additive/core/thermal_history.py index 5e3346dce..870a92831 100644 --- a/src/ansys/additive/core/thermal_history.py +++ b/src/ansys/additive/core/thermal_history.py @@ -1,4 +1,25 @@ -# (c) 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited. +# Copyright (C) 2023 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 ansys.api.additive.v0.additive_domain_pb2 import ( CoaxialAverageSensorInputs as CoaxialAverageSensorInputsMessage, ) diff --git a/src/ansys/additive/material.py b/src/ansys/additive/material.py new file mode 100644 index 000000000..61d15225d --- /dev/null +++ b/src/ansys/additive/material.py @@ -0,0 +1,845 @@ +# Copyright (C) 2023 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. + +import collections +import csv +import json +import re + +from ansys.api.additive.v0.additive_domain_pb2 import ( + CharacteristicWidthDataPoint as CharacteristicWidthDataPointMessage, +) +from ansys.api.additive.v0.additive_domain_pb2 import ( + ThermalPropertiesDataPoint as ThermalPropertiesDataPointMessage, +) +from ansys.api.additive.v0.additive_domain_pb2 import AdditiveMaterial as MaterialMessage + + +class CharacteristicWidthDataPoint: + """Container for a characteristic width data point. + + Additive material definitions include a file containing a + characteristic width lookup table which allows a given laser speed + and power to be correlated to a characteristic melt pool width. This + class represents a single row in the lookup table. + + Units are SI (m, kg, s, K) unless otherwise noted. + """ + + def __init__( + self, *, laser_power: float = 0, scan_speed: float = 0, characteristic_width: float = 0 + ): + """Create a ``CharacteristicWidthDataPoint``.""" + self._laser_power = laser_power + self._scan_speed = scan_speed + self._characteristic_width = characteristic_width + + def __repr__(self): + repr = type(self).__name__ + "\n" + for k in self.__dict__: + repr += k.replace("_", "", 1) + ": " + str(getattr(self, k)) + "\n" + return repr + + def __eq__(self, other: object) -> bool: + if not isinstance(other, CharacteristicWidthDataPoint): + return False + for k in self.__dict__: + if getattr(self, k) != getattr(other, k): + return False + return True + + @property + def characteristic_width(self) -> float: + """Characteristic melt pool width for a given laser power and scan + speed (m).""" + return self._characteristic_width + + @characteristic_width.setter + def characteristic_width(self, value: float): + """Set characteristic width value.""" + if value < 0: + raise ValueError("Characteristic width must not be negative.") + self._characteristic_width = value + + @property + def laser_power(self) -> float: + """Laser power (W).""" + return self._laser_power + + @laser_power.setter + def laser_power(self, value: float): + """Set power value.""" + if value < 0: + raise ValueError("Power must not be negative.") + self._laser_power = value + + @property + def scan_speed(self) -> float: + """Laser scan speed (m/s).""" + return self._scan_speed + + @scan_speed.setter + def scan_speed(self, value: float): + """Set speed value.""" + if value < 0: + raise ValueError("Speed must not be negative.") + self._scan_speed = value + + @staticmethod + def _from_characteristic_width_data_point_message(msg: CharacteristicWidthDataPointMessage): + """Create a ``CharacteristicWidthDataPoint`` from a characteristic data + point message received from Additive service.""" + if not isinstance(msg, CharacteristicWidthDataPointMessage): + raise ValueError( + "Invalid message object passed to from_characteristic_width_data_point_message()" + ) + point = CharacteristicWidthDataPoint() + for p in point.__dict__: + setattr(point, p, getattr(msg, p.replace("_", "", 1))) + return point + + def _to_characteristic_width_data_point_message( + self, + ) -> CharacteristicWidthDataPointMessage: + """Create a characteristic width data point message from this + ``CharacteristicWidthDataPoint`` to send to the Additive service.""" + msg = CharacteristicWidthDataPointMessage() + for p in self.__dict__: + setattr(msg, p.replace("_", "", 1), getattr(self, p)) + return msg + + +class ThermalPropertiesDataPoint: + """Container for a temperature dependent properties. + + Additive material definitions include a file containing a lookup + table which describes the material's thermal properties at different + temperatures. This class represents a single row in the lookup + table. + + Units are SI (m, kg, s, K) unless otherwise noted. + """ + + def __init__( + self, + *, + density: float = 0, + density_ratio: float = 0, + specific_heat: float = 0, + specific_heat_ratio: float = 0, + temperature: float = 0, + thermal_conductivity: float = 0, + thermal_conductivity_ratio: float = 0, + ): + """Create a ``ThermalPropertiesDataPoint``.""" + self._density = density + self._density_ratio = density_ratio + self._specific_heat = specific_heat + self._specific_heat_ratio = specific_heat_ratio + self._temperature = temperature + self._thermal_conductivity = thermal_conductivity + self._thermal_conductivity_ratio = thermal_conductivity_ratio + + def __repr__(self): + repr = type(self).__name__ + "\n" + for k in self.__dict__: + repr += k.replace("_", "", 1) + ": " + str(getattr(self, k)) + "\n" + return repr + + def __eq__(self, other: object) -> bool: + if not isinstance(other, ThermalPropertiesDataPoint): + return False + for k in self.__dict__: + if getattr(self, k) != getattr(other, k): + return False + return True + + @property + def density(self) -> float: + """Density (kg/m^3).""" + return self._density + + @density.setter + def density(self, value: float): + """Set density value.""" + if value < 0: + raise ValueError("Density must not be negative.") + self._density = value + + @property + def density_ratio(self) -> float: + """Density ratio.""" + return self._density_ratio + + @density_ratio.setter + def density_ratio(self, value: float): + """Set density_ratio value.""" + if value < 0: + raise ValueError("Density ratio must not be negative.") + self._density_ratio = value + + @property + def specific_heat(self) -> float: + """Specific heat (J/kg/K).""" + return self._specific_heat + + @specific_heat.setter + def specific_heat(self, value: float): + """Set specific heat.""" + self._specific_heat = value + + @property + def specific_heat_ratio(self) -> float: + """Specific heat ratio.""" + return self._specific_heat_ratio + + @specific_heat_ratio.setter + def specific_heat_ratio(self, value: float): + """Set specific heat ratio.""" + self._specific_heat_ratio = value + + @property + def temperature(self) -> float: + """Temperature (K).""" + return self._temperature + + @temperature.setter + def temperature(self, value: float): + """Set temperature.""" + if value < 0: + raise ValueError("Temperature must not be negative.") + self._temperature = value + + @property + def thermal_conductivity(self) -> float: + """Thermal conductivity (W/m/K).""" + return self._thermal_conductivity + + @thermal_conductivity.setter + def thermal_conductivity(self, value: float): + """Set thermal conductivity.""" + self._thermal_conductivity = value + + @property + def thermal_conductivity_ratio(self) -> float: + """Thermal conductivity ratio.""" + return self._thermal_conductivity_ratio + + @thermal_conductivity_ratio.setter + def thermal_conductivity_ratio(self, value: float): + """Set thermal conductivity ratio.""" + self._thermal_conductivity_ratio = value + + @staticmethod + def _from_thermal_properties_data_point_message(msg: ThermalPropertiesDataPointMessage): + """Create a ``ThermalPropertiesDataPoint`` from a thermal + characteristic data point message received from the Additive service. + + :meta private: + """ + if not isinstance(msg, ThermalPropertiesDataPointMessage): + raise ValueError( + "Invalid message object passed to from_thermal_properties_data_point_message()" + ) + point = ThermalPropertiesDataPoint() + for p in point.__dict__: + setattr(point, p, getattr(msg, p.replace("_", "", 1))) + return point + + def _to_thermal_properties_data_point_message( + self, + ) -> ThermalPropertiesDataPointMessage: + """Create a thermal characteristic data point message from this + ``ThermalPropertiesDataPoint`` object to send to the Additive service. + + :meta private: + """ + msg = ThermalPropertiesDataPointMessage() + for p in self.__dict__: + setattr(msg, p.replace("_", "", 1), getattr(self, p)) + return msg + + +class AdditiveMaterial: + """Container for material properties used during additive manufacturing + simulation.""" + + def __init__( + self, + *, + absorptivity_maximum: float = 0, + absorptivity_minimum: float = 0, + absorptivity_powder_coefficient_a: float = 0, + absorptivity_powder_coefficient_b: float = 0, + absorptivity_solid_coefficient_a: float = 0, + absorptivity_solid_coefficient_b: float = 0, + anisotropic_strain_coefficient_parallel: float = 0, + anisotropic_strain_coefficient_perpendicular: float = 0, + anisotropic_strain_coefficient_z: float = 0, + elastic_modulus: float = 0, + hardening_factor: float = 0, + liquidus_temperature: float = 0, + material_yield_strength: float = 0, + name: str = "", + nucleation_constant_bulk: float = 0, + nucleation_constant_interface: float = 0, + penetration_depth_maximum: float = 0, + penetration_depth_minimum: float = 0, + penetration_depth_powder_coefficient_a: float = 0, + penetration_depth_powder_coefficient_b: float = 0, + penetration_depth_solid_coefficient_a: float = 0, + penetration_depth_solid_coefficient_b: float = 0, + poisson_ratio: float = 0, + powder_packing_density: float = 0, + purging_gas_convection_coefficient: float = 0, + solid_density_at_room_temperature: float = 0, + solid_specific_heat_at_room_temperature: float = 0, + solid_thermal_conductivity_at_room_temperature: float = 0, + solidus_temperature: float = 0, + strain_scaling_factor: float = 0, + support_yield_strength_ratio: float = 0, + thermal_expansion_coefficient: float = 0, + vaporization_temperature: float = 0, + characteristic_width_data: list[CharacteristicWidthDataPoint] = None, + thermal_properties_data: list[ThermalPropertiesDataPoint] = None, + ): + """Create an ``AdditiveMaterial``.""" + self._absorptivity_maximum = absorptivity_maximum + self._absorptivity_minimum = absorptivity_minimum + self._absorptivity_powder_coefficient_a = absorptivity_powder_coefficient_a + self._absorptivity_powder_coefficient_b = absorptivity_powder_coefficient_b + self._absorptivity_solid_coefficient_a = absorptivity_solid_coefficient_a + self._absorptivity_solid_coefficient_b = absorptivity_solid_coefficient_b + self._anisotropic_strain_coefficient_parallel = anisotropic_strain_coefficient_parallel + self._anisotropic_strain_coefficient_perpendicular = ( + anisotropic_strain_coefficient_perpendicular + ) + self._anisotropic_strain_coefficient_z = anisotropic_strain_coefficient_z + self._elastic_modulus = elastic_modulus + self._hardening_factor = hardening_factor + self._liquidus_temperature = liquidus_temperature + self._material_yield_strength = material_yield_strength + self._name = name + self._nucleation_constant_bulk = nucleation_constant_bulk + self._nucleation_constant_interface = nucleation_constant_interface + self._penetration_depth_maximum = penetration_depth_maximum + self._penetration_depth_minimum = penetration_depth_minimum + self._penetration_depth_powder_coefficient_a = penetration_depth_powder_coefficient_a + self._penetration_depth_powder_coefficient_b = penetration_depth_powder_coefficient_b + self._penetration_depth_solid_coefficient_a = penetration_depth_solid_coefficient_a + self._penetration_depth_solid_coefficient_b = penetration_depth_solid_coefficient_b + self._poisson_ratio = poisson_ratio + self._powder_packing_density = powder_packing_density + self._purging_gas_convection_coefficient = purging_gas_convection_coefficient + self._solid_density_at_room_temperature = solid_density_at_room_temperature + self._solid_specific_heat_at_room_temperature = solid_specific_heat_at_room_temperature + self._solid_thermal_conductivity_at_room_temperature = ( + solid_thermal_conductivity_at_room_temperature + ) + self._solidus_temperature = solidus_temperature + self._strain_scaling_factor = strain_scaling_factor + self._support_yield_strength_ratio = support_yield_strength_ratio + self._thermal_expansion_coefficient = thermal_expansion_coefficient + self._vaporization_temperature = vaporization_temperature + if characteristic_width_data: + self._characteristic_width_data = characteristic_width_data + else: + self._characteristic_width_data = [] + if thermal_properties_data: + self._thermal_properties_data = thermal_properties_data + else: + self._thermal_properties_data = [] + + def __repr__(self) -> str: + repr = self.__class__.__name__ + "\n" + for p in self.__dict__: + if p != "_characteristic_width_data" and p != "_thermal_properties_data": + repr = repr + "{}: {}\n".format(p.replace("_", "", 1), getattr(self, p)) + repr = ( + repr + + "characteristic_width_data: CharacteristicWidthDataPoint[]\n" + + "thermal_properties_data: ThermalPropertiesDataPoint[]\n" + ) + return repr + + def __eq__(self, __o: object) -> bool: + if not isinstance(__o, AdditiveMaterial): + return False + for k in self.__dict__: + if getattr(self, k) != getattr(__o, k): + return False + return True + + @property + def absorptivity_maximum(self) -> float: + """Absorptivity maximum.""" + return self._absorptivity_maximum + + @absorptivity_maximum.setter + def absorptivity_maximum(self, value: float): + """Set absorptivity_maximum.""" + self._absorptivity_maximum = value + + @property + def absorptivity_minimum(self) -> float: + """Absorptivity minimum.""" + return self._absorptivity_minimum + + @absorptivity_minimum.setter + def absorptivity_minimum(self, value: float): + """Set absorptivity_minimum.""" + self._absorptivity_minimum = value + + @property + def absorptivity_powder_coefficient_a(self) -> float: + """Absorptivity powder coefficient a.""" + return self._absorptivity_powder_coefficient_a + + @absorptivity_powder_coefficient_a.setter + def absorptivity_powder_coefficient_a(self, value: float): + """Set absorptivity_powder_coefficient_a.""" + self._absorptivity_powder_coefficient_a = value + + @property + def absorptivity_powder_coefficient_b(self) -> float: + """Absorptivity powder coefficient b.""" + return self._absorptivity_powder_coefficient_b + + @absorptivity_powder_coefficient_b.setter + def absorptivity_powder_coefficient_b(self, value: float): + """Set absorptivity_powder_coefficient_b.""" + self._absorptivity_powder_coefficient_b = value + + @property + def absorptivity_solid_coefficient_a(self) -> float: + """Absorptivity solid coefficient a.""" + return self._absorptivity_solid_coefficient_a + + @absorptivity_solid_coefficient_a.setter + def absorptivity_solid_coefficient_a(self, value: float): + """Set absorptivity_solid_coefficient_a.""" + self._absorptivity_solid_coefficient_a = value + + @property + def absorptivity_solid_coefficient_b(self) -> float: + """Absorptivity solid coefficient b.""" + return self._absorptivity_solid_coefficient_b + + @absorptivity_solid_coefficient_b.setter + def absorptivity_solid_coefficient_b(self, value: float): + """Set absorptivity_solid_coefficient_b.""" + self._absorptivity_solid_coefficient_b = value + + @property + def anisotropic_strain_coefficient_parallel(self) -> float: + """Multiplier on the predicted strain in the direction that the laser + is scanning for the major fill rasters.""" + return self._anisotropic_strain_coefficient_parallel + + @anisotropic_strain_coefficient_parallel.setter + def anisotropic_strain_coefficient_parallel(self, value: float): + """Set anisotropic_strain_coefficient_parallel.""" + self._anisotropic_strain_coefficient_parallel = value + + @property + def anisotropic_strain_coefficient_perpendicular(self) -> float: + """Multiplier on the predicted strain orthogonal to the direction that + the laser is scanning for the major fill rasters and in the plane of + the surface of the build plate.""" + return self._anisotropic_strain_coefficient_perpendicular + + @anisotropic_strain_coefficient_perpendicular.setter + def anisotropic_strain_coefficient_perpendicular(self, value: float): + """Set anisotropic_strain_coefficient_perpendicular.""" + self._anisotropic_strain_coefficient_perpendicular = value + + @property + def anisotropic_strain_coefficient_z(self) -> float: + """Multiplier on the predicted strain in the Z direction.""" + return self._anisotropic_strain_coefficient_z + + @anisotropic_strain_coefficient_z.setter + def anisotropic_strain_coefficient_z(self, value: float): + """Set anisotropic_strain_coefficient_z.""" + self._anisotropic_strain_coefficient_z = value + + @property + def elastic_modulus(self) -> float: + """Elastic modulus (Pa).""" + return self._elastic_modulus + + @elastic_modulus.setter + def elastic_modulus(self, value: float): + """Set elastic_modulus.""" + self._elastic_modulus = value + + @property + def hardening_factor(self) -> float: + """Factor relating the elastic modulus to the tangent modulus for + plasticity simulations (tangent modulus = elastic modulus * hardening + factor ).""" + return self._hardening_factor + + @hardening_factor.setter + def hardening_factor(self, value: float): + """Set hardening_factor.""" + self._hardening_factor = value + + @property + def liquidus_temperature(self) -> float: + """Minimum temperature at which the material is completely liquid + (K).""" + return self._liquidus_temperature + + @liquidus_temperature.setter + def liquidus_temperature(self, value: float): + """Set liquidus_temperature.""" + self._liquidus_temperature = value + + @property + def material_yield_strength(self) -> float: + """Material yield strength (Pa).""" + return self._material_yield_strength + + @material_yield_strength.setter + def material_yield_strength(self, value: float): + """Set material_yield_strength.""" + self._material_yield_strength = value + + @property + def name(self) -> str: + """Name of material.""" + return self._name + + @name.setter + def name(self, value: str): + """Set name.""" + self._name = value + + @property + def nucleation_constant_bulk(self) -> float: + """Controls the homogeneous nucleation rate (in bulk of the + microstructure simulation domain) during solidification (1/m^2/K^2).""" + return self._nucleation_constant_bulk + + @nucleation_constant_bulk.setter + def nucleation_constant_bulk(self, value: float): + """Set nucleation_constant_bulk.""" + self._nucleation_constant_bulk = value + + @property + def nucleation_constant_interface(self) -> float: + """Controls the heterogeneous nucleation rate (on existing solid + interfaces) during solidification (1/m/K^2).""" + return self._nucleation_constant_interface + + @nucleation_constant_interface.setter + def nucleation_constant_interface(self, value: float): + """Set nucleation_constant_interface.""" + self._nucleation_constant_interface = value + + @property + def penetration_depth_maximum(self) -> float: + """Penetration depth maximum.""" + return self._penetration_depth_maximum + + @penetration_depth_maximum.setter + def penetration_depth_maximum(self, value: float): + """Set penetration_depth_maximum.""" + self._penetration_depth_maximum = value + + @property + def penetration_depth_minimum(self) -> float: + """Penetration depth minimum.""" + return self._penetration_depth_minimum + + @penetration_depth_minimum.setter + def penetration_depth_minimum(self, value: float): + """Set penetration_depth_minimum.""" + self._penetration_depth_minimum = value + + @property + def penetration_depth_powder_coefficient_a(self) -> float: + """Penetration depth powder coefficient a.""" + return self._penetration_depth_powder_coefficient_a + + @penetration_depth_powder_coefficient_a.setter + def penetration_depth_powder_coefficient_a(self, value: float): + """Set penetration_depth_powder_coefficient_a.""" + self._penetration_depth_powder_coefficient_a = value + + @property + def penetration_depth_powder_coefficient_b(self) -> float: + """Penetration depth powder coefficient b.""" + return self._penetration_depth_powder_coefficient_b + + @penetration_depth_powder_coefficient_b.setter + def penetration_depth_powder_coefficient_b(self, value: float): + """Set penetration_depth_powder_coefficient_b.""" + self._penetration_depth_powder_coefficient_b = value + + @property + def penetration_depth_solid_coefficient_a(self) -> float: + """Penetration depth solid coefficient a.""" + return self._penetration_depth_solid_coefficient_a + + @penetration_depth_solid_coefficient_a.setter + def penetration_depth_solid_coefficient_a(self, value: float): + """Set penetration_depth_solid_coefficient_a.""" + self._penetration_depth_solid_coefficient_a = value + + @property + def penetration_depth_solid_coefficient_b(self) -> float: + """Penetration depth solid coefficient b.""" + return self._penetration_depth_solid_coefficient_b + + @penetration_depth_solid_coefficient_b.setter + def penetration_depth_solid_coefficient_b(self, value: float): + """Set penetration_depth_solid_coefficient_b.""" + self._penetration_depth_solid_coefficient_b = value + + @property + def poisson_ratio(self) -> float: + """Poisson ratio.""" + return self._poisson_ratio + + @poisson_ratio.setter + def poisson_ratio(self, value: float): + """Set poisson_ratio.""" + self._poisson_ratio = value + + @property + def powder_packing_density(self) -> float: + """Density of powder material relative to the solid.""" + return self._powder_packing_density + + @powder_packing_density.setter + def powder_packing_density(self, value: float): + """Set powder_packing_density.""" + self._powder_packing_density = value + + @property + def purging_gas_convection_coefficient(self) -> float: + """Convection coefficient between the solid and gas during + processing.""" + return self._purging_gas_convection_coefficient + + @purging_gas_convection_coefficient.setter + def purging_gas_convection_coefficient(self, value: float): + """Set purging_gas_convection_coefficient.""" + self._purging_gas_convection_coefficient = value + + @property + def solid_density_at_room_temperature(self) -> float: + """Density of bulk material at room temperature, 298 K (kg/m^3).""" + return self._solid_density_at_room_temperature + + @solid_density_at_room_temperature.setter + def solid_density_at_room_temperature(self, value: float): + """Set solid_density_at_room_temperature.""" + self._solid_density_at_room_temperature = value + + @property + def solid_specific_heat_at_room_temperature(self) -> float: + """Specific heat of bulk material at room temperature, 298 K + (J/kg/K).""" + return self._solid_specific_heat_at_room_temperature + + @solid_specific_heat_at_room_temperature.setter + def solid_specific_heat_at_room_temperature(self, value: float): + """Set solid_specific_heat_at_room_temperature.""" + self._solid_specific_heat_at_room_temperature = value + + @property + def solid_thermal_conductivity_at_room_temperature(self) -> float: + """Thermal conductivity of bulk material at room temperature, 298 K + (W/m/K).""" + return self._solid_thermal_conductivity_at_room_temperature + + @solid_thermal_conductivity_at_room_temperature.setter + def solid_thermal_conductivity_at_room_temperature(self, value: float): + """Set solid_thermal_conductivity_at_room_temperature.""" + self._solid_thermal_conductivity_at_room_temperature = value + + @property + def solidus_temperature(self) -> float: + """Maximum temperature at which the material is completely solid + (K).""" + return self._solidus_temperature + + @solidus_temperature.setter + def solidus_temperature(self, value: float): + """Set solidus_temperature.""" + self._solidus_temperature = value + + @property + def strain_scaling_factor(self) -> float: + """Strain scaling factor.""" + return self._strain_scaling_factor + + @strain_scaling_factor.setter + def strain_scaling_factor(self, value: float): + """Set strain_scaling_factor.""" + self._strain_scaling_factor = value + + @property + def support_yield_strength_ratio(self) -> float: + """Factor to reduce the yield strength and elastic modulus of support + material.""" + return self._support_yield_strength_ratio + + @support_yield_strength_ratio.setter + def support_yield_strength_ratio(self, value: float): + """Set support_yield_strength_ratio.""" + self._support_yield_strength_ratio = value + + @property + def thermal_expansion_coefficient(self) -> float: + """Coefficient of thermal expansion (1/K).""" + return self._thermal_expansion_coefficient + + @thermal_expansion_coefficient.setter + def thermal_expansion_coefficient(self, value: float): + """Set thermal_expansion_coefficient.""" + self._thermal_expansion_coefficient = value + + @property + def vaporization_temperature(self) -> float: + """Temperature at which material has completely changed from liquid to + vapor (K).""" + return self._vaporization_temperature + + @vaporization_temperature.setter + def vaporization_temperature(self, value: float): + """Set vaporization_temperature (K).""" + self._vaporization_temperature = value + + @property + def characteristic_width_data(self) -> list[CharacteristicWidthDataPoint]: + """List of :class:`CharacteristicWidthDataPoint`.""" + return self._characteristic_width_data + + @characteristic_width_data.setter + def characteristic_width_data(self, value: list[CharacteristicWidthDataPoint]): + """Set characteristic_width_data.""" + if not isinstance(value, collections.abc.Sequence): + raise TypeError( + "Invalid object type, {}, passed to characteristic_width_data()".format(type(value)) + ) + self._characteristic_width_data = value + + @property + def thermal_properties_data(self) -> list[ThermalPropertiesDataPoint]: + """List of :class:`ThermalPropertiesDataPoint`.""" + return self._thermal_properties_data + + @thermal_properties_data.setter + def thermal_properties_data(self, value: list[ThermalPropertiesDataPoint]): + """Set thermal_properties_data.""" + if not isinstance(value, collections.abc.Sequence): + raise TypeError( + "Invalid object type, {}, passed to thermal_properties_data()".format(type(value)) + ) + self._thermal_properties_data = value + + @staticmethod + def _from_material_message(msg: MaterialMessage): + """Create an ``AdditiveMaterial`` object from a material message + received from the Additive service.""" + if not isinstance(msg, MaterialMessage): + raise ValueError("Invalid message object passed to from_material_message()") + material = AdditiveMaterial() + for p in material.__dict__: + if p != "_characteristic_width_data" and p != "_thermal_properties_data": + setattr(material, p, getattr(msg, p.replace("_", "", 1))) + for c in msg.characteristic_width_data_points: + material.characteristic_width_data.append( + CharacteristicWidthDataPoint._from_characteristic_width_data_point_message(c) + ) + for t in msg.thermal_properties_data_points: + material.thermal_properties_data.append( + ThermalPropertiesDataPoint._from_thermal_properties_data_point_message(t) + ) + return material + + def _to_material_message(self) -> MaterialMessage: + """Create a material message from this ``AdditiveMaterial`` to send to + the Additive service.""" + msg = MaterialMessage() + for p in self.__dict__: + if p != "_characteristic_width_data" and p != "_thermal_properties_data": + setattr(msg, p.replace("_", "", 1), getattr(self, p)) + for c in self.characteristic_width_data: + msg.characteristic_width_data_points.append( + c._to_characteristic_width_data_point_message() + ) + for t in self.thermal_properties_data: + msg.thermal_properties_data_points.append(t._to_thermal_properties_data_point_message()) + return msg + + def _load_parameters(self, parameters_file: str): + """Load material parameters from a json file.""" + with open(parameters_file, "r") as f: + data = json.load(f) + self.name = data["name"] + parameters = data["configuration"] + # Convert camelCase to snake_case + pattern = re.compile(r"(? Date: Tue, 5 Sep 2023 17:02:27 -0400 Subject: [PATCH 2/5] code style fix --- src/ansys/additive/core/parametric_study/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ansys/additive/core/parametric_study/constants.py b/src/ansys/additive/core/parametric_study/constants.py index a4dade731..0cb7a02cb 100644 --- a/src/ansys/additive/core/parametric_study/constants.py +++ b/src/ansys/additive/core/parametric_study/constants.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. + class ColumnNames: """Provides column names for the parametric study data frame. From bf3367c033bbfcc82b3ef1730601afb8dabb6c88 Mon Sep 17 00:00:00 2001 From: Kerry McAdams Date: Tue, 5 Sep 2023 17:10:07 -0400 Subject: [PATCH 3/5] code style checks --- src/ansys/additive/core/__init__.py | 1 - src/ansys/additive/core/additive.py | 1 - src/ansys/additive/core/examples/__init__.py | 1 - src/ansys/additive/core/examples/downloads.py | 1 - 4 files changed, 4 deletions(-) diff --git a/src/ansys/additive/core/__init__.py b/src/ansys/additive/core/__init__.py index b1b413425..1f5fc2bcf 100644 --- a/src/ansys/additive/core/__init__.py +++ b/src/ansys/additive/core/__init__.py @@ -19,7 +19,6 @@ # 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. - """Python client for the Ansys Additive service.""" import os diff --git a/src/ansys/additive/core/additive.py b/src/ansys/additive/core/additive.py index c3c95505d..0b8f96cda 100644 --- a/src/ansys/additive/core/additive.py +++ b/src/ansys/additive/core/additive.py @@ -19,7 +19,6 @@ # 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. - """Provides for interacting with the Additive service.""" import concurrent.futures from datetime import datetime diff --git a/src/ansys/additive/core/examples/__init__.py b/src/ansys/additive/core/examples/__init__.py index d8d648083..7ace3f88f 100644 --- a/src/ansys/additive/core/examples/__init__.py +++ b/src/ansys/additive/core/examples/__init__.py @@ -19,7 +19,6 @@ # 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. - """Provides utilities for use with PyAdditive examples.""" from ansys.additive.core.examples.downloads import ( diff --git a/src/ansys/additive/core/examples/downloads.py b/src/ansys/additive/core/examples/downloads.py index 69a3daa2e..c5dde062a 100644 --- a/src/ansys/additive/core/examples/downloads.py +++ b/src/ansys/additive/core/examples/downloads.py @@ -19,7 +19,6 @@ # 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. - """Provides functions for downloading sample datasets from the PyAdditive repository.""" from http.client import HTTPMessage From fd5b6e218ae44cdf1ce006ca505dd41d6711fa06 Mon Sep 17 00:00:00 2001 From: Kerry McAdams Date: Wed, 6 Sep 2023 08:57:26 -0400 Subject: [PATCH 4/5] fixed dep5 file, added headers to tests/ and examples/ --- .pre-commit-config.yaml | 4 +- .reuse/dep5 | 28 +- examples/00_additive_single_bead.py | 22 + examples/01_additive_porosity.py | 22 + examples/02_additive_microstructure.py | 22 + examples/03_additive_thermal_history.py | 22 + examples/04_additive_doe.py | 22 + examples/05_advanced_optimization_workflow.py | 22 + .../06_advanced_custom_material_tuning.py | 22 + examples/07_using_a_custom_material.py | 22 + examples/README.rst | 22 + scripts/update-copyright.py | 42 - src/ansys/additive/material.py | 845 ------------------ .../test_parametric_runner.py | 22 + .../parametric_study/test_parametric_study.py | 22 + .../parametric_study/test_parametric_utils.py | 22 + tests/test_additive.py | 22 + tests/test_download.py | 22 + tests/test_examples.py | 22 + tests/test_geometry_file.py | 22 + tests/test_machine.py | 22 + tests/test_material.py | 22 + tests/test_material_tuning.py | 22 + tests/test_microstructure.py | 22 + tests/test_misc.py | 22 + tests/test_porosity.py | 22 + tests/test_server_utils.py | 22 + tests/test_simulation.py | 22 + tests/test_single_bead.py | 22 + tests/test_thermal_history.py | 22 + tests/test_utils.py | 22 + 31 files changed, 615 insertions(+), 898 deletions(-) delete mode 100644 scripts/update-copyright.py delete mode 100644 src/ansys/additive/material.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62a3f74a7..df1bf6eb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,4 +59,6 @@ repos: - repo: https://github.com/ansys/pre-commit-hooks rev: v0.1.2 hooks: - - id: add-license-headers \ No newline at end of file + - id: add-license-headers + args: + - --loc=./ \ No newline at end of file diff --git a/.reuse/dep5 b/.reuse/dep5 index 4e4743294..b06359f05 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -15,15 +15,7 @@ Files: doc/* Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT -Files: examples/* -Copyright: 2023 ANSYS, Inc. and/or its affiliates. -License: MIT - -Files: LICENSES/* -Copyright: 2023 ANSYS, Inc. and/or its affiliates. -License: MIT - -Files: tests/* +Files: docker/* Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT @@ -43,7 +35,7 @@ Files: .pre-commit-config.yaml Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT -Files: .pre-commit-hooks.yaml +Files: AUTHORS Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT @@ -59,6 +51,10 @@ Files: CONTRIBUTING.md Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT +Files: CONTRIBUTORS.md +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + Files: pyproject.toml Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT @@ -69,4 +65,16 @@ License: MIT Files: tox.ini Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: *.json +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: *.csv +Copyright: 2023 ANSYS, Inc. and/or its affiliates. +License: MIT + +Files: *.zip +Copyright: 2023 ANSYS, Inc. and/or its affiliates. License: MIT \ No newline at end of file diff --git a/examples/00_additive_single_bead.py b/examples/00_additive_single_bead.py index 0081dc5c1..5401850c0 100644 --- a/examples/00_additive_single_bead.py +++ b/examples/00_additive_single_bead.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Single bead analysis ==================== diff --git a/examples/01_additive_porosity.py b/examples/01_additive_porosity.py index 09e17a1f7..4b8708351 100644 --- a/examples/01_additive_porosity.py +++ b/examples/01_additive_porosity.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Porosity analysis ================= diff --git a/examples/02_additive_microstructure.py b/examples/02_additive_microstructure.py index 6d80ac7d7..7e6371e1f 100644 --- a/examples/02_additive_microstructure.py +++ b/examples/02_additive_microstructure.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Microstructure analysis ####################### diff --git a/examples/03_additive_thermal_history.py b/examples/03_additive_thermal_history.py index d68f12cb8..4c8bc0208 100644 --- a/examples/03_additive_thermal_history.py +++ b/examples/03_additive_thermal_history.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Thermal history analysis ======================== diff --git a/examples/04_additive_doe.py b/examples/04_additive_doe.py index e4b6fff9d..7bd557fdf 100644 --- a/examples/04_additive_doe.py +++ b/examples/04_additive_doe.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Design of experiments ===================== diff --git a/examples/05_advanced_optimization_workflow.py b/examples/05_advanced_optimization_workflow.py index 5d4971a3f..d5d897f2e 100644 --- a/examples/05_advanced_optimization_workflow.py +++ b/examples/05_advanced_optimization_workflow.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Optimization workflow analysis ============================== diff --git a/examples/06_advanced_custom_material_tuning.py b/examples/06_advanced_custom_material_tuning.py index 9c3e62380..6a04c5de4 100644 --- a/examples/06_advanced_custom_material_tuning.py +++ b/examples/06_advanced_custom_material_tuning.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Custom material tuning ====================== diff --git a/examples/07_using_a_custom_material.py b/examples/07_using_a_custom_material.py index 37b0bb988..b1c98147c 100644 --- a/examples/07_using_a_custom_material.py +++ b/examples/07_using_a_custom_material.py @@ -1,3 +1,25 @@ +# Copyright (C) 2023 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. + """ Using a custom material ======================= diff --git a/examples/README.rst b/examples/README.rst index 163eb21f0..d8fb1806b 100644 --- a/examples/README.rst +++ b/examples/README.rst @@ -1,3 +1,25 @@ +.. Copyright (C) 2023 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. + .. _ref_example_gallery: ======== diff --git a/scripts/update-copyright.py b/scripts/update-copyright.py deleted file mode 100644 index 85397910a..000000000 --- a/scripts/update-copyright.py +++ /dev/null @@ -1,42 +0,0 @@ -import argparse -import codecs -from datetime import date -import glob -import os -import shutil -import tempfile - -REPO_ROOT = os.path.dirname(os.path.dirname(__file__)) - -copyright_substr = "ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited." - - -def get_args(): - parser = argparse.ArgumentParser( - description="Update copyright in python files or add copyright if it is missing." - ) - return parser.parse_args() - - -if __name__ == "__main__": - _ = get_args() - dirs = ["src", "tests", "scripts", "examples"] - for d in dirs: - source_files = glob.glob(os.path.join(REPO_ROOT, d, "**", "*.py"), recursive=True) - for f in source_files: - lines = [] - with open(f, "r") as file: - lines = file.readlines() - if len(lines) == 0: - continue - if copyright_substr in lines[0]: - del lines[0] - lines[0] = lines[0].strip(codecs.BOM_UTF8.decode(file.encoding)) - - tmp_name = "" - with tempfile.NamedTemporaryFile("w", delete=False) as tmp: - tmp.write("# (c) {} ".format(date.today().year) + copyright_substr + "\n") - tmp.writelines(lines) - tmp_name = tmp.name - - shutil.move(tmp_name, f) diff --git a/src/ansys/additive/material.py b/src/ansys/additive/material.py deleted file mode 100644 index 61d15225d..000000000 --- a/src/ansys/additive/material.py +++ /dev/null @@ -1,845 +0,0 @@ -# Copyright (C) 2023 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. - -import collections -import csv -import json -import re - -from ansys.api.additive.v0.additive_domain_pb2 import ( - CharacteristicWidthDataPoint as CharacteristicWidthDataPointMessage, -) -from ansys.api.additive.v0.additive_domain_pb2 import ( - ThermalPropertiesDataPoint as ThermalPropertiesDataPointMessage, -) -from ansys.api.additive.v0.additive_domain_pb2 import AdditiveMaterial as MaterialMessage - - -class CharacteristicWidthDataPoint: - """Container for a characteristic width data point. - - Additive material definitions include a file containing a - characteristic width lookup table which allows a given laser speed - and power to be correlated to a characteristic melt pool width. This - class represents a single row in the lookup table. - - Units are SI (m, kg, s, K) unless otherwise noted. - """ - - def __init__( - self, *, laser_power: float = 0, scan_speed: float = 0, characteristic_width: float = 0 - ): - """Create a ``CharacteristicWidthDataPoint``.""" - self._laser_power = laser_power - self._scan_speed = scan_speed - self._characteristic_width = characteristic_width - - def __repr__(self): - repr = type(self).__name__ + "\n" - for k in self.__dict__: - repr += k.replace("_", "", 1) + ": " + str(getattr(self, k)) + "\n" - return repr - - def __eq__(self, other: object) -> bool: - if not isinstance(other, CharacteristicWidthDataPoint): - return False - for k in self.__dict__: - if getattr(self, k) != getattr(other, k): - return False - return True - - @property - def characteristic_width(self) -> float: - """Characteristic melt pool width for a given laser power and scan - speed (m).""" - return self._characteristic_width - - @characteristic_width.setter - def characteristic_width(self, value: float): - """Set characteristic width value.""" - if value < 0: - raise ValueError("Characteristic width must not be negative.") - self._characteristic_width = value - - @property - def laser_power(self) -> float: - """Laser power (W).""" - return self._laser_power - - @laser_power.setter - def laser_power(self, value: float): - """Set power value.""" - if value < 0: - raise ValueError("Power must not be negative.") - self._laser_power = value - - @property - def scan_speed(self) -> float: - """Laser scan speed (m/s).""" - return self._scan_speed - - @scan_speed.setter - def scan_speed(self, value: float): - """Set speed value.""" - if value < 0: - raise ValueError("Speed must not be negative.") - self._scan_speed = value - - @staticmethod - def _from_characteristic_width_data_point_message(msg: CharacteristicWidthDataPointMessage): - """Create a ``CharacteristicWidthDataPoint`` from a characteristic data - point message received from Additive service.""" - if not isinstance(msg, CharacteristicWidthDataPointMessage): - raise ValueError( - "Invalid message object passed to from_characteristic_width_data_point_message()" - ) - point = CharacteristicWidthDataPoint() - for p in point.__dict__: - setattr(point, p, getattr(msg, p.replace("_", "", 1))) - return point - - def _to_characteristic_width_data_point_message( - self, - ) -> CharacteristicWidthDataPointMessage: - """Create a characteristic width data point message from this - ``CharacteristicWidthDataPoint`` to send to the Additive service.""" - msg = CharacteristicWidthDataPointMessage() - for p in self.__dict__: - setattr(msg, p.replace("_", "", 1), getattr(self, p)) - return msg - - -class ThermalPropertiesDataPoint: - """Container for a temperature dependent properties. - - Additive material definitions include a file containing a lookup - table which describes the material's thermal properties at different - temperatures. This class represents a single row in the lookup - table. - - Units are SI (m, kg, s, K) unless otherwise noted. - """ - - def __init__( - self, - *, - density: float = 0, - density_ratio: float = 0, - specific_heat: float = 0, - specific_heat_ratio: float = 0, - temperature: float = 0, - thermal_conductivity: float = 0, - thermal_conductivity_ratio: float = 0, - ): - """Create a ``ThermalPropertiesDataPoint``.""" - self._density = density - self._density_ratio = density_ratio - self._specific_heat = specific_heat - self._specific_heat_ratio = specific_heat_ratio - self._temperature = temperature - self._thermal_conductivity = thermal_conductivity - self._thermal_conductivity_ratio = thermal_conductivity_ratio - - def __repr__(self): - repr = type(self).__name__ + "\n" - for k in self.__dict__: - repr += k.replace("_", "", 1) + ": " + str(getattr(self, k)) + "\n" - return repr - - def __eq__(self, other: object) -> bool: - if not isinstance(other, ThermalPropertiesDataPoint): - return False - for k in self.__dict__: - if getattr(self, k) != getattr(other, k): - return False - return True - - @property - def density(self) -> float: - """Density (kg/m^3).""" - return self._density - - @density.setter - def density(self, value: float): - """Set density value.""" - if value < 0: - raise ValueError("Density must not be negative.") - self._density = value - - @property - def density_ratio(self) -> float: - """Density ratio.""" - return self._density_ratio - - @density_ratio.setter - def density_ratio(self, value: float): - """Set density_ratio value.""" - if value < 0: - raise ValueError("Density ratio must not be negative.") - self._density_ratio = value - - @property - def specific_heat(self) -> float: - """Specific heat (J/kg/K).""" - return self._specific_heat - - @specific_heat.setter - def specific_heat(self, value: float): - """Set specific heat.""" - self._specific_heat = value - - @property - def specific_heat_ratio(self) -> float: - """Specific heat ratio.""" - return self._specific_heat_ratio - - @specific_heat_ratio.setter - def specific_heat_ratio(self, value: float): - """Set specific heat ratio.""" - self._specific_heat_ratio = value - - @property - def temperature(self) -> float: - """Temperature (K).""" - return self._temperature - - @temperature.setter - def temperature(self, value: float): - """Set temperature.""" - if value < 0: - raise ValueError("Temperature must not be negative.") - self._temperature = value - - @property - def thermal_conductivity(self) -> float: - """Thermal conductivity (W/m/K).""" - return self._thermal_conductivity - - @thermal_conductivity.setter - def thermal_conductivity(self, value: float): - """Set thermal conductivity.""" - self._thermal_conductivity = value - - @property - def thermal_conductivity_ratio(self) -> float: - """Thermal conductivity ratio.""" - return self._thermal_conductivity_ratio - - @thermal_conductivity_ratio.setter - def thermal_conductivity_ratio(self, value: float): - """Set thermal conductivity ratio.""" - self._thermal_conductivity_ratio = value - - @staticmethod - def _from_thermal_properties_data_point_message(msg: ThermalPropertiesDataPointMessage): - """Create a ``ThermalPropertiesDataPoint`` from a thermal - characteristic data point message received from the Additive service. - - :meta private: - """ - if not isinstance(msg, ThermalPropertiesDataPointMessage): - raise ValueError( - "Invalid message object passed to from_thermal_properties_data_point_message()" - ) - point = ThermalPropertiesDataPoint() - for p in point.__dict__: - setattr(point, p, getattr(msg, p.replace("_", "", 1))) - return point - - def _to_thermal_properties_data_point_message( - self, - ) -> ThermalPropertiesDataPointMessage: - """Create a thermal characteristic data point message from this - ``ThermalPropertiesDataPoint`` object to send to the Additive service. - - :meta private: - """ - msg = ThermalPropertiesDataPointMessage() - for p in self.__dict__: - setattr(msg, p.replace("_", "", 1), getattr(self, p)) - return msg - - -class AdditiveMaterial: - """Container for material properties used during additive manufacturing - simulation.""" - - def __init__( - self, - *, - absorptivity_maximum: float = 0, - absorptivity_minimum: float = 0, - absorptivity_powder_coefficient_a: float = 0, - absorptivity_powder_coefficient_b: float = 0, - absorptivity_solid_coefficient_a: float = 0, - absorptivity_solid_coefficient_b: float = 0, - anisotropic_strain_coefficient_parallel: float = 0, - anisotropic_strain_coefficient_perpendicular: float = 0, - anisotropic_strain_coefficient_z: float = 0, - elastic_modulus: float = 0, - hardening_factor: float = 0, - liquidus_temperature: float = 0, - material_yield_strength: float = 0, - name: str = "", - nucleation_constant_bulk: float = 0, - nucleation_constant_interface: float = 0, - penetration_depth_maximum: float = 0, - penetration_depth_minimum: float = 0, - penetration_depth_powder_coefficient_a: float = 0, - penetration_depth_powder_coefficient_b: float = 0, - penetration_depth_solid_coefficient_a: float = 0, - penetration_depth_solid_coefficient_b: float = 0, - poisson_ratio: float = 0, - powder_packing_density: float = 0, - purging_gas_convection_coefficient: float = 0, - solid_density_at_room_temperature: float = 0, - solid_specific_heat_at_room_temperature: float = 0, - solid_thermal_conductivity_at_room_temperature: float = 0, - solidus_temperature: float = 0, - strain_scaling_factor: float = 0, - support_yield_strength_ratio: float = 0, - thermal_expansion_coefficient: float = 0, - vaporization_temperature: float = 0, - characteristic_width_data: list[CharacteristicWidthDataPoint] = None, - thermal_properties_data: list[ThermalPropertiesDataPoint] = None, - ): - """Create an ``AdditiveMaterial``.""" - self._absorptivity_maximum = absorptivity_maximum - self._absorptivity_minimum = absorptivity_minimum - self._absorptivity_powder_coefficient_a = absorptivity_powder_coefficient_a - self._absorptivity_powder_coefficient_b = absorptivity_powder_coefficient_b - self._absorptivity_solid_coefficient_a = absorptivity_solid_coefficient_a - self._absorptivity_solid_coefficient_b = absorptivity_solid_coefficient_b - self._anisotropic_strain_coefficient_parallel = anisotropic_strain_coefficient_parallel - self._anisotropic_strain_coefficient_perpendicular = ( - anisotropic_strain_coefficient_perpendicular - ) - self._anisotropic_strain_coefficient_z = anisotropic_strain_coefficient_z - self._elastic_modulus = elastic_modulus - self._hardening_factor = hardening_factor - self._liquidus_temperature = liquidus_temperature - self._material_yield_strength = material_yield_strength - self._name = name - self._nucleation_constant_bulk = nucleation_constant_bulk - self._nucleation_constant_interface = nucleation_constant_interface - self._penetration_depth_maximum = penetration_depth_maximum - self._penetration_depth_minimum = penetration_depth_minimum - self._penetration_depth_powder_coefficient_a = penetration_depth_powder_coefficient_a - self._penetration_depth_powder_coefficient_b = penetration_depth_powder_coefficient_b - self._penetration_depth_solid_coefficient_a = penetration_depth_solid_coefficient_a - self._penetration_depth_solid_coefficient_b = penetration_depth_solid_coefficient_b - self._poisson_ratio = poisson_ratio - self._powder_packing_density = powder_packing_density - self._purging_gas_convection_coefficient = purging_gas_convection_coefficient - self._solid_density_at_room_temperature = solid_density_at_room_temperature - self._solid_specific_heat_at_room_temperature = solid_specific_heat_at_room_temperature - self._solid_thermal_conductivity_at_room_temperature = ( - solid_thermal_conductivity_at_room_temperature - ) - self._solidus_temperature = solidus_temperature - self._strain_scaling_factor = strain_scaling_factor - self._support_yield_strength_ratio = support_yield_strength_ratio - self._thermal_expansion_coefficient = thermal_expansion_coefficient - self._vaporization_temperature = vaporization_temperature - if characteristic_width_data: - self._characteristic_width_data = characteristic_width_data - else: - self._characteristic_width_data = [] - if thermal_properties_data: - self._thermal_properties_data = thermal_properties_data - else: - self._thermal_properties_data = [] - - def __repr__(self) -> str: - repr = self.__class__.__name__ + "\n" - for p in self.__dict__: - if p != "_characteristic_width_data" and p != "_thermal_properties_data": - repr = repr + "{}: {}\n".format(p.replace("_", "", 1), getattr(self, p)) - repr = ( - repr - + "characteristic_width_data: CharacteristicWidthDataPoint[]\n" - + "thermal_properties_data: ThermalPropertiesDataPoint[]\n" - ) - return repr - - def __eq__(self, __o: object) -> bool: - if not isinstance(__o, AdditiveMaterial): - return False - for k in self.__dict__: - if getattr(self, k) != getattr(__o, k): - return False - return True - - @property - def absorptivity_maximum(self) -> float: - """Absorptivity maximum.""" - return self._absorptivity_maximum - - @absorptivity_maximum.setter - def absorptivity_maximum(self, value: float): - """Set absorptivity_maximum.""" - self._absorptivity_maximum = value - - @property - def absorptivity_minimum(self) -> float: - """Absorptivity minimum.""" - return self._absorptivity_minimum - - @absorptivity_minimum.setter - def absorptivity_minimum(self, value: float): - """Set absorptivity_minimum.""" - self._absorptivity_minimum = value - - @property - def absorptivity_powder_coefficient_a(self) -> float: - """Absorptivity powder coefficient a.""" - return self._absorptivity_powder_coefficient_a - - @absorptivity_powder_coefficient_a.setter - def absorptivity_powder_coefficient_a(self, value: float): - """Set absorptivity_powder_coefficient_a.""" - self._absorptivity_powder_coefficient_a = value - - @property - def absorptivity_powder_coefficient_b(self) -> float: - """Absorptivity powder coefficient b.""" - return self._absorptivity_powder_coefficient_b - - @absorptivity_powder_coefficient_b.setter - def absorptivity_powder_coefficient_b(self, value: float): - """Set absorptivity_powder_coefficient_b.""" - self._absorptivity_powder_coefficient_b = value - - @property - def absorptivity_solid_coefficient_a(self) -> float: - """Absorptivity solid coefficient a.""" - return self._absorptivity_solid_coefficient_a - - @absorptivity_solid_coefficient_a.setter - def absorptivity_solid_coefficient_a(self, value: float): - """Set absorptivity_solid_coefficient_a.""" - self._absorptivity_solid_coefficient_a = value - - @property - def absorptivity_solid_coefficient_b(self) -> float: - """Absorptivity solid coefficient b.""" - return self._absorptivity_solid_coefficient_b - - @absorptivity_solid_coefficient_b.setter - def absorptivity_solid_coefficient_b(self, value: float): - """Set absorptivity_solid_coefficient_b.""" - self._absorptivity_solid_coefficient_b = value - - @property - def anisotropic_strain_coefficient_parallel(self) -> float: - """Multiplier on the predicted strain in the direction that the laser - is scanning for the major fill rasters.""" - return self._anisotropic_strain_coefficient_parallel - - @anisotropic_strain_coefficient_parallel.setter - def anisotropic_strain_coefficient_parallel(self, value: float): - """Set anisotropic_strain_coefficient_parallel.""" - self._anisotropic_strain_coefficient_parallel = value - - @property - def anisotropic_strain_coefficient_perpendicular(self) -> float: - """Multiplier on the predicted strain orthogonal to the direction that - the laser is scanning for the major fill rasters and in the plane of - the surface of the build plate.""" - return self._anisotropic_strain_coefficient_perpendicular - - @anisotropic_strain_coefficient_perpendicular.setter - def anisotropic_strain_coefficient_perpendicular(self, value: float): - """Set anisotropic_strain_coefficient_perpendicular.""" - self._anisotropic_strain_coefficient_perpendicular = value - - @property - def anisotropic_strain_coefficient_z(self) -> float: - """Multiplier on the predicted strain in the Z direction.""" - return self._anisotropic_strain_coefficient_z - - @anisotropic_strain_coefficient_z.setter - def anisotropic_strain_coefficient_z(self, value: float): - """Set anisotropic_strain_coefficient_z.""" - self._anisotropic_strain_coefficient_z = value - - @property - def elastic_modulus(self) -> float: - """Elastic modulus (Pa).""" - return self._elastic_modulus - - @elastic_modulus.setter - def elastic_modulus(self, value: float): - """Set elastic_modulus.""" - self._elastic_modulus = value - - @property - def hardening_factor(self) -> float: - """Factor relating the elastic modulus to the tangent modulus for - plasticity simulations (tangent modulus = elastic modulus * hardening - factor ).""" - return self._hardening_factor - - @hardening_factor.setter - def hardening_factor(self, value: float): - """Set hardening_factor.""" - self._hardening_factor = value - - @property - def liquidus_temperature(self) -> float: - """Minimum temperature at which the material is completely liquid - (K).""" - return self._liquidus_temperature - - @liquidus_temperature.setter - def liquidus_temperature(self, value: float): - """Set liquidus_temperature.""" - self._liquidus_temperature = value - - @property - def material_yield_strength(self) -> float: - """Material yield strength (Pa).""" - return self._material_yield_strength - - @material_yield_strength.setter - def material_yield_strength(self, value: float): - """Set material_yield_strength.""" - self._material_yield_strength = value - - @property - def name(self) -> str: - """Name of material.""" - return self._name - - @name.setter - def name(self, value: str): - """Set name.""" - self._name = value - - @property - def nucleation_constant_bulk(self) -> float: - """Controls the homogeneous nucleation rate (in bulk of the - microstructure simulation domain) during solidification (1/m^2/K^2).""" - return self._nucleation_constant_bulk - - @nucleation_constant_bulk.setter - def nucleation_constant_bulk(self, value: float): - """Set nucleation_constant_bulk.""" - self._nucleation_constant_bulk = value - - @property - def nucleation_constant_interface(self) -> float: - """Controls the heterogeneous nucleation rate (on existing solid - interfaces) during solidification (1/m/K^2).""" - return self._nucleation_constant_interface - - @nucleation_constant_interface.setter - def nucleation_constant_interface(self, value: float): - """Set nucleation_constant_interface.""" - self._nucleation_constant_interface = value - - @property - def penetration_depth_maximum(self) -> float: - """Penetration depth maximum.""" - return self._penetration_depth_maximum - - @penetration_depth_maximum.setter - def penetration_depth_maximum(self, value: float): - """Set penetration_depth_maximum.""" - self._penetration_depth_maximum = value - - @property - def penetration_depth_minimum(self) -> float: - """Penetration depth minimum.""" - return self._penetration_depth_minimum - - @penetration_depth_minimum.setter - def penetration_depth_minimum(self, value: float): - """Set penetration_depth_minimum.""" - self._penetration_depth_minimum = value - - @property - def penetration_depth_powder_coefficient_a(self) -> float: - """Penetration depth powder coefficient a.""" - return self._penetration_depth_powder_coefficient_a - - @penetration_depth_powder_coefficient_a.setter - def penetration_depth_powder_coefficient_a(self, value: float): - """Set penetration_depth_powder_coefficient_a.""" - self._penetration_depth_powder_coefficient_a = value - - @property - def penetration_depth_powder_coefficient_b(self) -> float: - """Penetration depth powder coefficient b.""" - return self._penetration_depth_powder_coefficient_b - - @penetration_depth_powder_coefficient_b.setter - def penetration_depth_powder_coefficient_b(self, value: float): - """Set penetration_depth_powder_coefficient_b.""" - self._penetration_depth_powder_coefficient_b = value - - @property - def penetration_depth_solid_coefficient_a(self) -> float: - """Penetration depth solid coefficient a.""" - return self._penetration_depth_solid_coefficient_a - - @penetration_depth_solid_coefficient_a.setter - def penetration_depth_solid_coefficient_a(self, value: float): - """Set penetration_depth_solid_coefficient_a.""" - self._penetration_depth_solid_coefficient_a = value - - @property - def penetration_depth_solid_coefficient_b(self) -> float: - """Penetration depth solid coefficient b.""" - return self._penetration_depth_solid_coefficient_b - - @penetration_depth_solid_coefficient_b.setter - def penetration_depth_solid_coefficient_b(self, value: float): - """Set penetration_depth_solid_coefficient_b.""" - self._penetration_depth_solid_coefficient_b = value - - @property - def poisson_ratio(self) -> float: - """Poisson ratio.""" - return self._poisson_ratio - - @poisson_ratio.setter - def poisson_ratio(self, value: float): - """Set poisson_ratio.""" - self._poisson_ratio = value - - @property - def powder_packing_density(self) -> float: - """Density of powder material relative to the solid.""" - return self._powder_packing_density - - @powder_packing_density.setter - def powder_packing_density(self, value: float): - """Set powder_packing_density.""" - self._powder_packing_density = value - - @property - def purging_gas_convection_coefficient(self) -> float: - """Convection coefficient between the solid and gas during - processing.""" - return self._purging_gas_convection_coefficient - - @purging_gas_convection_coefficient.setter - def purging_gas_convection_coefficient(self, value: float): - """Set purging_gas_convection_coefficient.""" - self._purging_gas_convection_coefficient = value - - @property - def solid_density_at_room_temperature(self) -> float: - """Density of bulk material at room temperature, 298 K (kg/m^3).""" - return self._solid_density_at_room_temperature - - @solid_density_at_room_temperature.setter - def solid_density_at_room_temperature(self, value: float): - """Set solid_density_at_room_temperature.""" - self._solid_density_at_room_temperature = value - - @property - def solid_specific_heat_at_room_temperature(self) -> float: - """Specific heat of bulk material at room temperature, 298 K - (J/kg/K).""" - return self._solid_specific_heat_at_room_temperature - - @solid_specific_heat_at_room_temperature.setter - def solid_specific_heat_at_room_temperature(self, value: float): - """Set solid_specific_heat_at_room_temperature.""" - self._solid_specific_heat_at_room_temperature = value - - @property - def solid_thermal_conductivity_at_room_temperature(self) -> float: - """Thermal conductivity of bulk material at room temperature, 298 K - (W/m/K).""" - return self._solid_thermal_conductivity_at_room_temperature - - @solid_thermal_conductivity_at_room_temperature.setter - def solid_thermal_conductivity_at_room_temperature(self, value: float): - """Set solid_thermal_conductivity_at_room_temperature.""" - self._solid_thermal_conductivity_at_room_temperature = value - - @property - def solidus_temperature(self) -> float: - """Maximum temperature at which the material is completely solid - (K).""" - return self._solidus_temperature - - @solidus_temperature.setter - def solidus_temperature(self, value: float): - """Set solidus_temperature.""" - self._solidus_temperature = value - - @property - def strain_scaling_factor(self) -> float: - """Strain scaling factor.""" - return self._strain_scaling_factor - - @strain_scaling_factor.setter - def strain_scaling_factor(self, value: float): - """Set strain_scaling_factor.""" - self._strain_scaling_factor = value - - @property - def support_yield_strength_ratio(self) -> float: - """Factor to reduce the yield strength and elastic modulus of support - material.""" - return self._support_yield_strength_ratio - - @support_yield_strength_ratio.setter - def support_yield_strength_ratio(self, value: float): - """Set support_yield_strength_ratio.""" - self._support_yield_strength_ratio = value - - @property - def thermal_expansion_coefficient(self) -> float: - """Coefficient of thermal expansion (1/K).""" - return self._thermal_expansion_coefficient - - @thermal_expansion_coefficient.setter - def thermal_expansion_coefficient(self, value: float): - """Set thermal_expansion_coefficient.""" - self._thermal_expansion_coefficient = value - - @property - def vaporization_temperature(self) -> float: - """Temperature at which material has completely changed from liquid to - vapor (K).""" - return self._vaporization_temperature - - @vaporization_temperature.setter - def vaporization_temperature(self, value: float): - """Set vaporization_temperature (K).""" - self._vaporization_temperature = value - - @property - def characteristic_width_data(self) -> list[CharacteristicWidthDataPoint]: - """List of :class:`CharacteristicWidthDataPoint`.""" - return self._characteristic_width_data - - @characteristic_width_data.setter - def characteristic_width_data(self, value: list[CharacteristicWidthDataPoint]): - """Set characteristic_width_data.""" - if not isinstance(value, collections.abc.Sequence): - raise TypeError( - "Invalid object type, {}, passed to characteristic_width_data()".format(type(value)) - ) - self._characteristic_width_data = value - - @property - def thermal_properties_data(self) -> list[ThermalPropertiesDataPoint]: - """List of :class:`ThermalPropertiesDataPoint`.""" - return self._thermal_properties_data - - @thermal_properties_data.setter - def thermal_properties_data(self, value: list[ThermalPropertiesDataPoint]): - """Set thermal_properties_data.""" - if not isinstance(value, collections.abc.Sequence): - raise TypeError( - "Invalid object type, {}, passed to thermal_properties_data()".format(type(value)) - ) - self._thermal_properties_data = value - - @staticmethod - def _from_material_message(msg: MaterialMessage): - """Create an ``AdditiveMaterial`` object from a material message - received from the Additive service.""" - if not isinstance(msg, MaterialMessage): - raise ValueError("Invalid message object passed to from_material_message()") - material = AdditiveMaterial() - for p in material.__dict__: - if p != "_characteristic_width_data" and p != "_thermal_properties_data": - setattr(material, p, getattr(msg, p.replace("_", "", 1))) - for c in msg.characteristic_width_data_points: - material.characteristic_width_data.append( - CharacteristicWidthDataPoint._from_characteristic_width_data_point_message(c) - ) - for t in msg.thermal_properties_data_points: - material.thermal_properties_data.append( - ThermalPropertiesDataPoint._from_thermal_properties_data_point_message(t) - ) - return material - - def _to_material_message(self) -> MaterialMessage: - """Create a material message from this ``AdditiveMaterial`` to send to - the Additive service.""" - msg = MaterialMessage() - for p in self.__dict__: - if p != "_characteristic_width_data" and p != "_thermal_properties_data": - setattr(msg, p.replace("_", "", 1), getattr(self, p)) - for c in self.characteristic_width_data: - msg.characteristic_width_data_points.append( - c._to_characteristic_width_data_point_message() - ) - for t in self.thermal_properties_data: - msg.thermal_properties_data_points.append(t._to_thermal_properties_data_point_message()) - return msg - - def _load_parameters(self, parameters_file: str): - """Load material parameters from a json file.""" - with open(parameters_file, "r") as f: - data = json.load(f) - self.name = data["name"] - parameters = data["configuration"] - # Convert camelCase to snake_case - pattern = re.compile(r"(? Date: Wed, 6 Sep 2023 09:43:48 -0400 Subject: [PATCH 5/5] remove extra newlines --- examples/00_additive_single_bead.py | 1 - examples/01_additive_porosity.py | 1 - examples/02_additive_microstructure.py | 1 - examples/03_additive_thermal_history.py | 1 - examples/04_additive_doe.py | 1 - examples/05_advanced_optimization_workflow.py | 1 - examples/06_advanced_custom_material_tuning.py | 1 - examples/07_using_a_custom_material.py | 1 - 8 files changed, 8 deletions(-) diff --git a/examples/00_additive_single_bead.py b/examples/00_additive_single_bead.py index 5401850c0..4b77e5f70 100644 --- a/examples/00_additive_single_bead.py +++ b/examples/00_additive_single_bead.py @@ -19,7 +19,6 @@ # 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. - """ Single bead analysis ==================== diff --git a/examples/01_additive_porosity.py b/examples/01_additive_porosity.py index 4b8708351..f2b66f93c 100644 --- a/examples/01_additive_porosity.py +++ b/examples/01_additive_porosity.py @@ -19,7 +19,6 @@ # 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. - """ Porosity analysis ================= diff --git a/examples/02_additive_microstructure.py b/examples/02_additive_microstructure.py index 7e6371e1f..b1334ed5a 100644 --- a/examples/02_additive_microstructure.py +++ b/examples/02_additive_microstructure.py @@ -19,7 +19,6 @@ # 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. - """ Microstructure analysis ####################### diff --git a/examples/03_additive_thermal_history.py b/examples/03_additive_thermal_history.py index 4c8bc0208..35f330eaa 100644 --- a/examples/03_additive_thermal_history.py +++ b/examples/03_additive_thermal_history.py @@ -19,7 +19,6 @@ # 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. - """ Thermal history analysis ======================== diff --git a/examples/04_additive_doe.py b/examples/04_additive_doe.py index 7bd557fdf..013dde181 100644 --- a/examples/04_additive_doe.py +++ b/examples/04_additive_doe.py @@ -19,7 +19,6 @@ # 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. - """ Design of experiments ===================== diff --git a/examples/05_advanced_optimization_workflow.py b/examples/05_advanced_optimization_workflow.py index d5d897f2e..61fd6e751 100644 --- a/examples/05_advanced_optimization_workflow.py +++ b/examples/05_advanced_optimization_workflow.py @@ -19,7 +19,6 @@ # 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. - """ Optimization workflow analysis ============================== diff --git a/examples/06_advanced_custom_material_tuning.py b/examples/06_advanced_custom_material_tuning.py index 6a04c5de4..fd42c88d8 100644 --- a/examples/06_advanced_custom_material_tuning.py +++ b/examples/06_advanced_custom_material_tuning.py @@ -19,7 +19,6 @@ # 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. - """ Custom material tuning ====================== diff --git a/examples/07_using_a_custom_material.py b/examples/07_using_a_custom_material.py index b1c98147c..7c875e0c8 100644 --- a/examples/07_using_a_custom_material.py +++ b/examples/07_using_a_custom_material.py @@ -19,7 +19,6 @@ # 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. - """ Using a custom material =======================