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.