pax_global_header 0000666 0000000 0000000 00000000064 15014146142 0014510 g ustar 00root root 0000000 0000000 52 comment=8638bd3bc526e867a7260d586435a9186b148e7b scientificcomputing-scifem-fe6f069/ 0000775 0000000 0000000 00000000000 15014146142 0017451 5 ustar 00root root 0000000 0000000 scientificcomputing-scifem-fe6f069/.clang-format 0000664 0000000 0000000 00000005361 15014146142 0022031 0 ustar 00root root 0000000 0000000 --- Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: false AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: false AfterControlStatement: false AfterEnum: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false BeforeCatch: false BeforeElse: false IndentBraces: false BreakBeforeBinaryOperators: All BreakBeforeBraces: Allman BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|isl|json)/)' Priority: 3 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '$' IndentCaseLabels: false IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left ReflowComments: true SortIncludes: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: Never scientificcomputing-scifem-fe6f069/.github/ 0000775 0000000 0000000 00000000000 15014146142 0021011 5 ustar 00root root 0000000 0000000 scientificcomputing-scifem-fe6f069/.github/dependabot.yml 0000664 0000000 0000000 00000001030 15014146142 0023633 0 ustar 00root root 0000000 0000000 # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - package-ecosystem: "github-actions" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "weekly" scientificcomputing-scifem-fe6f069/.github/workflows/ 0000775 0000000 0000000 00000000000 15014146142 0023046 5 ustar 00root root 0000000 0000000 scientificcomputing-scifem-fe6f069/.github/workflows/build_docs.yml 0000664 0000000 0000000 00000001744 15014146142 0025706 0 ustar 00root root 0000000 0000000 name: Build documentation on: pull_request: branches: [main] workflow_call: workflow_dispatch: env: DEB_PYTHON_INSTALL_LAYOUT: deb_system DISPLAY: ":99.0" jobs: build: runs-on: ubuntu-24.04 container: ghcr.io/fenics/dolfinx/lab:v0.9.0 env: PUBLISH_DIR: ./_build/html DISPLAY: ":99.0" PYVISTA_TRAME_SERVER_PROXY_PREFIX: "/proxy/" PYVISTA_TRAME_SERVER_PROXY_ENABLED: "True" PYVISTA_OFF_SCREEN: false PYVISTA_JUPYTER_BACKEND: "html" steps: - name: Checkout uses: actions/checkout@v4 - name: Install dependencies for pyvista run: apt-get update && apt-get install -y libgl1-mesa-dev xvfb - name: Install dependencies run: python3 -m pip install --no-build-isolation ".[docs]" - name: Build docs run: jupyter book build -W --keep-going . - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: ${{ env.PUBLISH_DIR }} scientificcomputing-scifem-fe6f069/.github/workflows/deploy_docs.yml 0000664 0000000 0000000 00000001217 15014146142 0026076 0 ustar 00root root 0000000 0000000 name: Publish documentation on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: "pages" cancel-in-progress: true jobs: build: uses: ./.github/workflows/build_docs.yml deploy: needs: build environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v5 - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 scientificcomputing-scifem-fe6f069/.github/workflows/pre-commit.yml 0000664 0000000 0000000 00000000347 15014146142 0025651 0 ustar 00root root 0000000 0000000 name: pre-commit on: pull_request: push: branches: [main] jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - uses: pre-commit/action@v3.0.1 scientificcomputing-scifem-fe6f069/.github/workflows/pypi.yml 0000664 0000000 0000000 00000001556 15014146142 0024561 0 ustar 00root root 0000000 0000000 name: Release on: [push, pull_request] jobs: dist: runs-on: ubuntu-latest container: ghcr.io/fenics/dolfinx/dolfinx:nightly env: DEB_PYTHON_INSTALL_LAYOUT: deb_system steps: - uses: actions/checkout@v4 - name: Install build dependencies run: python3 -m pip install --upgrade build twine - name: Build SDist and wheel run: python3 -m build --no-isolation --sdist - uses: actions/upload-artifact@v4 with: path: dist/* - name: Check metadata run: python3 -m twine check dist/* publish: needs: [dist] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags') environment: pypi permissions: id-token: write steps: - uses: actions/download-artifact@v4 with: name: artifact path: dist - uses: pypa/gh-action-pypi-publish@release/v1 scientificcomputing-scifem-fe6f069/.github/workflows/tests.yml 0000664 0000000 0000000 00000001526 15014146142 0024737 0 ustar 00root root 0000000 0000000 name: Test package on: pull_request: push: branches: [main] jobs: test-code: name: Test on ${{ matrix.container }} runs-on: ubuntu-24.04 container: ${{ matrix.container }} env: DEB_PYTHON_INSTALL_LAYOUT: deb_system strategy: fail-fast: false matrix: container: [ "ghcr.io/fenics/dolfinx/dolfinx:stable", "ghcr.io/fenics/dolfinx/dolfinx:nightly" ] steps: - uses: actions/checkout@v4 - name: Install package run: | python3 -m pip install Cython pkgconfig HDF5_MPI=ON HDF5_PKGCONFIG_NAME="hdf5" python3 -m pip install .[test] --no-build-isolation --no-binary=h5py - name: Run tests run: python3 -m pytest -v - name: Run tests in parallel run: mpiexec -n 4 python3 -m pytest -v -m "not serial" scientificcomputing-scifem-fe6f069/.gitignore 0000664 0000000 0000000 00000006165 15014146142 0021451 0 ustar 00root root 0000000 0000000 _build/ .vscode/ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ cover/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder .pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: # .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # poetry # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. # This is especially recommended for binary packages to ensure reproducibility, and is more # commonly ignored for libraries. # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control #poetry.lock # pdm # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. #pdm.lock # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. # https://pdm.fming.dev/latest/usage/project/#working-with-version-control .pdm.toml .pdm-python .pdm-build/ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # pytype static type analyzer .pytype/ # Cython debug symbols cython_debug/ # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ # Output files *.xdmf *.h5 *.bp scientificcomputing-scifem-fe6f069/.pre-commit-config.yaml 0000664 0000000 0000000 00000001743 15014146142 0023737 0 ustar 00root root 0000000 0000000 # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files args: ['--maxkb=3000'] - id: check-docstring-first - id: debug-statements - id: check-toml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: 'v0.11.6' hooks: # Run the linter. - id: ruff args: [ --fix ] # Run the formatter. - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.15.0 hooks: - id: mypy files: ^src/|^tests/ args: ["--config-file", "pyproject.toml"] - repo: https://github.com/pre-commit/mirrors-clang-format rev: 'v20.1.0' # Use the sha / tag you want to point at hooks: - id: clang-format scientificcomputing-scifem-fe6f069/CITATION.cff 0000664 0000000 0000000 00000001122 15014146142 0021337 0 ustar 00root root 0000000 0000000 abstract: '
Testing bump my version, no significant changes.
Full Changelog: https://github.com/scientificcomputing/scifem/compare/v0.2.0...v0.2.2
' authors: - affiliation: Simula Research Laboratoy family-names: Henrik Finsberg - affiliation: Simula Research Laboratory family-names: "Jørgen Schartum Dokken" cff-version: 1.2.0 date-released: '2024-09-18' doi: 10.5281/zenodo.13784791 license: - cc-by-4.0 repository-code: https://github.com/scientificcomputing/scifem/tree/v0.2.2 title: 'scientificcomputing/scifem: v0.2.2' type: software version: v0.2.2 scientificcomputing-scifem-fe6f069/CMakeLists.txt 0000664 0000000 0000000 00000003404 15014146142 0022212 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.21) set(PROJECT_NAME scifem) # nanobind uses aligned deallocators only present on macOS > 10.14 if(APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) project(${PROJECT_NAME} VERSION "0.1.0.0" LANGUAGES C CXX) if (WIN32) # Windows requires all symbols to be manually exported. # This flag exports all symbols automatically, as in Unix. set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) endif(WIN32) execute_process( COMMAND ${Python3_EXECUTABLE} -c "import os, sys, basix; sys.stdout.write(os.path.dirname(basix.__file__))" OUTPUT_VARIABLE BASIX_PY_DIR RESULT_VARIABLE BASIX_PY_COMMAND_RESULT ERROR_VARIABLE BASIX_ERROR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE ) find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) if(Basix_FOUND) message(STATUS "Found Basix at ${Basix_DIR}") endif() find_package(DOLFINX REQUIRED CONFIG) if(DOLFINX_FOUND) message(STATUS "Found DOLFINx at ${DOLFINX_DIR}") endif() find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) # Detect the installed nanobind package and import it into CMake execute_process( COMMAND "${Python_EXECUTABLE}" -c "import nanobind; print(nanobind.cmake_dir())" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR) list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}") find_package(nanobind CONFIG REQUIRED) # We are now ready to compile the actual extension module nanobind_add_module( _scifem STABLE_ABI src/scifem.cpp ) target_link_libraries(_scifem PRIVATE dolfinx) set_target_properties(_scifem PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) # Install directive for scikit-build-core install(TARGETS _scifem LIBRARY DESTINATION ${PROJECT_NAME}) scientificcomputing-scifem-fe6f069/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000011422 15014146142 0022250 0 ustar 00root root 0000000 0000000 # Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: - The use of sexualized language or imagery, and sexual attention or advances - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment - Publishing others’ private information, such as a physical or email address, without their explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact:** A violation through a single incident or series of actions. **Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact:** A serious violation of community standards, including sustained inappropriate behavior. **Consequence:** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence:** A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md, and was generated by [contributing-gen](https://github.com/bttger/contributing-gen). scientificcomputing-scifem-fe6f069/CONTRIBUTING.md 0000664 0000000 0000000 00000015450 15014146142 0021707 0 ustar 00root root 0000000 0000000 # Contributing When contributing to this repository, please first [create an issue](https://github.com/scientificcomputing/scifem/issues/new/choose) containing information about the missing feature or the bug that you would like to fix. Here you can discuss the change you want to make with the maintainers of the repository. Please note we have a code of conduct, please follow it in all your interactions with the project. ## Adding a new feature We really appreciate contributions to the project. If you want to add a new feature, please create an issue first to discuss the feature you would like to add. This way we can make sure that the feature is in line with the goals of the project and that it is not already being worked on by someone else. Any new feature should be accompanied by tests and an example that should be part of the documentation. The tests should be added to the test suite in the `tests` folder and the example should be added to the `example` folder, and added to the `_toc.yml` file so that it is included in the documentation. ## New contributor guide To get an overview of the project, read the [documentation](https://scientificcomputing.github.io/scifem/). Here are some resources to help you get started with open source contributions: - [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github) - [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git) - [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow) - [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests) ## Pull Request Process ### Pull Request - When you're finished with the changes, create a pull request, also known as a PR. It is also OK to create a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) from the very beginning. Once you are done you can click on the ["Ready for review"] button. You can also [request a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from one of the maintainers. - Don't forget to [link PR to the issue that you opened ](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). - Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge. Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information. - We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. - As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). - If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues. - Please make sure that all tests are passing, github pages renders nicely, and code coverage are are not lower than before your contribution. You see the different github action workflows by clicking the "Action" tab in the GitHub repository. ### Enforced style guide using pre-commit hooks We want to have a consistent style on all the contributions to the repository. The way we enforce this is through pre-commit hooks and contributors are encouraged to install the pre-commit hooks locally when developing. You can install the pre commit hooks by first install `pre-commit` ``` python3 -m pip install pre-commit ``` and then install the pre-commit hooks using the command ``` pre-commit install ``` at the root of the repository. This will install all the hooks listed in the file called `.pre-commit-config.yaml` in the root of the repository. Every time you make a commit to the repository a set of tests will run to make sure that the changes you made are following the style guide. Usually, the hooks will autoformat your code so that you only need to do a `git add` again and then redo the `git commit`. Note that when you make a push to the repo, the pre-commit hooks will be run on all the files in the repository. You can also run the pre-commit hooks on all the files using the command ``` pre-commit run --all ``` To learn more about pre-commit you can check out https://pre-commit.com ## Test suite For every new feature of bugfix you should also make sure to not lower the code coverage for the test suite. This means that if you for example add a new function then you should also make sure that the function is properly tested (at a minimum it should be covered by the test suite). To run the test suite, please install the package with the optional dependencies `test`, i.e ``` python3 -m pip install -e ".[all]" ``` in the root of the repository. To run the tests you can execute the command ``` python3 -m pytest ``` Also make to sure to check that the tests also passes with `mpiexec` by running ``` mpiexec -n 2 python3 -m pytest ``` Note that we have a [GitHub action](https://github.com/scientificcomputing/scifem/blob/main/.github/workflows/tests.yml) that runs the tests on every push and pull request to the main branch of the repository. You can read more about using pytest in the [official documentation of pytest](https://docs.pytest.org/). ## Documentation The documentation is hosted at GitHub pages and created with [`JupyterBook`](https://jupyterbook.org/en/stable/intro.html). Contributions to the documentation is very welcomed. To build the documentation locally you can installed the `docs` optional dependencies, i.e ``` python3 -m pip install -e ".[docs]" ``` in the root of the repository. Now you can build the documentation by running the command ``` jupyter-book build . ``` from the root of the repository. The command should complete without errors or warnings. In particular, you might want to run the command ``` jupyter-book build -W --keep-going . ``` which will turn warnings into errors. For reference, please see the [github workflow](https://github.com/scientificcomputing/scifem/blob/main/.github/workflows/pages.yml) that is used for building the pages. ## Need help? If something is not working as expected, or you need help please file an [issue](https://github.com/scientificcomputing/scifem/issues/new/choose). scientificcomputing-scifem-fe6f069/LICENSE 0000664 0000000 0000000 00000002123 15014146142 0020454 0 ustar 00root root 0000000 0000000 MIT License Copyright (c) 2024 Scientific Computing at Simula Research Laboratory 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. scientificcomputing-scifem-fe6f069/README.md 0000664 0000000 0000000 00000004365 15014146142 0020740 0 ustar 00root root 0000000 0000000 # Scientific Computing Tools for Finite Element Methods This package contains a collection of tools for scientific computing with a focus on finite element methods. The tools are written in Python and are intended to be used in conjunction with the [dolfinx](https://github.com/FEniCS/dolfinx). Many users that are transitioning from legacy FEniCS to FEniCSx may find the transition difficult due to the lack of some functionalities in FEniCSx. This package aims to provide some of the functionalities that are missing in FEniCSx. The package is still in its early stages and many functionalities are still missing. ## Features - Real-space implementation for usage in DOLFINx (>=v0.8.0) - Save quadrature functions as point clouds - Save any function that can tabulate dof coordinates as point clouds. - Point sources for usage in DOLFINx (>=v0.8.0) - Point sources in vector spaces are only supported on v0.9.0, post [DOLFINx PR 3429](https://github.com/FEniCS/dolfinx/pull/3429). For older versions, apply one point source in each sub space. - Simplified wrapper to create MeshTags based on a list of tags and corresponding locator functions. - Maps between degrees of freedom and vertices: `vertex_to_dofmap` and `dof_to_vertex` - Blocked Newton Solver - Function evaluation at specified points ## Installation The package is partly written in C++ and relies on `dolfinx`. User are encouraged to install `scifem` with `pip` in an environment where `dolfinx` is already installed or with `conda`. ### `pip` To install the package with `pip` run ```bash python3 -m pip install scifem --no-build-isolation ``` To install the development version you can run ```bash python3 -m pip install --no-build-isolation git+https://github.com/scientificcomputing/scifem.git ``` Note that you should pass the flag `--no-build-isolation` to `pip` to avoid issues with the build environment, such as incompatible versions of `nanobind`. ### `conda` To install the package with `conda` run ```bash conda install -c conda-forge scifem ``` ## Having issues or want to contribute? If you are having issues, feature request or would like to contribute, please let us know. You can do so by opening an issue on the [issue tracker](https://github.com/scientificcomputing/scifem/issues). scientificcomputing-scifem-fe6f069/_config.yml 0000664 0000000 0000000 00000002151 15014146142 0021577 0 ustar 00root root 0000000 0000000 # Book settings # Learn more at https://jupyterbook.org/customize/config.html title: scifem author: Jørgen Dokken and Henrik Finsberg copyright: "2024" only_build_toc_files: true execute: execute_notebooks: cache timeout: 3000 # Information about where the book exists on the web repository: url: https://github.com/scientificcomputing/scifem # Online location of your book branch: main html: use_issues_button: true use_repository_button: true parse: myst_enable_extensions: - amsmath - dollarmath - linkify - html_admonition sphinx: config: html_last_updated_fmt: "%b %d, %Y" nb_execution_show_tb: True bibtex_bibfiles: ["docs/refs.bib"] suppress_warnings: ["mystnb.unknown_mime_type"] nb_custom_formats: # https://jupyterbook.org/en/stable/file-types/jupytext.html#file-types-custom .py: - jupytext.reads - fmt: py extra_extensions: - 'sphinx.ext.autodoc' - 'sphinx.ext.napoleon' - 'sphinx.ext.viewcode' - 'sphinxcontrib.bibtex' exclude_patterns: [".pytest_cache/*" ,"tests", venv, .vcode, .ruff_cache, .github, .git] scientificcomputing-scifem-fe6f069/_toc.yml 0000664 0000000 0000000 00000001116 15014146142 0021117 0 ustar 00root root 0000000 0000000 # Table of contents # Learn more at https://jupyterbook.org/customize/toc.html format: jb-book root: README parts: - caption: Features chapters: - file: "examples/real_function_space.py" - file: "examples/point_source.py" - file: "examples/xdmf_point_cloud.py" - file: "examples/mark_entities.py" - file: "examples/blocked_solver.py" - file: "examples/evaluate_function.py" - file: "examples/transfer_tags_to_submesh" - caption: Reference chapters: - file: "docs/api.rst" - file: CONTRIBUTING - file: CODE_OF_CONDUCT scientificcomputing-scifem-fe6f069/docs/ 0000775 0000000 0000000 00000000000 15014146142 0020401 5 ustar 00root root 0000000 0000000 scientificcomputing-scifem-fe6f069/docs/_static/ 0000775 0000000 0000000 00000000000 15014146142 0022027 5 ustar 00root root 0000000 0000000 scientificcomputing-scifem-fe6f069/docs/_static/cos_sin_pointcloud.png 0000664 0000000 0000000 00003405756 15014146142 0026456 0 ustar 00root root 0000000 0000000 PNG IHDR 2 Rw sBIT|d tEXtSoftware gnome-screenshot> /tEXtCreation Time s. 22. sep. 2024 kl. 18.40 +0200J IDATxwti{GJR-۵\^w+ET: " Hoj$@zN }Zɜ3'g6tщĜsc)x9"""""""""""""rQ"SDDDDDDDDDDDDD.8JdGLw """""""""""""'fwwwf3 Ӊfͦ8\!..@EDDDDDDDDDDDDbt=JAAq()""""""""""""R /5ڮ|Nפ"""""""""""""08i鉟VGP"SDDDDDDDDDDDDz{www|||G-P"SDDDDDDDDDDDDnnnyx&OO:%WP"SDDDDD俑wW+k~M;%oob_zFc)NJ^N4+"""""RhN/j߶?fڊG..cF.iao礪1onR:* SZyub$#LeÝغgW 3p'/xqgYgSP{zFBӆ>PJ|,=l-W1aхhb_|{*9+}. +G9}-?~3 Mt ;-M!iv ؽw-NA˘+|_DDDDD\l6cX^,f8&MTS{F^zy.<8e?V'%2EDDDDDjăpx_j+m/Mtz|I]9sX9Wr @.m.vdh2R`?#~/ngap.\$zcIQaRs jK!V^{1{eXM}1lLZ;8_hQ%\5Cܝ?GGaWG\y/Eciv91h4Ff;vh\M^q># ;`cȘ&N-.bu })2:S@lQ<'i2EDDDDNe5M V'%7]য়~b0g }oqVq()"""""R+vv3О_}tC!w#7#"sI&6-ӗ_gnb!bϻ׳c.qOojK3128[έ LM4)fXM[GM^q#/n)&sטKhj&F*E\؍#_6⌹/GͥSKOiʓ>&7c+.n,~`XL4 |?)hM˹HL|~^Ք_}Ci,xB|6M҆O^tRg}~G W5ęY/=+vsCDδ`-X!/}O{ ڠݛ zlv}6le˖o߾4EpPZZoq2Y8#[VۻuJOC܊L+(&Tx{GvcDWdY-G)!mW9?$3(b [[dsg,et!^4#GlܓO5'd/dͪX{w!UkB(h&:²݀#c vY3#:ХA$ t=G@V'_E@Z%+͝+1MC@!6gN]ii137oa$mژ:=5*;D:(L!%C2a7uoÓ6Gur4~ɽmSN{.+"""""`0T9gUۜ(Yq,Z}+rP5g3oHLae1d:me31^Ǹk^fM!c)촏a|}k?E}{Uەq1:n:h-s~ưa: LӏA3_7o̥]+v07@kOwvmL!m!m;BL֮dSə4 ,Afy,eύjg9H[N[ERz֬-m[a?>sP,pdpz!!VDoE,[#/_ёx[`5)6ۑ_nRϷ+*""""""SLZ1v|L>i?ʏ/a5;^Ss*ڼ,ۦNVζk6m8+S:~iCL|V|3Cd-ÀО?O{0F8z`%+E&mت%N pRGNѤv,`/(<