ASTE wiith conservative and consistent mapping

Hi,

I am using ASTE to write a review of the various mapping methods available in preCICE v3.0.

I have a question regarding the procedure to investigate the properties of conservative and consistent mapping. Following the setup given in the official tutorial for ASTE, I can test mapping methods with the consistent option without any issues, but if I use the conservative, I require somewhat matching meshes for ASTE to perform its task.

However, everything runs fine when using the test setup given in Schneider’s latest article:

<?xml version="1.0" encoding="UTF-8" ?>

<precice-configuration>

  <log>
    <sink type="file" output="debug.log" filter="" format='%TimeStamp(format="%H:%M:%S.%f")%|%Participant%|%Rank%|%Module%|l%Line%|%Function%|%Severity%%Message%' />
  </log>

  <profiling flush-every="50" directory="." mode="all" synchronize="true" />

    <!-- Data fields that are exchanged between the solvers -->
    <data:scalar name="Data" />

    <!-- A common mesh that uses these data fields -->
    <mesh name="A-Mesh" dimensions="3">
      <use-data name="Data" />
    </mesh>

    <mesh name="B-Mesh" dimensions="3">
      <use-data name="Data" />
    </mesh>

    <m2n:sockets acceptor="A" connector="B" exchange-directory="." network="ib0"/>

    <participant name="A">
      <provide-mesh name="A-Mesh" />
      <write-data name="Data" mesh="A-Mesh" />
      <receive-mesh name="B-Mesh" from="B" />
      <mapping:nearest-neighbor constraint="conservative" direction="write" from="A-Mesh" to="B-Mesh" />
    </participant>

    <participant name="B">
      <provide-mesh name="B-Mesh" />
      <read-data name="Data" mesh="B-Mesh" />
      <receive-mesh name="A-Mesh" from="A" />
      <mapping:nearest-neighbor constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" />
    </participant>

    <coupling-scheme:parallel-explicit>
      <participants first="A" second="B" />
      <max-time value="1.0" />
      <time-window-size value="1" />
      <exchange data="Data" mesh="A-Mesh" from="A" to="B" substeps="false" />
      <exchange data="Data" mesh="B-Mesh" from="B" to="A" />
    </coupling-scheme:parallel-explicit>

</precice-configuration>

Is this last configuration the only way to evaluate the quality of mapping methods under their conservative formulation or do I understand the setup not correctly? The commands I used are the same as those presented in this shell script:

#!/usr/bin/env bash
set -e -x

# This script assumes the ASTE binaries and python scripts are in $PATH or ASTE installed on your system

# Download the meshes
test -f meshes.tar.gz  || wget https://gitlab.lrz.de/precice/precice2-ref-paper-setup/-/raw/main/meshes/meshes.tar.gz

mkdir -p meshes

# Extract the meshes
test -f meshes/0.006.vtk -a meshes/0.01.vtk || tar -xvf meshes.tar.gz --directory meshes

# Generate input data for the mapping problem using the predefined Franke's function function
precice-aste-evaluate -m meshes/0.01.vtk -f "franke3d" -d "Franke" -o input_mesh.vtu

# Decompose both meshes to two procesors
# Choose resolution 0.01 mesh as coarse mesh and partition the mesh using a uniform algorithm
precice-aste-partition -m input_mesh.vtu -n 2 -o coarse_mesh --dir coarse_mesh --algorithm uniform
# Choose resolution 0.006 mesh as coarse mesh and partition the mesh using a meshfree algorithm
precice-aste-partition -m meshes/0.006.vtk -n 2 -o fine_mesh --dir fine_mesh --algorithm meshfree

# Create results directory of precice-aste-run
mkdir -p mapped

# Map from coarse mesh to fine mesh, start two ASTE instances, one for each participant
mpirun -n 2 precice-aste-run -p A --mesh coarse_mesh/coarse_mesh --data "Franke" &
mpirun -n 2 precice-aste-run -p B --mesh fine_mesh/fine_mesh --output mapped/mapped --data "InterpolatedData"

# Join the output files together to result.vtu
precice-aste-join -m mapped/mapped -o result.vtu --recovery fine_mesh/fine_mesh_recovery.json

# Measure the difference between the original function and the mapped values
# Save into data array called Error
precice-aste-evaluate -m result.vtu -f "franke3d" -d "Error" --diffdata "InterpolatedData" --diff --stats

Thank you in advance for your answer.

Evaluating the mapping quality for conservative mappings is a delicate question and there is no straightforward answer to this. The built-in mechanism for ASTEs error calculation simply compares to the reference values on the output mesh, but (depending on the refinement levels of input and output), this is certainly not what the conservative mapping converges to if you let’s say refine the input mesh on a continuous function.

So in the end, the question is probably rather “what are your design objectives” with a conservative mapping. Some people simply look at the "conservative"ness of the method (see e.g. the thesis of Florian https://elib.uni-stuttgart.de/bitstream/11682/10598/3/Lindner%20-%20Data%20Transfer%20in%20Partitioned%20Multi-Physics%20Simulations.pdf ), but the conservatine’ness doesn’t make any statement about individual point values.

For error calculations, I don’t use the results provided by ASTE and I compute them directly myself using the metrics provided in the thesis of Florian Lindner that you provided a link to. I understand that conservative’ness, if I understand it correctly, of the method will be reflected in the conservation of the integral.

The idea behind the investigation of their properties is to provide a high level overview, without any links to a precise real-world configuration (although I am using ASTE on cartesian meshes from cases I will do later).