Skip to content

Commit

Permalink
tests combo1 and combo2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Jun 24, 2021
1 parent eabaea1 commit 8dc7222
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
51 changes: 51 additions & 0 deletions acceptance/facebody/sin50xy/accept-combo.sh
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

set -x # echo commands
set -e # exit on first error
set -u # Treat unset variables as error

if [ $# -gt 0 ] ; then
src=$1/src
else
src=${HOME}/refine/egads/src
fi

tecplot=-t
field1="-u combo1"
field2="-u combo2"
egads="-g square.egads"

function adapt_cycle {
inproj=$1
outproj=$2
complexity=$3

${src}/ref_acceptance ${field1} ${inproj}.meshb \
${inproj}-1.solb
${src}/ref_acceptance ${field2} ${inproj}.meshb \
${inproj}-2.solb

${src}/ref_metric_test ${inproj}.meshb ${inproj}-1.solb ${inproj}-2.solb \
2 -1 ${complexity} ${inproj}-metric.solb

${src}/ref adapt ${inproj}.meshb ${egads} -m ${inproj}-metric.solb \
-x ${outproj}.meshb -f ${outproj}.tec

${src}/ref_acceptance ${field1} ${outproj}.meshb \
${outproj}-1.solb
${src}/ref_acceptance ${field2} ${outproj}.meshb \
${outproj}-2.solb

${src}/ref visualize ${outproj}.meshb ${outproj}-1.solb ${outproj}-1.plt
${src}/ref visualize ${outproj}.meshb ${outproj}-2.solb ${outproj}-2.plt
}

cp square.meshb cycle00.meshb

adapt_cycle cycle00 cycle01 1000
adapt_cycle cycle01 cycle02 1000
adapt_cycle cycle02 cycle03 2000
adapt_cycle cycle03 cycle04 4000
#adapt_cycle cycle04 cycle05 8000


9 changes: 9 additions & 0 deletions src/ref_acceptance.c
Expand Up @@ -195,6 +195,15 @@ static REF_STATUS ref_acceptance_u(REF_NODE ref_node, const char *function_name,
z = ref_node_xyz(ref_node, 2, node);
if (strcmp(function_name, "u5") == 0) {
scalar[node] = 2.0 * pow(x, 2) + 2.0 * pow(y, 2) + 2.0 * pow(z, 2);
} else if (strcmp(function_name, "combo1") == 0) {
REF_DBL xy, x3;
xy = (2.0 * x - 1.0) * (2.0 * y - 1.0);
x3 = pow((2.0 * x - 1.0), 3);
scalar[node] = tanh(15.0 * xy - x3);
} else if (strcmp(function_name, "combo2") == 0) {
REF_DBL xy;
xy = x * y;
scalar[node] = tanh(50.0 * (xy - 0.5));
} else if (strcmp(function_name, "sin50xy") == 0) {
REF_DBL xy;
xy = (2.0 * x - 1.0) * (2.0 * y - 1.0);
Expand Down

0 comments on commit 8dc7222

Please sign in to comment.