Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add tests for volume coupling and fix it #163

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
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
29 changes: 27 additions & 2 deletions .github/workflows/run-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
run_ht_simple:
name: Run HT, simple
name: Run HT, simple (surface coupling with matching meshes)
runs-on: ubuntu-latest
container: precice/precice:develop
steps:
Expand All @@ -35,7 +35,7 @@ jobs:
cd dirichlet-fenics && ./run.sh & cd neumann-fenics && ./run.sh

run_ht_complex:
name: Run HT, complex
name: Run HT, complex (surface coupling with nearest projection)
runs-on: ubuntu-latest
container: precice/precice:develop
steps:
Expand All @@ -58,3 +58,28 @@ jobs:
run: |
cd tutorials/partitioned-heat-conduction-complex
cd dirichlet-fenics && ./run.sh & cd neumann-fenics && ./run.sh

run_channel_transport_reaction:
name: Run channel-transport-reaction (volume coupling with linear cell interpolation)
runs-on: ubuntu-latest
container: precice/precice:develop
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies & FEniCS
run: |
apt-get -qq update
apt-get -qq install software-properties-common python3-dev python3-pip git apt-utils
add-apt-repository -y ppa:fenics-packages/fenics
apt-get -qq install --no-install-recommends fenics
rm -rf /var/lib/apt/lists/*
- name: Install adapter
run: pip3 install --user .
- name: Fix broken FEniCS installation (see https://fenicsproject.discourse.group/t/installing-python-package-with-fenics-dependency-breaks-fenics-installation/4476)
run: pip3 uninstall -y fenics-ufl
- name: Get tutorials
run: git clone -b develop https://github.com/precice/tutorials.git
- name: Run tutorial
run: |
cd tutorials/channel-transport-reaction
cd fluid-fenics && ./run.sh & cd chemical-fenics && ./run.sh
16 changes: 9 additions & 7 deletions fenicsprecice/fenicsprecice.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,17 @@ def initialize(self, coupling_subdomain, read_function_space=None, write_object=
function_space, coupling_subdomain, self._owned_vertices.get_global_ids(), id_mapping)

# Surface coupling over 1D edges
# TODO call set_mesh_edges, if using surface coupling. Otherwise does not make sense.
self._participant.set_mesh_edges(self._config.get_coupling_mesh_name(), edge_vertex_ids)

# Code below does not work properly. Volume coupling does not integrate well with surface coupling in this state. See https://github.com/precice/fenics-adapter/issues/162.
# # Configure mesh connectivity (triangles from edges) for 2D simulations
# if self._fenics_dims == 2:
# vertices = get_coupling_triangles(function_space, coupling_subdomain, fenics_edge_ids, id_mapping)
# self._participant.set_mesh_triangles(self._config.get_coupling_mesh_name(), vertices)
# else:
# print("Mesh connectivity information is not written for 3D cases.")
# Configure mesh connectivity (triangles from edges) for 2D simulations
# TODO only enter code below, if using volume coupling. Otherwise does not make sense.
if self._fenics_dims == 2:
# Volume coupling over 2D triangles
vertices = get_coupling_triangles(function_space, coupling_subdomain, fenics_edge_ids, id_mapping)
self._participant.set_mesh_triangles(self._config.get_coupling_mesh_name(), vertices)
else:
print("Mesh connectivity information is not written for 3D cases.")

if self._participant.requires_initial_data():
if not write_function:
Expand Down
Loading