From 62c7bea6b04c54e493939dd10354fbcb7e2dca61 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 11:46:58 +0200 Subject: [PATCH 1/8] Remove outdated documentation page build-supermuc.md --- docs/build-supermuc.md | 69 ------------------------------------------ 1 file changed, 69 deletions(-) delete mode 100644 docs/build-supermuc.md diff --git a/docs/build-supermuc.md b/docs/build-supermuc.md deleted file mode 100644 index 17ccfbe..0000000 --- a/docs/build-supermuc.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Building the CalculiX adapter on SuperMUC -permalink: adapter-calculix-supermuc.html -aliases: - - /adapter-calculix-supermuc.html -keywords: adapter, calculix, cluster, modules -summary: "This page explains how to build the CalculiX adapter on SuperMUC. Even though SuperMUC was shut down in 2019, this page may still be useful for other clusters." ---- - -{% warning %} -This page needs updates for preCICE v2. -{% endwarning %} - -In order to install CalculiX and the adapter on superMUC, a number of dependencies are first required. Initially, [preCICE must be installed](https://precice.org/installation-overview.html) - -Additionally, [SPOOLES](http://www.netlib.org/linalg/spooles/spooles.2.2.html), [ARPACK](https://en.wikipedia.org/wiki/ARPACK) and [yaml-cpp](https://github.com/jbeder/yaml-cpp) are required. - -To install SPOOLES, some changes are necessary. - -1. `makefile`: `~/SPOOLES.2.2/Tree/src/makeGlobalLib` contains an error: file `drawTree.c` does not exist and should be replaced by `tree.c`. -2. Changes to the `Make.inc` file must be done according to the CalculiX install [Manual](http://www.dhondt.de/INST_CCX_2_8_MAC_02_10_2015.pdf), page 16 and 17. - -In installing ARPACK, the HOME directory needs to be specified in the "ARmake.inc" file. No changes are necessary for the Makefile. To install ARPACK, run "make lib" in the ARPACK directory. - -Any problems with the installation of SPOOLES and ARPACK can be searched in the installation [instructions](http://www.dhondt.de/INST_CCX_2_8_MAC_02_10_2015.pdf). - -To install yaml-cpp (up to adapter v2.20.1), run in the source directory: - -```bash -mkdir build -cd build -cmake .. - -make -make install -``` - -yaml-cpp 0.5.3 is known to work. Newer version may also work. yaml-cpp can be downloaded from - -```bash -wget https://github.com/jbeder/yaml-cpp/archive/release-0.5.3.tar.gz -O - | tar xz -``` - -## Module List - -The following modules available in superMUC are known to work for the CalculiX adapter installation. - -1. python/3.5_anaconda_nompi -2. scons/3.0.1 -3. valgrind/3.10 -4. petsc/3.8 -5. boost/1.65_gcc -6. gcc/6 -7. mpi.intel/2017 - -## Makefile Changes - -The paths to the CalculiX CCX, SPOOLES, ARPACK and YAML must be specified. -Line 61: "FC = mpifort" can be commented out and replaced with "FC = gfortran". - -The path to the pkgconfig file needs to be stated. The command "export PKG_CONFIG_PATH=/path/to/lib/pkgconfig" must be provided. It is easier to install preCICE with the "CMAKE_INSTALL_PREFIX" set to the path where preCICE is installed. - -## Adapter Installation - -To install the adapter, the command with the following configurations is known to work: - -```bash -cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/path -DCMAKE_BUILD_TYPE=RelWithDebInfo .. -``` From e402a6b7fd11c0bdd4927289bee26226174c19a7 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 11:53:15 +0200 Subject: [PATCH 2/8] Remove website variable for calculix/adapter versions --- docs/get-adapter.md | 10 +++++----- docs/get-calculix.md | 8 ++++---- docs/overview.md | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/get-adapter.md b/docs/get-adapter.md index fac671c..2e5aee5 100644 --- a/docs/get-adapter.md +++ b/docs/get-adapter.md @@ -9,7 +9,7 @@ summary: "The CalculiX adapter provides the executable `ccx_preCICE`. You can ge After [installing preCICE](https://precice.org/installation-overview.html) and [getting the CalculiX source and the required dependencies](adapter-calculix-get-calculix.html), you can now build the adapter, i.e. a modified CCX executable. -There are two ways to get the adapter: (a) get a binary package (Ubuntu-only), or (b) build it from source. The latest adapter version is v{{ site.calculix_adapter_version }} and the versioning format is `.`. +There are two ways to get the adapter: (a) get a binary package (Ubuntu-only), or (b) build it from source. The latest adapter version is v2.20.1 and the versioning format is `.`. ## Get a binary package @@ -18,8 +18,8 @@ You can download version-specific Ubuntu (Debian) packages from each [adapter re Alternatively, download & install it from the command line. For Ubuntu 26.04 (Resolute Raccoon): ```bash -wget https://github.com/precice/calculix-adapter/releases/download/v{{ site.calculix_adapter_version }}/calculix-precice3_{{ site.calculix_adapter_version }}-1_amd64_resolute.deb -sudo apt install ./calculix-precice3_{{ site.calculix_adapter_version }}-1_amd64_resolute.deb +wget https://github.com/precice/calculix-adapter/releases/download/v2.20.1/calculix-precice3_2.20.1-1_amd64_resolute.deb +sudo apt install ./calculix-precice3_2.20.1-1_amd64_resolute.deb ``` This requires that also preCICE itself has been installed from a Debian package. @@ -34,7 +34,7 @@ We started offering Debian packages for the CalculiX adapter since v2.19.0. Plea ## Building the adapted CalculiX -1. Download and unzip the latest state of the adapter (e.g. in the `CalculiX` folder), currently supporting CalculiX v{{site.calculix_version}}: +1. Download and unzip the latest state of the adapter (e.g. in the `CalculiX` folder), currently supporting CalculiX v2.20: ```bash wget https://github.com/precice/calculix-adapter/archive/refs/heads/master.tar.gz @@ -63,7 +63,7 @@ The variables `YAML_INCLUDE` and `YAML_LIBS` are only relevant up to the adapter {% endversion %} 1. `CCX`: Location of the original CalculiX solver (CCX) source code ("src" directory) - - Example: `$(HOME)/CalculiX/ccx_{{site.calculix_version}}/src` + - Example: `$(HOME)/CalculiX/ccx_2.20/src` 2. `SPOOLES_INCLUDE`: Include flags for SPOOLES - Example 1: `SPOOLES_INCLUDE = -I/usr/include/spooles/` (installed) - Example 2: `SPOOLES_INCLUDE = -I$(HOME)/SPOOLES.2.2/` (source) diff --git a/docs/get-calculix.md b/docs/get-calculix.md index 12c551c..5d6bc0f 100644 --- a/docs/get-calculix.md +++ b/docs/get-calculix.md @@ -151,15 +151,15 @@ After building, make sure that you make yaml-cpp discoverable by setting e.g. yo ### Get the source -Once the libraries are installed, you can finally install Calculix with preCICE adapter. Note that the adapter version needs to be the same as the CalculiX version (replace `{{site.calculix_version}}` below). +Once the libraries are installed, you can finally install Calculix with preCICE adapter. Note that the adapter version needs to be the same as the CalculiX version (replace `2.20` below). ```bash cd ~ -wget http://www.dhondt.de/ccx_{{site.calculix_version}}.src.tar.bz2 -tar xvjf ccx_{{site.calculix_version}}.src.tar.bz2 +wget http://www.dhondt.de/ccx_2.20.src.tar.bz2 +tar xvjf ccx_2.20.src.tar.bz2 ``` -The source code is now in the `~/CalculiX/ccx_{{site.calculix_version}}/src` directory. The adapter's [`Makefile`](https://github.com/precice/calculix-adapter/blob/master/Makefile) is looking for CCX in this directory by default, so modify it if needed. +The source code is now in the `~/CalculiX/ccx_2.20/src` directory. The adapter's [`Makefile`](https://github.com/precice/calculix-adapter/blob/master/Makefile) is looking for CCX in this directory by default, so modify it if needed. ### Building the "vanilla" CalculiX (optional) diff --git a/docs/overview.md b/docs/overview.md index 91c40e5..5277995 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -20,7 +20,7 @@ Are you encountering an unexpected error? Have a look at our [Troubleshooting](a ## Versions -The latest supported CalculiX version is {{site.calculix_version}}. If you already have a copy of the adapter, check the [adapter README](https://github.com/precice/calculix-adapter/blob/master/README.md) for the CalculiX version it was made for. +The latest supported CalculiX version is v2.20. If you already have a copy of the adapter, check the [adapter README](https://github.com/precice/calculix-adapter/blob/master/README.md) for the CalculiX version it was made for. The adapter has a versioning scheme inherited from CalculiX: It is of the form `CCX_MAJOR.CCX_MINOR.ADAPTER_PATCH`. For instance, the release `v2.20.0` modifies the source code of CalculiX `2.20`. Further adapter releases for the same CalculiX version increase the `ADAPTER_PATCH` (e.g., `2.20.1`), independent of whether it includes bug fixes, new features, or compatibility with a different preCICE version. From d499d18b9aee55553047d3801a011e943732e22c Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 13:46:08 +0200 Subject: [PATCH 3/8] Cleanup configure.md --- docs/calculix-support.md | 2 - docs/configure.md | 150 ++++++++++++++++++--------------------- docs/get-adapter.md | 29 ++++---- docs/get-calculix.md | 6 +- 4 files changed, 85 insertions(+), 102 deletions(-) diff --git a/docs/calculix-support.md b/docs/calculix-support.md index 69dca93..e575b47 100644 --- a/docs/calculix-support.md +++ b/docs/calculix-support.md @@ -10,9 +10,7 @@ summary: "Supported CalculiX versions and porting the CalculiX adapter to a diff The CalculiX adapter directly modifies the source files of CalculiX and, as such, is made for a specific version of CalculiX. This page includes some hints on porting the adapter to different versions. -{% tip %} Have you upgraded the supported CalculiX version to a newer one? Contribute back to the repository and make it available for everyone! -{% endtip %} ## Porting the adapter to a new CalculiX version diff --git a/docs/configure.md b/docs/configure.md index 46caeee..e52fdfe 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -7,13 +7,28 @@ keywords: adapter, calculix, configuration, config.yml summary: "Write a config.yml, write a CalculiX case input file, and run an adapted CalculiX executable." --- -## Layout of the YAML configuration file +## Running the adapted CalculiX executable + +Running the adapted executable is pretty similar to running the original CalculiX. The syntax is as follows: + +```bash +ccx_preCICE -i [CalculiX input file] -precice-participant [participant name] +``` + +For example: + +```bash +ccx_preCICE -i flap -precice-participant Calculix +``` + +The input file for this example would be `flap.inp`. Note that the suffix `.inp` needs to be omitted on the command line. The flag `-precice-participant` triggers the usage of the preCICE adapter. If the flag is not used, the original unmodified solver of CalculiX is executed, allowing CalculiX-only runs. Note that as mentioned above, the participant name used on the command line must match the name given in the YAML configuration file and in the preCICE configuration file. + +## Adapter configuration file -The layout of the YAML configuration file, which should be named `config.yml` (default name), is explained by means of an example for an FSI simulation: +The adapter looks for a YAML-based configuration file named `config.yml`, which, for historical reasons, starts by defining a list of participants. For example, for an FSI simulation: ```yaml participants: - Calculix: interfaces: - nodes-mesh: Calculix_Mesh @@ -24,55 +39,45 @@ participants: precice-config-file: ../precice-config.xml ``` -The adapter allows us to use several participants in one simulation (e.g., several instances of Calculix if several solid objects are taken into account). The name of the participant `Calculix` must match the specification of the participant on the command line when running the executable of `CCX` with the adapter being used (this is described later). Also, the name must be the same as the one used in the preCICE configuration file `precice-config.xml`. - -One participant may have several coupling interfaces. Note that each interface specification starts with a dash. -Depending on the data you need to read and write, the interface should define either a `faces-mesh` (or `mesh` as a synonym) where the data points are centers of faces (computed by the adapter) or a mesh made of CalculiX vertices, with the keyword `nodes-mesh`. An interface made of faces should be defined in the CalculiX case using the `*SURFACE` command, whereas meshes with nodes should define these nodes using `*NSET`. Using the wrong family of mesh (e.g. reading forces on faces) throws an error. If you need both kinds of meshes, you should define more than one interface. - -For FSI simulations the mesh type of an interface is always `nodes-mesh`, as forces and displacement are defined on nodes. The name of this mesh, `Calculix_Mesh`, must match the mesh name given in the preCICE configuration file. In CHT simulations, `faces-meshes` are usually chosen, as they are needed to apply heat fluxes or convective heat transfer. -For defining which nodes of the CalculiX domain belong to the FSI interface, a node set needs to be defined in the CalculiX input files. The name of this node set must match the name of the patch (here: "interface"). - -In the current FSI example, the adapter reads forces from preCICE and feeds displacement deltas (not absolute displacements, but the change of the displacements relative to the last time step) to preCICE. This is defined with the keywords `read-data` and `write-data`, respectively. The names (here: `Forces` and `DisplacementDeltas`) again need to match the specifications in the preCICE configuration file. In the current example, the coupled fluid solver expects displacement deltas instead of displacements. However, the adapter is capable of writing either type. Just use `write-data: [Displacements]` for absolute displacements rather than relative changes being transferred in each time step. Valid `readData` keywords in CalculiX are: - -On faces-mesh: - -* Pressure (Use a `*DLOAD`) -* Heat-Flux (Use a `*DFLUX`) -* Sink-Temperature (Use `*FILM`) -* Heat-Transfer-Coefficient (Use `*FILM`) - -On nodes-mesh: - -* Forces (Use a `*CLOAD`) -* Displacements (Use `*BOUNDARY`) -* Temperature (Use `*BOUNDARY`) +The name of the participant `Calculix` must match the command-line argument `-precice-participant` for `CCX_preCICE` (read below) and the one used in the preCICE configuration file `precice-config.xml`. One participant may have several coupling interfaces. Note that each interface specification starts with a dash (new YAML list entry). -Have a look at the CalculiX documentation for a detailed description of each of these commands. There is an [online (but outdated) version](https://web.mit.edu/calculix_v2.7/CalculiX/ccx_2.7/doc/ccx/node1.html) and an [up-to-date PDF version](http://www.dhondt.de/ccx_2.19.pdf). +Depending on the data you need to read and write, the interface should define either a `faces-mesh` (or `mesh` as a synonym) where the data points are centers of faces (computed by the adapter) or a mesh made of CalculiX mesh vertices, with the keyword `nodes-mesh`. An interface made of faces should be defined in the CalculiX case input file using the `*SURFACE` command, whereas meshes with nodes should define these nodes using `*NSET`. Using the wrong family of mesh (e.g., reading forces on faces) throws an error. If you need both kinds of meshes, you should define one interface for each. - Valid `writeData` keywords are: +In FSI simulations, the mesh type for an interface is always `nodes-mesh`, as forces and displacement are defined on nodes. The name of this mesh, `Calculix_Mesh`, must match the mesh name given in the preCICE configuration file. In CHT simulations, `faces-mesh` is used. +For defining which nodes of the CalculiX domain belong to the FSI interface, a node set needs to be defined in the CalculiX input files. The name of this node set must match the name of the patch (in this example, `interface`). -On faces-mesh: +In this FSI example, the adapter reads forces from preCICE and feeds displacement deltas (not absolute displacements, but the change of the displacements relative to the last time step) to preCICE. This is defined with the keywords `read-data` and `write-data`, respectively. The names (here: `Forces` and `DisplacementDeltas`) again need to match the specifications in the preCICE configuration file. Absolute displacements can be configured with `Displacements`. -* Pressure -* Heat-Flux -* Sink-Temperature -* Heat-Transfer-Coefficient +Valid `readData` keywords in CalculiX are (with the corresponding boundary types; see the CalculiX documentation): -On nodes-mesh: +* On `faces-mesh`: + * `Pressure` (Use a `*DLOAD`) + * `Heat-Flux` (Use a `*DFLUX`) + * `Sink-Temperature` (Use `*FILM`) + * `Heat-Transfer-Coefficient` (Use `*FILM`) +* On `nodes-mesh`: + * `Forces` (Use a `*CLOAD`) + * `Displacements` (Use `*BOUNDARY`) + * `Temperature` (Use `*BOUNDARY`) -* Forces -* Displacements -* DisplacementDeltas -* Temperature +Valid `writeData` keywords are: -From CalculiX version 2.15, additional `writeData` keywords are available: +* On `faces-mesh`: + * `Pressure` + * `Heat-Flux` + * `Sink-Temperature` + * `Heat-Transfer-Coefficient` +* On `nodes-mesh`: + * `Forces` + * `Displacements` + * `DisplacementDeltas` + * `Temperature` + * `Positions` + * `Velocities` -```text -* Positions -* Velocities -``` +Note that the square brackets imply that several read- and write-data types can be used on a single interface (YAML list). This is mainly useful in CHT Robin coupling simulations. -Note that the square brackets imply that several read- and write-data types can be used on a single interface. This is not needed for FSI simulations (but for CHT simulations). Lastly, the `precice-config-file` needs to be identified including its location. In this example, the file is called `precice-config.xml` and is located one directory above the folder, in which the YAML configuration file lies. +Lastly, `precice-config-file` is the path to the preCICE configuration file. ## CalculiX case input file @@ -111,44 +116,30 @@ CalculiX is designed to be compatible with the Abaqus file format. Here is an ex The adapter internally uses the CalculiX data format for point forces to apply the FSI forces at the coupling interface. This data structure is only initialized for those nodes, which are loaded at the beginning of a CalculiX analysis step via the input file. Thus, it is necessary to load all nodes of the node set, which defines the FSI interface in CalculiX (referring to the above example, the nodes of set `interface` (Note that in CalculiX a node set always begins with an `N` followed by the actual name of the set, which is here `interface`.) are loaded via the `CLOAD` keyword.), in each spatial direction. However, the values of these initial forces can (and should) be chosen to zero, such that the simulation result is not affected. -When using "faces-meshes", instead of a node set (`*NSET`), a `*SURFACE` must be sent, defined by a list of elements and face numbers. Instead of starting with a "N", the name must start with a "S". +When using `faces-meshes`, instead of a node set (`*NSET`), a `*SURFACE` must be sent, defined by a list of elements and face numbers. Instead of starting with an `N`, the name must start with a `S`. -CalculiX CCX offers both a geometrically linear as well as a geometrically non-linear solver. Both are coupled via the adapter. The keyword "NLGEOM" (as shown in the example) needs to be included in the CalculiX case input file in order to select the geometrically non-linear solver. It is also automatically triggered if material non-linearities are included in the analysis. In case the keyword "NLGEOM" does not appear in the CalculiX case input file and the chosen materials are linear, the geometrically linear CalculiX solver is used. In any case, for FSI simulations via preCICE the keyword "DYNAMIC" (enabling a dynamic computation) must appear in the CalculiX input file. +CalculiX CCX offers both a geometrically linear and a geometrically non-linear solver, and both are supported by the adapter. The keyword `NLGEOM` (as shown in the example) selects the geometrically non-linear solver. It is also automatically triggered if material non-linearities are included in the analysis. In case the keyword `NLGEOM` does not appear in the CalculiX case input file and the chosen materials are linear, the geometrically linear CalculiX solver is used. In any case, for FSI simulations, the keyword `DYNAMIC` (enabling a dynamic computation) must appear in the CalculiX input file. More input files that you may find in the CalculiX tutorial cases: * `.inp`: The main case configuration file. Through this, several other files are included. * `.msh`: The mesh file. * `.flm`: Films -* `.nam`: Names, e.g. indices of boundary nodes +* `.nam`: Names, e.g., indices of boundary nodes * `.sur`: Surfaces * `.dfl`: DFlux -## Running the adapted CalculiX executable - -Running the adapted executable is pretty similar to running the original CalculiX CCX solver. The syntax is as follows: - -```bash -ccx_preCICE -i [CalculiX input file] -precice-participant [participant name] -``` - -For example: - -```bash -ccx_preCICE -i flap -precice-participant Calculix -``` - -The input file for this example would be `flap.inp`. Note that the suffix `.inp` needs to be omitted on the command line. The flag `-precice-participant` triggers the usage of the preCICE adapter. If the flag is not used, the original unmodified solver of CalculiX is executed. Therefore, the new executable `ccx_preCICE` can be used both for coupled preCICE simulations and CalculiX-only runs. Note that as mentioned above, the participant name used on the command line must match the name given in the YAML configuration file and the preCICE configuration file. - ### Supported elements -The preCICE CalculiX adapter should support most elements when using `nodes-meshes`. It has been used with both linear and quadratic tetrahedral (C3D4 and C3D10) and hexahedral (C3D8, C3D8I, and [C3D20](http://web.mit.edu/calculix_v2.7/CalculiX/ccx_2.7/doc/ccx/node29.html)) elements. There is however a restriction when using nearest-projection mapping: in that case, you have to use tetrahedral elements. +The CalculiX adapter supports most elements when using `nodes-mesh`. It has been used with both linear and quadratic tetrahedral (`C3D4` and `C3D10`) and hexahedral (`C3D8`, `C3D8I`, and `C3D20`) elements. For nearest-projection mapping, mesh connectivity is only provided when using tetrahedral elements. + +For `faces-mesh`, tetrahedral and hexahedral meshes are supported. -When using face meshes, only tetrahedra and hexahedra are supported. +## Advanced topics ### Coupling to 2D simulations -The adapter supports quasi 2D simulations when the z-direction is ignored. If you set the preCICE interface dimension to 2, the adapter will map data from the CalculiX 3D simulation to 2D space and vice-versa. The 3D simulation should be made of solid elements (or shells) of unit thickness. +The adapter supports quasi-2D simulations when the z-direction is ignored. If you set the preCICE interface dimension to 2, the adapter will map data from the CalculiX 3D simulation to 2D space and vice-versa. The 3D simulation should be made of solid elements (or shells) of unit thickness. #### Behavior with `nodes-mesh` @@ -156,11 +147,11 @@ When writing continuous fields (such as temperature and displacements), the adap #### Behavior with `faces-mesh` -When using `faces-mesh`, the behavior in unchanged and the z-component is discarded. +When using `faces-mesh`, the behavior is unchanged and the z-component is discarded. ### Nearest-projection mapping -In order to use nearest-projection mapping, a few additional changes are required. The first is that the interface surface file (`.sur`) must be added to the CalculiX input file. An example of the addition to the input file is given below +In order to use nearest-projection mapping, a few additional changes are required. The first is that the interface surface file (`.sur`) must be added to the CalculiX input file. For example: ```text *INCLUDE, INPUT=all.msh @@ -172,23 +163,18 @@ In order to use nearest-projection mapping, a few additional changes are require *MATERIAL, Name=EL ``` -This surface file is generated during the mesh generation process. The second addition is to the config.yml. In order for the adapter to know that the surface mesh must be read, the line +This surface file is generated during the mesh generation process. The second addition is to the config.yml. In order for the adapter to know that the surface mesh must be read, the adapter configuration file also needs to be modified: -```yaml -- nodes-mesh -``` - -must be changed to - -```yaml -- nodes-mesh-with-connectivity +```diff +- - nodes-mesh: ++ - nodes-mesh-with-connectivity: ``` -Note that an error will only occur if nodes-mesh-with-connectivity is specified without a `.sur` file. The CalculiX adapter with nearest-projection mapping only supports tetrahedral elements (C3D4 and C3D10) as preCICE only works with surface triangles for nearest-projection mapping. +Note that an error will only occur if `nodes-mesh-with-connectivity` is specified without a `.sur` file. The CalculiX adapter with nearest-projection mapping only supports tetrahedral elements (`C3D4` and `C3D10`), as preCICE only works with surface triangles for nearest-projection mapping. ### Modal dynamic simulations -The adapter supports modal dynamic simulations. In this type of simulation, eigenmodes from a frequency analysis are used. Instead of solving the full system of equations, CalculiX solves the problem as a time dependent linear combination of these eigenmodes; this reduces the number of degrees of freedom of the system. Therefore, the simulation is faster, although its accuracy is dependent on the nonlinearity of the response. This method is very attractive in cases in which the solid dynamics is linear since, if you need many runs of the simulation, the `*FREQUENCY*` extraction step needs to be run only once. +The adapter supports modal dynamic simulations. In this type of simulation, eigenmodes from a frequency analysis are used. Instead of solving the full system of equations, CalculiX solves the problem as a time-dependent linear combination of these eigenmodes; this reduces the number of degrees of freedom of the system. Therefore, the simulation is faster, although its accuracy is dependent on the nonlinearity of the response. This method is very attractive in cases in which the solid dynamics is linear since, if you need many runs of the simulation, the `*FREQUENCY*` extraction step needs to be run only once. To run a case with a `*MODAL DYNAMIC` analysis, the adapter has a special requirement. The `*FREQUENCY` step and the `*MODAL DYNAMIC` step must be run in different input files, as it is a requirement of the adapter to extract the frequency and modal data with a dedicated `.inp` file and then run the modal dynamic analysis without adding the frequency extraction step. The first run creates a `.eig` file with the modal information needed for the second run. @@ -280,10 +266,10 @@ Make sure to replace `[CalculiX input file]` and `[CalculiX participant name]` w ### Parallelization -CalculiX comes with OpenMP and the SPOOLES library which itself can use OpenMP. The adapter also supports this and parallel runs can be used in the same way as with the uncoupled version of CalculiX. You can specify the number of threads via the `OMP_NUM_THREADS` environment variable. For a finer configuration, look at the CalculiX documentation. +CalculiX comes with OpenMP and the SPOOLES library, which itself can use OpenMP. The adapter also supports this, and parallel runs can be used in the same way as with the uncoupled version of CalculiX. You can specify the number of threads via the `OMP_NUM_THREADS` environment variable. For a finer configuration, look at the CalculiX documentation. You can also try [GPU acceleration with PaStiX](adapter-calculix-pastix-build.html). -## Restarting +### Restarting To restart a CalculiX simulation, we need to enable restart files (`.rout`), run the first simulation, and then restart the second simulation from that using a modified input file and renaming the `.rout` to `.rin`. See an [example from the community](https://pawel-lojek.medium.com/resuming-fsi-simulations-with-openfoam-calculix-896088861ae). @@ -298,7 +284,7 @@ This section might be incomplete or contain inaccuracies. Help improve this page 1.E-2, 0.1 ``` - The first number specifies the time step size, while the second specifies the duration of the current STEP. When restarting with the same number of time steps per STEP, the second number should not be modified. + The first number specifies the time step size, while the second specifies the duration of the current `STEP`. When restarting with the same number of time steps per `STEP`, the second number should not be modified. 2. Under the section specifying the time step size and end time, enable writing restart files (in this case, for every step): ```text @@ -307,7 +293,7 @@ This section might be incomplete or contain inaccuracies. Help improve this page At the very end of the simulation, and after a normal exit, a file `.rout` will be generated. Rename this file to `.rin`. -3. To restart a simulation, remove the mesh, material, and *INCLUDE sections from the input (.inp) file, keep/adapt the *STEP section(s), and add the following line as the first line of the file: +3. To restart a simulation, remove the mesh, material, and `*INCLUDE` sections from the input (`.inp`) file, keep/adapt the `*STEP` section(s), and add the following line as the first line of the file: ```text *RESTART,READ diff --git a/docs/get-adapter.md b/docs/get-adapter.md index 2e5aee5..f974dda 100644 --- a/docs/get-adapter.md +++ b/docs/get-adapter.md @@ -7,9 +7,9 @@ keywords: adapter, calculix, building summary: "The CalculiX adapter provides the executable `ccx_preCICE`. You can get the adapter either from a Debian package (on Ubuntu), or build it from source." --- -After [installing preCICE](https://precice.org/installation-overview.html) and [getting the CalculiX source and the required dependencies](adapter-calculix-get-calculix.html), you can now build the adapter, i.e. a modified CCX executable. +After [installing preCICE](https://precice.org/installation-overview.html) and [getting the CalculiX source and the required dependencies](adapter-calculix-get-calculix.html), you can now build the adapter, i.e., a modified CalculiX executable. -There are two ways to get the adapter: (a) get a binary package (Ubuntu-only), or (b) build it from source. The latest adapter version is v2.20.1 and the versioning format is `.`. +There are two ways to get the adapter: (a) get a binary package (Ubuntu-only) or (b) build it from source. The adapter follows the versioning format `.`. ## Get a binary package @@ -24,17 +24,13 @@ sudo apt install ./calculix-precice3_2.20.1-1_amd64_resolute.deb This requires that also preCICE itself has been installed from a Debian package. -{% tip %} +{% important %} Replace `resolute` with `noble` to get the package for Ubuntu 24.04 (Noble Numbat), or with `jammy` for Ubuntu 22.04 (Jammy Jellyfish). -{% endtip %} - -{% note %} -We started offering Debian packages for the CalculiX adapter since v2.19.0. Please [give us your feedback](https://precice.org/community-channels.html)! -{% endnote %} +{% endimportant %} ## Building the adapted CalculiX -1. Download and unzip the latest state of the adapter (e.g. in the `CalculiX` folder), currently supporting CalculiX v2.20: +1. Download and unzip the latest state of the adapter (e.g. in the `CalculiX` folder), and see the `README.md` for the supported CalculiX version: ```bash wget https://github.com/precice/calculix-adapter/archive/refs/heads/master.tar.gz @@ -44,24 +40,19 @@ We started offering Debian packages for the CalculiX adapter since v2.19.0. Plea 2. Edit the `Makefile` to set the paths to dependencies. - If you have the CalculiX source in `~/CalculiX/` and the dependencies in your global paths, you don't need to change anything. - - Otherwise, set `CCX` and, if built from source, the include and lib flags for the dependencies. - - Read below if you are [using GCC 10 or later](#compiling-with-gcc-10-or-newer). + - Otherwise, set `CCX` and the include and lib flags for the dependencies. 3. Clean any previous builds with `make clean`. -4. Build with `make` (e.g. `make -j 4` for parallel). +4. Build with `make` (e.g., `make -j 4` for parallel). 5. You should now have a new executable `ccx_preCICE` in the `bin/` folder of the adapter. You may move this file to a path known by your system, or [add this to your `PATH`](https://unix.stackexchange.com/a/26059/36693) (careful when doing this!). ### Building the adapter with PaStiX -Since version 2.17 of CalculiX, it is possible to link the PaStiX solver for increased performance, mostly through GPUs. Building the adapter with PaStiX is quite tedious, as most dependencies of PaStiX and PaStiX itself must be built from source. Check our [detailed instructions on building the adapter with PaStiX](adapter-calculix-pastix-build.html). +CalculiX can link to the PaStiX solver for increased performance using GPUs. Building the adapter with PaStiX is quite tedious, as most dependencies of PaStiX and PaStiX itself must be built from source. Check some [instructions on building the adapter with PaStiX](adapter-calculix-pastix-build.html). ### Makefile options The adapter is built using GNU Make. The `Makefile` contains a few variables on top, which need to be adapted to your system: -{% version %} -The variables `YAML_INCLUDE` and `YAML_LIBS` are only relevant up to the adapter v2.20.1. -{% endversion %} - 1. `CCX`: Location of the original CalculiX solver (CCX) source code ("src" directory) - Example: `$(HOME)/CalculiX/ccx_2.20/src` 2. `SPOOLES_INCLUDE`: Include flags for SPOOLES @@ -83,6 +74,10 @@ The variables `YAML_INCLUDE` and `YAML_LIBS` are only relevant up to the adapter - Example 1: `YAML_LIBS = -lyaml-cpp` (installed) - Example 2: `YAML_LIBS = -L$(HOME)/yaml-cpp/build -lyaml-cpp` (source) +{% version %} +The variables `YAML_INCLUDE` and `YAML_LIBS` are only relevant up to the adapter v2.20.1. +{% endversion %} + You may also want to adjust the compiler `FC` from `mpifort` to `mpif90` or to any other compiler your system uses. See also the [troubleshooting](adapter-calculix-troubleshooting.html) page for further known issues. diff --git a/docs/get-calculix.md b/docs/get-calculix.md index 5d6bc0f..a321c31 100644 --- a/docs/get-calculix.md +++ b/docs/get-calculix.md @@ -144,6 +144,8 @@ make After building, make sure that you make yaml-cpp discoverable by setting e.g. your `LD_LIBRARY_PATH`. You don't need this for the CalculiX adapter, but you would need it e.g. for the OpenFOAM adapter. +**Note:**: While v0.6.2 is known to work, try the latest available version first. Newer compilers might only be supported by newer versions. + **Note**: If you use Boost 1.67 or newer, then you also need to install yaml-cpp 0.6 or newer. Similarly, for an older Boost version, you also need an older yaml-cpp. Unfortunately, this is not related to the adapter's code. @@ -163,7 +165,9 @@ The source code is now in the `~/CalculiX/ccx_2.20/src` directory. The adapter's ### Building the "vanilla" CalculiX (optional) -If you want to build the "vanilla" (i.e. without preCICE) CalculiX, you can now run `make` inside the `src/` directory. Depending on how you installed the dependencies above (using `apt` or from source), you might get compilation errors, such as `spooles.h:26:10: fatal error: misc.h: No such file or directory`. Often these errors can be easily fixed by modifying CalculiX `Makefile`. Please refer to [our adapter's makefile options](adapter-calculix-get-adapter.html#makefile-options) for a list of library and include flag you might have to set depending on your installation procedure. +If you want to build the "vanilla" (i.e., without preCICE) CalculiX, you can now run `make` inside the `src/` directory. + +Depending on how you installed the dependencies above (using `apt` or from source), you might get compilation errors, such as `spooles.h:26:10: fatal error: misc.h: No such file or directory`. Often these errors can be easily fixed by modifying CalculiX `Makefile`. Please refer to [the Makefile options of the adapter](adapter-calculix-get-adapter.html#makefile-options) for a list of library and include flags you might have to set depending on your installation procedure. ### Building the modified CalculiX From cb170ce1ef4e0500e0fbb9f07f4f8fa9490d6dcf Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 13:47:12 +0200 Subject: [PATCH 4/8] Remove the reference to the website repository --- .github/PULL_REQUEST_TEMPLATE/release.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 1c62e7e..db99444 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -17,13 +17,10 @@ I updated the adapter version in the following: Outside this repository: -- [ ] [website](https://github.com/precice/precice.github.io): Update the variables: - - `calculix_adapter_version` - - `calculix_version` - [ ] [tutorials](https://github.com/precice/tutorials/tree/develop/tools/tests): Update the default CalculiX version in the system tests: - `components.yaml` - `reference_versions.yaml` (if the reference results need to be updated) System tests: -- [ ] I triggered the system tests by adding the `trigger-system-tests` label. \ No newline at end of file +- [ ] I triggered the system tests by adding the `trigger-system-tests` label. From 3172e8edb45b8a04e4c4c118b80cb8fc60749518 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 13:48:46 +0200 Subject: [PATCH 5/8] Make bullet point markers consistent --- docs/configure.md | 54 ++++++++++++++++++++--------------------- docs/troubleshooting.md | 14 +++++------ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/configure.md b/docs/configure.md index e52fdfe..4b35ced 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -50,30 +50,30 @@ In this FSI example, the adapter reads forces from preCICE and feeds displacemen Valid `readData` keywords in CalculiX are (with the corresponding boundary types; see the CalculiX documentation): -* On `faces-mesh`: - * `Pressure` (Use a `*DLOAD`) - * `Heat-Flux` (Use a `*DFLUX`) - * `Sink-Temperature` (Use `*FILM`) - * `Heat-Transfer-Coefficient` (Use `*FILM`) -* On `nodes-mesh`: - * `Forces` (Use a `*CLOAD`) - * `Displacements` (Use `*BOUNDARY`) - * `Temperature` (Use `*BOUNDARY`) +- On `faces-mesh`: + - `Pressure` (Use a `*DLOAD`) + - `Heat-Flux` (Use a `*DFLUX`) + - `Sink-Temperature` (Use `*FILM`) + - `Heat-Transfer-Coefficient` (Use `*FILM`) +- On `nodes-mesh`: + - `Forces` (Use a `*CLOAD`) + - `Displacements` (Use `*BOUNDARY`) + - `Temperature` (Use `*BOUNDARY`) Valid `writeData` keywords are: -* On `faces-mesh`: - * `Pressure` - * `Heat-Flux` - * `Sink-Temperature` - * `Heat-Transfer-Coefficient` -* On `nodes-mesh`: - * `Forces` - * `Displacements` - * `DisplacementDeltas` - * `Temperature` - * `Positions` - * `Velocities` +- On `faces-mesh`: + - `Pressure` + - `Heat-Flux` + - `Sink-Temperature` + - `Heat-Transfer-Coefficient` +- On `nodes-mesh`: + - `Forces` + - `Displacements` + - `DisplacementDeltas` + - `Temperature` + - `Positions` + - `Velocities` Note that the square brackets imply that several read- and write-data types can be used on a single interface (YAML list). This is mainly useful in CHT Robin coupling simulations. @@ -122,12 +122,12 @@ CalculiX CCX offers both a geometrically linear and a geometrically non-linear s More input files that you may find in the CalculiX tutorial cases: -* `.inp`: The main case configuration file. Through this, several other files are included. -* `.msh`: The mesh file. -* `.flm`: Films -* `.nam`: Names, e.g., indices of boundary nodes -* `.sur`: Surfaces -* `.dfl`: DFlux +- `.inp`: The main case configuration file. Through this, several other files are included. +- `.msh`: The mesh file. +- `.flm`: Films +- `.nam`: Names, e.g., indices of boundary nodes +- `.sur`: Surfaces +- `.dfl`: DFlux ### Supported elements diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index e650b0f..b6dd8f3 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -11,13 +11,13 @@ This list is definitely not complete. If after reading this, you still have issu ## Things to check -* Are you using the same version of CalculiX and of the CalculiX adapter? The adapter installation works by replacing files of the original CalculiX, so they should be compatible. -* Can you manually run the `ccx_preCICE` binary? - * It should be in your `$PATH` - * If autocompletion does not work (e.g. `ccx_` + TAB key), then it is probably not in your `$PATH`. -* Our tutorials also require CGX (pre- and post-processor of CalculiX). - * Is CGX installed? - * Is OpenGL (required by CGX) installed? +- Are you using the same version of CalculiX and of the CalculiX adapter? The adapter installation works by replacing files of the original CalculiX, so they should be compatible. +- Can you manually run the `ccx_preCICE` binary? + - It should be in your `$PATH` + - If autocompletion does not work (e.g. `ccx_` + TAB key), then it is probably not in your `$PATH`. +- Our tutorials also require CGX (pre- and post-processor of CalculiX). + - Is CGX installed? + - Is OpenGL (required by CGX) installed? ## Compiling with GCC 10 or newer From 29086df78d61e6ba1da8e73c4f330b8aa0b6fd83 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 13:52:42 +0200 Subject: [PATCH 6/8] Restructure the configure.md page --- docs/configure.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/configure.md b/docs/configure.md index 4b35ced..f14919b 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -129,25 +129,21 @@ More input files that you may find in the CalculiX tutorial cases: - `.sur`: Surfaces - `.dfl`: DFlux +## Notes on meshes + ### Supported elements The CalculiX adapter supports most elements when using `nodes-mesh`. It has been used with both linear and quadratic tetrahedral (`C3D4` and `C3D10`) and hexahedral (`C3D8`, `C3D8I`, and `C3D20`) elements. For nearest-projection mapping, mesh connectivity is only provided when using tetrahedral elements. For `faces-mesh`, tetrahedral and hexahedral meshes are supported. -## Advanced topics - ### Coupling to 2D simulations The adapter supports quasi-2D simulations when the z-direction is ignored. If you set the preCICE interface dimension to 2, the adapter will map data from the CalculiX 3D simulation to 2D space and vice-versa. The 3D simulation should be made of solid elements (or shells) of unit thickness. -#### Behavior with `nodes-mesh` - -When writing continuous fields (such as temperature and displacements), the adapter will send data that is averaged over thickness. For conservative data (such as forces), sums are computed. When reading forces, the load applied to a 2D point will be spread evenly between the 3D points sharing the same x and y coordinates. - -#### Behavior with `faces-mesh` +For `nodes-mesh`, when writing continuous fields (such as temperature and displacements), the adapter will send data that is averaged over thickness. For conservative data (such as forces), sums are computed. When reading forces, the load applied to a 2D point will be spread evenly between the 3D points sharing the same x and y coordinates. -When using `faces-mesh`, the behavior is unchanged and the z-component is discarded. +For `faces-mesh`, the z-component is discarded. ### Nearest-projection mapping @@ -172,7 +168,7 @@ This surface file is generated during the mesh generation process. The second ad Note that an error will only occur if `nodes-mesh-with-connectivity` is specified without a `.sur` file. The CalculiX adapter with nearest-projection mapping only supports tetrahedral elements (`C3D4` and `C3D10`), as preCICE only works with surface triangles for nearest-projection mapping. -### Modal dynamic simulations +## Modal dynamic simulations The adapter supports modal dynamic simulations. In this type of simulation, eigenmodes from a frequency analysis are used. Instead of solving the full system of equations, CalculiX solves the problem as a time-dependent linear combination of these eigenmodes; this reduces the number of degrees of freedom of the system. Therefore, the simulation is faster, although its accuracy is dependent on the nonlinearity of the response. This method is very attractive in cases in which the solid dynamics is linear since, if you need many runs of the simulation, the `*FREQUENCY*` extraction step needs to be run only once. @@ -264,12 +260,12 @@ ccx_preCICE -i [CalculiX input file] -precice-participant [CalculiX participant Make sure to replace `[CalculiX input file]` and `[CalculiX participant name]` with the appropriate file and name for your case. -### Parallelization +## Parallelization CalculiX comes with OpenMP and the SPOOLES library, which itself can use OpenMP. The adapter also supports this, and parallel runs can be used in the same way as with the uncoupled version of CalculiX. You can specify the number of threads via the `OMP_NUM_THREADS` environment variable. For a finer configuration, look at the CalculiX documentation. You can also try [GPU acceleration with PaStiX](adapter-calculix-pastix-build.html). -### Restarting +## Restarting To restart a CalculiX simulation, we need to enable restart files (`.rout`), run the first simulation, and then restart the second simulation from that using a modified input file and renaming the `.rout` to `.rin`. See an [example from the community](https://pawel-lojek.medium.com/resuming-fsi-simulations-with-openfoam-calculix-896088861ae). From c0be6fd382dc7bb9b57ef1bb9ff203eb8b59a3d1 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 15:19:52 +0200 Subject: [PATCH 7/8] Fix minor language issues --- docs/configure.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/configure.md b/docs/configure.md index 4efc397..2a9a301 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -43,18 +43,18 @@ The name of the participant `Calculix` must match the command-line argument `-pr Depending on the data you need to read and write, the interface should define a mesh of one of the following types: -- a `faces-mesh` (or `mesh` as a synonym), where the data points are centers of faces (computed by the adapter). An interface made of faces should be defined in the CalculiX case using the `*SURFACE` command. -- a `nodes-mesh`, where the data points are the nodal vertices. An interface made of nodes should define these nodes using `*NSET`. -- an `elements-mesh`, where the data points are the quadrature points of the elements of a mesh. The mesh should be defined by nodes using `*NEST`. **Note**: `elements-mesh` is still experimental. +- `faces-mesh` (or `mesh` as a synonym): The data points are centers of faces (computed by the adapter). An interface made of faces should be defined in the CalculiX case using the `*SURFACE` command. +- `nodes-mesh`: The data points are the nodal vertices. An interface made of nodes should define these nodes using `*NSET`. +- `elements-mesh`: The data points are the quadrature points of the elements of a mesh. The mesh should be defined by nodes using `*NEST`. **Note**: `elements-mesh` is still experimental. -Using the wrong family of mesh (e.g. reading forces on faces) throws an error. If you need both kinds of meshes, you should define more than one interface. +Using the wrong family of mesh (e.g., reading forces on faces) throws an error. If you need both kinds of meshes, you should define one interface for each. In FSI simulations, the mesh type for an interface is always `nodes-mesh`, as forces and displacement are defined on nodes. The name of this mesh, `Calculix_Mesh`, must match the mesh name given in the preCICE configuration file. In CHT simulations, `faces-mesh` is used. For defining which nodes of the CalculiX domain belong to the FSI interface, a node set needs to be defined in the CalculiX input files. The name of this node set must match the name of the patch (in this example, `interface`). -For multiscale mechanics simulations, the mesh type is always `elements-mesh`. The stresses, strains, and the material stiffness are defined on the quadrature points. +For multiscale mechanics simulations, the mesh type is always `elements-mesh`. The stresses, strains, and material stiffness are defined on the quadrature points. -In this FSI example, the adapter reads forces from preCICE and feeds displacement deltas (not absolute displacements, but the change of the displacements relative to the last time step) to preCICE. This is defined with the keywords `read-data` and `write-data`, respectively. The names (here: `Forces` and `DisplacementDeltas`) again need to match the specifications in the preCICE configuration file. Absolute displacements can be configured with `Displacements`. +In this FSI example, the adapter reads forces from preCICE and feeds displacement deltas (not absolute displacements, but the change of the displacements relative to the last time step) to preCICE. This is defined with the keywords `read-data` and `write-data`, respectively. The names (here: `Forces` and `DisplacementDeltas`) again need to match the specifications in the preCICE configuration file. Absolute displacements can be configured with `Displacements`. Valid `readData` keywords in CalculiX are (with the corresponding boundary types; see the CalculiX documentation): From ccac447dcbe0af3c0fdbea44e255082ff10c8d6d Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 3 Aug 2026 15:24:03 +0200 Subject: [PATCH 8/8] Add links to FSI training and visualization tips --- docs/configure.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configure.md b/docs/configure.md index 2a9a301..78d2699 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -23,6 +23,8 @@ ccx_preCICE -i flap -precice-participant Calculix The input file for this example would be `flap.inp`. Note that the suffix `.inp` needs to be omitted on the command line. The flag `-precice-participant` triggers the usage of the preCICE adapter. If the flag is not used, the original unmodified solver of CalculiX is executed, allowing CalculiX-only runs. Note that as mentioned above, the participant name used on the command line must match the name given in the YAML configuration file and in the preCICE configuration file. +Besides this page, see also a [step-by-step guide on setting up CalculiX-preCICE simulations](https://doi.org/10.5281/zenodo.13961370) and some [visualization tips](https://precice.org/tutorials-visualization.html). + ## Adapter configuration file The adapter looks for a YAML-based configuration file named `config.yml`, which, for historical reasons, starts by defining a list of participants. For example, for an FSI simulation: