Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# SPDX-FileCopyrightText: 2021 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
Expand All @@ -19,9 +26,9 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
Expand Down Expand Up @@ -63,19 +70,22 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IncludeCategories:
# keep the doctest headers in front
- Regex: '^(<|")doctest'
Priority: 1
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
- Regex: '.*'
Priority: 1
Priority: 2
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
Expand All @@ -96,6 +106,7 @@ PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
QualifierAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
Expand All @@ -121,4 +132,3 @@ StatementMacros:
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never

20 changes: 20 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2024 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

# reason for rule exclusion:
# * BLK100: conflicts with isort, i.e. I001,..,I005 (which is more important to be adhered)
# * E501: hard to enforce; makes tensor operations partially unreadable
# * E731: decreases readability
# * E203: decreases readability; actually applied by black
#
# reason(s) for directory exclusion:
# * preprocessing: TODO, to be exluded from the repository
# * postprocessing: TODO, to be exluded from the repository
# * submodules: submodules, need to be handled separately

[flake8]
extend-ignore = BLK100,E501,E731,E203
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ build*/
*.exe
*.out
*.app

89 changes: 89 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-FileCopyrightText: 2025 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

---

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
name: '[GENERIC] merge conflict check'
- id: check-symlinks
name: '[GENERIC] symlink check'
- id: destroyed-symlinks
name: '[GENERIC] detect broken symlinks'
- id: detect-private-key
name: '[GENERIC] detect private keys uploaded by accident'
- id: check-case-conflict
name: '[GENERIC] detect OS file naming case conflicts'
- id: check-executables-have-shebangs
name: '[GENERIC] check for shebangs in executable files'
- id: check-illegal-windows-names
name: '[GENERIC] detect illegal Windows file names'
- id: check-json
name: '[JSON] check'
- id: check-xml
name: '[XML] check'

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
name: '[MARKDOWN] lint'

#- repo: https://github.com/fsfe/reuse-tool
# rev: v6.0.0
# hooks:
# - id: reuse
# name: '[GENERIC] REUSE compatibiltiy'

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
files: ^(?!preprocessing|postprocessing)
name: '[PYTHON] black'
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
files: ^(?!preprocessing|postprocessing)
args: ["--profile", "black"]
name: '[PYTHON] isort'
- repo: https://github.com/pycqa/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ["--confidence-level", "high", "--severity-level", "high"]
name: '[PYTHON] bandit'
- repo: https://github.com/pycqa/flake8
rev: '7.3.0'
hooks:
- id: flake8
files: ^(?!preprocessing|postprocessing)
name: '[PYTHON] Flake8'

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: 'v1.0.0'
hooks:
- id: sphinx-lint
name: '[SPHINX/RST] sphinx lint'

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v21.1.0'
hooks:
- id: clang-format
name: '[C++] clang-format'

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
name: '[GENERIC] newline eof'
- id: trailing-whitespace
name: '[GENERIC] remove trailing whitespace'
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ if(EASICUBE)
set_target_properties (easicube PROPERTIES
INSTALL_RPATH_USE_LINK_PATH TRUE
)

install (TARGETS easicube)
else()
message(WARNING "easicube needs easi to be compiled with ASAGI. Since this is not the case, easicube will be skipped.")
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

[![Documentation Status](https://readthedocs.org/projects/easyinit/badge/?version=latest)](https://easyinit.readthedocs.io/en/latest/?badge=latest)


easi is a library for the **E**asy **I**nitialization of models in three (or less or more) dimensional domains.
The purpose of easi is to evaluate functions f : R^m -> R^n,
easi is a library for the **E**asy **I**nitialization of models
in three (or less or more) dimensional domains.
The purpose of easi is to evaluate functions $f : R^m \rightarrow R^n$,
which are described in a [YAML](http://yaml.org) configuration file.
In grid-based simulation software, such as [SeisSol](http://www.seissol.org>),
easi may be used to define models.
In SeisSol, the function f maps every point in space (say x,y,z) to a vector of parameters (e.g. ρ, μ, and λ),
In SeisSol, the function $f$ maps every point in space
(say $x,y,z$) to a vector of parameters (e.g. $\rho$, $\mu$, and $\lambda$),
which define a rheological model.
Here, over 5000 lines of model-specific Fortran code could be replaced with YAML files.
Here, over 5000 lines of model-specific Fortran
code could be replaced with YAML files.

## Documentation
The reference documentation can be found on [Read the Docs](https://easyinit.readthedocs.io) or be downloaded as [PDF manual](http://readthedocs.org/projects/easyinit/downloads/pdf/latest/).

The reference documentation can be found on
[Read the Docs](https://easyinit.readthedocs.io)
or be downloaded as a [PDF manual](http://readthedocs.org/projects/easyinit/downloads/pdf/latest/).
2 changes: 1 addition & 1 deletion cmake/FindFILESYSTEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# NOTE: it is not an official cmake search file
# authors: Carsten Uphoff, Ravil Dorozhinskii
# email: uphoff@in.tum.de, ravil.dorozhinskii@tum.de
# email: uphoff@in.tum.de, ravil.dorozhinskii@tum.de
#


Expand Down
1 change: 0 additions & 1 deletion cmake/FindNetCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NetCDF
REQUIRED_VARS NetCDF_LIBRARY NetCDF_INCLUDE_DIR
VERSION_VAR NetCDF_VERSION)

1 change: 0 additions & 1 deletion cmake/easiConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ endif()
if (NOT TARGET easi::easi)
include ("${CMAKE_CURRENT_LIST_DIR}/easiTargets.cmake")
endif ()

2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion doc/builders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Defines parameters at nodes, which are interpolated inbetween nodes.

!LayeredModel
map: <map> # Mapping to 1D (root component)
interpolation: (lower|upper|linear)
interpolation: (lower|upper|linear)
parameters: [<dimension>, <dimension>, ...] # order of dimension
nodes:
<double>: [<double>, <double>, ...] # key: node position, value: dimension values
Expand Down
11 changes: 5 additions & 6 deletions doc/compiling_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Alternatively for gcc compilers on SupermucNG:
export CC=mpigcc

2. Asagi

See https://seissol.readthedocs.io/en/latest/asagi.html.

3. yaml-cpp
Expand All @@ -32,7 +32,7 @@ On SupermucNG and with intel compilers:

module load yaml-cpp/0.7.0-intel21


Alternatively you can build from source:

.. code-block:: bash
Expand All @@ -46,15 +46,15 @@ Alternatively you can build from source:
make -j 4
make install
cd ../..


4. ImpalaJIT

4. ImpalaJIT

.. code-block:: bash

git clone git@github.com:uphoffc/ImpalaJIT
# git clone https://github.com/uphoffc/ImpalaJIT.git
cd ImpalaJIT
cd ImpalaJIT
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME
make -j 4
Expand All @@ -73,4 +73,3 @@ Alternatively you can build from source:
make local
cp -r install/* ~
cd ..

Loading