Skip to content

Add support for waveform relaxation with linear interpolation.#35

Merged
BenjaminRodenberg merged 75 commits intoCoupledProblems2019from
WaveformBindingsDraft
Jun 18, 2019
Merged

Add support for waveform relaxation with linear interpolation.#35
BenjaminRodenberg merged 75 commits intoCoupledProblems2019from
WaveformBindingsDraft

Conversation

@BenjaminRodenberg
Copy link
Copy Markdown
Contributor

@BenjaminRodenberg BenjaminRodenberg commented May 8, 2019

This PR collects all the changes that are relevant to add waveform relaxation support in the FEniCS adapter.

  • If subcycling is used, results that belong to the substeps may be exchanged, as well.
  • Exchange of additional data that is associated with the substeps is realized by introducing additional data in the precice-config. Temperature becomes Temperature1, Temperature2,...
  • Linear interpolation is used between substeps.

Be aware that this approach is not compatible with the original preCICE API and experimental. In waveform_bindings.py API functions like readBlockScalarData are extended with the additional parameter time (see here).

For example usage of the modified adapter, refer to precice/tutorials#30.

* Updates README.md
* Creates a dummy precice package for successful testing
import numpy as np
from .config import Config
from .checkpointing import Checkpoint
from .solverstate import SolverState
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this "." notation here is standard and only looks weird to me. When should that be used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The . indicates a relative import (see https://realpython.com/absolute-vs-relative-python-imports/). In this project it was the first thing that came to my mind. As far as I understand an absolute import should also work (instead of from .config import Config one can use the statement from fenicsadapter.config import Config).

As far as I understand the article above, the main reasons for using relative imports are a better readability and more flexibility when it comes to moving packages/subpackages within the project. This means, we could indeed switch from relative to absolute imports, but I think in the end it does not really matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants