1. 3D Simulations

Use MagSim this app to run simulations of High Field Magnets for:

  • ThermoElectric

  • CoupledCartModel

1.1. To test the app

To check the app, just change the following values:

  • ThermoElectric

Key Value

execfile

feelpp_hfm_thermoelectric_model_3D_V1T1_N1

cfgfile

/usr/share/doc/hifimagnet/ThermoElectricModel/quarter-turn3D.cfg

  • CoupledModel

Key Value

execfile

feelpp_hfm_coupledmodel_3DP1N1

cfgfile

/usr/share/doc/hifimagnet/CoupledModel/quarter-torus3D.cfg

Alternatively the are also some additionnal tests:

  • /usr/share/doc/hifimagnet/CoupledModel/quarter-torus3D-reg.cfg

  • /usr/share/doc/hifimagnet/CoupledModel/quarter-torus3D-saddle.cfg

  • /usr/share/doc/hifimagnet/CoupledModel/quarter-torus3D-singular.cfg

Key Value

execfile

feelpp_hfm_coupledcartmodel_3DP1N1

cfgfile

/usr/share/doc/hifimagnet/CoupledCartModel/quarter-torus3D_bmap.cfg

  • CoupledCartModel

Key Value

execfile

feelpp_hfm_coupledcartmodel_3DP1N1

cfgfile

/usr/share/doc/hifimagnet/CoupledCartModel/quarter-torus3D.cfg

Aternatively there is an other test:

  • /usr/share/doc/hifimagnet/CoupledCartModel/quarter-torus3D_bmap.cfg

1.2. Prepare your simulation

  • provide appropiate configuration, model and materials (see here for details)

  • create an tar gzipped archive of these files

  • upload the data on Data Catalogue (see here for details)

The partition.sh script has be included in each dataset uploaded to Data Catalogue.

#! /bin/bash
set -x

usage(){
   echo ""
   echo "Description:"
   echo "               Laod a cfg file and Partition Mesh "
   echo ""
   echo "Usage:"
   echo "               partition.sh -i cfg -n parts [force]]"
   echo ""
   echo "Options:"
   echo "-i <cfgfile>   Specify the input file"
   echo "-n <parts>     Number of partitions"
   echo "-f             Force the partitionning of the mesh"
   echo "-h             Prints this help information"
   echo ""
}

#########################################################
## parse parameters
##########################################################
while getopts "hi:n:f" option ; do
   case $option in
       h ) usage ;;
       i ) INPUT=$OPTARG ;;
       n ) PARTS=$OPTARG ;;
       f ) FORCE=true ;;
       ? ) usage ;;
   esac
done
# shift to have the good number of other args
shift $((OPTIND - 1))

: ${INPUT:="None"}
: ${PARTS:=1}
: ${FORCE:=false}

# echo "INPUT=$INPUT"
# echo "PARTS=$PARTS"
# echo "FORCE=$FORCE"

if [ ! -f ./"$INPUT" ] || [ "$INPUT" = "None" ]; then
    echo "no input file found: $INPUT"
    echo "usage: partition INPUT [PARTS] [false|true]"
    exit 1
fi

if [ "$PARTS" -eq 1 ]; then
    echo "skip partition as PARTS=$PARTS"
    exit 0
fi

FILEMSH=$(grep "geofile=" $INPUT |  cut -d "=" -f2)
echo "FILEMSH=$FILEMSH"

PMESH=$(echo $FILEMSH | cut -d "." -f1)
EXT=$(echo $FILEMSH | cut -d "." -f2)
echo "PMESH=$PMESH"
echo "EXT=$EXT"

if [ "$EXT" = "geo" ] ||  [ "$EXT" = "msh" ] ||  [ "$EXT" = "med" ]; then
    exit 0
fi

# check if json file is already partitioned with PARTS
if [ "$EXT" = "json" ]; then
    N=$(egrep "\"n\":" ${FILEMSH} |  cut -d ":" -f2 | tr -d '[:space:]' | tr -d '\"')
    echo "N=$N"
    if [ $N -eq $PARTS ]; then
	echo "${FIELMSH} already partitionned with $PARTS"
        if  [ ! $FORCE ]; then
	    exit 0
	else
	    echo "Force partition with $PARTS"
	fi
    fi

    # MSH serial
    MESH=$(echo $PMESH | perl -pe "s|_p||g")
    echo "Looking for $MESH"
    if [ -f $MESH.msh ]; then
	echo "Original Mesh: $MESH.msh"
	MESH=$(echo $MESH.msh)
    elif [ -f $MESH.med ]; then
	echo "Original Mesh: $MESH.med"
	gmsh -3 -bin $MESH.med -o $MESH.msh
	status=$?
	if [ "$status" != "0" ]; then
	    echo "Fail to convert $MESH.med into $MESH.msh"
	    exit 1
	fi
	MESH=$(echo $MESH.msh)
    else
	echo "No Original Mesh found (.msh or .med supported)"
	exit 1
    fi
fi


echo "feelpp_mesh_partitioner --gmsh.scale=0.001 --ifile ${MESH}.msh --ofile ${PMESH} --part ${PARTS}"
feelpp_mesh_partitioner --gmsh.scale=0.001 --ifile ${MESH} --ofile ${PMESH} --part ${PARTS}
status=$?

if [ "$status" != "0" ]; then
    echo "feelpp_mesh_partitioner --gmsh.scale=0.001 --ifile ${MESH} --ofile ${PMESH} --part ${PARTS}: FAILS (status=$status)"
    echo "see partition.log for details"
    exit 1
fi

1.3. Set up the simulation in Experiments:

Key Default Notes

execfile

feelpp_hfm_thermoelectric_model_3D_V1T1_N1

Valid values are:

feelpp_hfm_thermoelectric_model_3D_V1T1_N1

feelpp_hfm_coupledmodel_3DP1N1

feelpp_hfm_coupledcartmodel_3DP1N1

cfgfile

quarter-turn3D.cfg

cfg file need to be in the dataset

Dataset resource: model

dataset mode from the data Catalog

Output dataset: outputs_at

optional

1.4. Examples and Benchmarks

Testcase excefile DataSet cfgfile HPC settings Notes

(partition, …​)

quarter-turn

feelpp_hfm_thermoelectric_model_3D_V1T1_N1

thermoelec-test

lncmi: stokes

cesga: thin-shared

HL

feelpp_hfm_thermoelectric_model_3D_V1T1_N1

hl-test

HL-31_H1_boomeramg_p32.cfg

lncmi: stokes, n=32

cesga: thinnodes, n=32

Insert H1H4Insert H1H4

feelpp_hfm_coupledcartmodel_3DP1N1

insert-test

H1H4_cart.cfg

lncmi: stokes, n=32

cesga: thinnodes, n=144

HL-31

feelpp_hfm_coupledcartmodel_3DP1N1

hl-31

HL-31_cart_boomeramg.cfg

lncmi: N/A

not enougth RAM

cesga: thinnodes, n=256

not working??

fullinsert

feelpp_hfm_coupledcartmodel_3DP1N1

insertfull

HL-31-Leads-air_nl_cart_256_json.cfg

lncmi: N/A

not enougth RAM

cesga: thinnodes, n=256

not working??