From 3ff03eda95822b49eafb664433d9ca693a67dd46 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Oct 2017 09:58:01 +0200 Subject: [PATCH 1/2] fixed: make sure to resize projections caused segfault if projections were enabled in non-adaptive simulations --- SIMPoisson.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SIMPoisson.h b/SIMPoisson.h index 37c554c..7b25a09 100644 --- a/SIMPoisson.h +++ b/SIMPoisson.h @@ -130,6 +130,8 @@ template class SIMPoisson : public SIMMultiPatchModelGen // Project the FE stresses onto the splines basis this->setMode(SIM::RECOVERY); size_t i = 0; + if (projections == &myProj) + myProj.resize(this->opt.project.size()); for (auto pit = this->opt.project.begin(); pit != this->opt.project.end(); ++i, ++pit) { Matrix ssol; From da58565e0f47ada835e650aa325bdca7c40b3304 Mon Sep 17 00:00:00 2001 From: Kjetil Andre Johannessen Date: Tue, 17 Oct 2017 11:11:43 +0200 Subject: [PATCH 2/2] Added: 3D LR adaptivity benchmark cases --- .../ArctanSphericalWaveFront.xinp | 81 +++++++++++++ Adaptive_benchmark/Fischera.g2 | 112 ++++++++++++++++++ Adaptive_benchmark/FischeraCorner.xinp | 108 +++++++++++++++++ Adaptive_benchmark/FischeraLine.xinp | 105 ++++++++++++++++ Adaptive_benchmark/GenFischera.py | 16 +++ Adaptive_benchmark/Peak3D.xinp | 76 ++++++++++++ 6 files changed, 498 insertions(+) create mode 100644 Adaptive_benchmark/ArctanSphericalWaveFront.xinp create mode 100644 Adaptive_benchmark/Fischera.g2 create mode 100644 Adaptive_benchmark/FischeraCorner.xinp create mode 100644 Adaptive_benchmark/FischeraLine.xinp create mode 100644 Adaptive_benchmark/GenFischera.py create mode 100644 Adaptive_benchmark/Peak3D.xinp diff --git a/Adaptive_benchmark/ArctanSphericalWaveFront.xinp b/Adaptive_benchmark/ArctanSphericalWaveFront.xinp new file mode 100644 index 0000000..0371b00 --- /dev/null +++ b/Adaptive_benchmark/ArctanSphericalWaveFront.xinp @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + BINARY + + + + + x0=-.05; y0=-.05; z0=-.05; r=sqrt(pow(x-x0,2)+pow(y-y0,2)+pow(z-z0,2)); alpha=20; r0=0.7; + +(alpha*(2*x - 2*x0)^2)/(4*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(3/2)) - (3*alpha)/((alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2)) + (alpha*(2*y - 2*y0)^2)/(4*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(3/2)) + (alpha*(2*z - 2*z0)^2)/(4*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(3/2)) - (alpha^3*(2*z - 2*z0)^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2)))/(2*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)^2*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)) - (alpha^3*(2*x - 2*x0)^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2)))/(2*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)^2*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)) - (alpha^3*(2*y - 2*y0)^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2)))/(2*(alpha^2*(r0 - ((x - x0)^2 + (y - y0)^2 + (z - z0)^2)^(1/2))^2 + 1)^2*((x - x0)^2 + (y - y0)^2 + (z - z0)^2)) + + + + x0=-.05; y0=-.05; z0=-.05; r=sqrt(pow(x-x0,2)+pow(y-y0,2)+pow(z-z0,2)); alpha=20; r0=0.7 + + atan(alpha*(r-r0)) + -(alpha*(2*x - 2*x0))*pow(2*(alpha*alpha*pow(r - r0,2)+ 1)*r*r, -0.5) | + -(alpha*(2*y - 2*y0))*pow(2*(alpha*alpha*pow(r - r0,2)+ 1)*r*r, -0.5) | + -(alpha*(2*z - 2*z0))*pow(2*(alpha*alpha*pow(r - r0,2)+ 1)*r*r, -0.5) + + + + + + + + 3 + 100 + 10000 + 0.000001 + 1 + isotropic_function + + + diff --git a/Adaptive_benchmark/Fischera.g2 b/Adaptive_benchmark/Fischera.g2 new file mode 100644 index 0000000..b6d6013 --- /dev/null +++ b/Adaptive_benchmark/Fischera.g2 @@ -0,0 +1,112 @@ +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +-1.000000 -1.000000 -1.000000 +0.000000 -1.000000 -1.000000 +-1.000000 0.000000 -1.000000 +0.000000 0.000000 -1.000000 +-1.000000 -1.000000 0.000000 +0.000000 -1.000000 0.000000 +-1.000000 0.000000 0.000000 +0.000000 0.000000 0.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +-1.000000 -1.000000 0.000000 +0.000000 -1.000000 0.000000 +-1.000000 0.000000 0.000000 +0.000000 0.000000 0.000000 +-1.000000 -1.000000 1.000000 +0.000000 -1.000000 1.000000 +-1.000000 0.000000 1.000000 +0.000000 0.000000 1.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +-1.000000 0.000000 -1.000000 +0.000000 0.000000 -1.000000 +-1.000000 1.000000 -1.000000 +0.000000 1.000000 -1.000000 +-1.000000 0.000000 0.000000 +0.000000 0.000000 0.000000 +-1.000000 1.000000 0.000000 +0.000000 1.000000 0.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +-1.000000 0.000000 0.000000 +0.000000 0.000000 0.000000 +-1.000000 1.000000 0.000000 +0.000000 1.000000 0.000000 +-1.000000 0.000000 1.000000 +0.000000 0.000000 1.000000 +-1.000000 1.000000 1.000000 +0.000000 1.000000 1.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +0.000000 -1.000000 -1.000000 +1.000000 -1.000000 -1.000000 +0.000000 0.000000 -1.000000 +1.000000 0.000000 -1.000000 +0.000000 -1.000000 0.000000 +1.000000 -1.000000 0.000000 +0.000000 0.000000 0.000000 +1.000000 0.000000 0.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +0.000000 -1.000000 0.000000 +1.000000 -1.000000 0.000000 +0.000000 0.000000 0.000000 +1.000000 0.000000 0.000000 +0.000000 -1.000000 1.000000 +1.000000 -1.000000 1.000000 +0.000000 0.000000 1.000000 +1.000000 0.000000 1.000000 +700 1 0 0 +3 0 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +2 2 +0.000000 0.000000 1.000000 1.000000 +0.000000 0.000000 -1.000000 +1.000000 0.000000 -1.000000 +0.000000 1.000000 -1.000000 +1.000000 1.000000 -1.000000 +0.000000 0.000000 0.000000 +1.000000 0.000000 0.000000 +0.000000 1.000000 0.000000 +1.000000 1.000000 0.000000 diff --git a/Adaptive_benchmark/FischeraCorner.xinp b/Adaptive_benchmark/FischeraCorner.xinp new file mode 100644 index 0000000..5e7f90d --- /dev/null +++ b/Adaptive_benchmark/FischeraCorner.xinp @@ -0,0 +1,108 @@ + + + + + + + + + Fischera.g2 + + + + + + + + + + + + + + + + + + + 6 + 5 + 4 + 2 + 6 + 4 + 3 + 2 + 5 + 4 + 3 + 2 + 6 + 4 + 2 + 1 + 5 + 4 + 1 + 6 + 3 + 1 + 5 + 3 + 2 + 1 + + + + + + + + + + + + BINARY + + + + + r2=(x*x+y*y+z*z); q=0.5; -q*(q+1)*pow(r2,q/2-1) + + r =sqrt(x*x + y*y + z*z); q=0.5; pow(r,q) + r2= (x*x + y*y + z*z); q=0.5; -q*x*pow(r2,q/2 - 1) | + r2= (x*x + y*y + z*z); q=0.5; -q*y*pow(r2,q/2 - 1) | + r2= (x*x + y*y + z*z); q=0.5; -q*z*pow(r2,q/2 - 1) + + + + + + + + + 4 + 100 + 100000 + 0.000001 + 1 + isotropic_function + + + diff --git a/Adaptive_benchmark/FischeraLine.xinp b/Adaptive_benchmark/FischeraLine.xinp new file mode 100644 index 0000000..7426244 --- /dev/null +++ b/Adaptive_benchmark/FischeraLine.xinp @@ -0,0 +1,105 @@ + + + + + + + + + Fischera.g2 + + + + + + + + + + + + + + + + + 6 + 5 + 4 + 2 + 6 + 4 + 3 + 2 + 5 + 4 + 3 + 2 + 6 + 4 + 2 + 1 + 5 + 4 + 1 + 6 + 3 + 1 + 5 + 3 + 2 + 1 + + + + + + + + + + + + BINARY + + + + + + r=sqrt(x*x+y*y+z*z); 1/r + + + + + + 4 + 100 + 10000 + 0.000001 + 1 + isotropic_function + + + + diff --git a/Adaptive_benchmark/GenFischera.py b/Adaptive_benchmark/GenFischera.py new file mode 100644 index 0000000..f61d951 --- /dev/null +++ b/Adaptive_benchmark/GenFischera.py @@ -0,0 +1,16 @@ +from splipy import * +from splipy.IO import * +import splipy.curve_factory as cf +import splipy.surface_factory as sf +import splipy.volume_factory as vf +import numpy as np + +v = Volume() - [1,1,1]; + +with G2("Fischera.g2") as f: + for i in range(2): + for j in range(2): + for k in range(2): + if i==j==k==1: # skip first octant + continue + f.write(v + [i,j,k]) diff --git a/Adaptive_benchmark/Peak3D.xinp b/Adaptive_benchmark/Peak3D.xinp new file mode 100644 index 0000000..5a67649 --- /dev/null +++ b/Adaptive_benchmark/Peak3D.xinp @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + BINARY + + + + + x0=0.5; y0=0.5; z0=0.5; r2=pow(x-x0,2)+pow(y-y0,2)+pow(z-z0,2); alpha=1e3; +6*alpha*exp(-alpha*r2) - alpha^2*exp(-alpha*r2)*(2*x - 2*x0)^2 - alpha^2*exp(-alpha*r2)*(2*y - 2*y0)^2 - alpha^2*exp(-alpha*r2)*(2*z - 2*z0)^2 + + + x0=0.5; y0=0.5; z0=0.5; r2=pow(x-x0,2)+pow(y-y0,2)+pow(z-z0,2); alpha=1e3; + + exp(-alpha*r2) + alpha*exp(-alpha*r2)*(2*x - 2*x0) | + alpha*exp(-alpha*r2)*(2*y - 2*y0) | + alpha*exp(-alpha*r2)*(2*z - 2*z0) + + + + + + + + 3 + 100 + 10000 + 0.000001 + 1 + isotropic_function + + +