Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
023dc8f
Add inverse estimate coefficient
IdoAkkerman Nov 20, 2025
806f251
Implement inverse estimate coefficient in tau
codeermeneer Nov 27, 2025
19cfeac
Untested routines for mfem
IdoAkkerman Nov 28, 2025
5bfe1e1
Merge branch 'minor2025' of github.com:IdoAkkerman/rbvms into minor2025
IdoAkkerman Nov 28, 2025
dbcd07c
Add mesh with slit
IdoAkkerman Nov 28, 2025
ded1006
Fix convection velocity
IdoAkkerman Nov 28, 2025
96469c7
Only one ev
IdoAkkerman Nov 28, 2025
ad24f6b
Remove print statement
IdoAkkerman Nov 28, 2025
d4c2f6b
Add hessian patch
IdoAkkerman Dec 2, 2025
56306e1
Add transformation to perfect geometry before Gij calculation
Mc-Seem Nov 20, 2025
6c56931
Add a unit test for tau variance (computes variance of the tau on per…
Mc-Seem Dec 2, 2025
e8715fe
Add tau integrator and solver
IdoAkkerman Dec 4, 2025
c935aa0
Solves problem 2
IdoAkkerman Dec 4, 2025
f5c77ba
Add quart circle case
IdoAkkerman Dec 5, 2025
f006549
Add transformation to perfect geometry before Gij calculation
Mc-Seem Nov 20, 2025
adec82b
Add a unit test for tau variance (computes variance of the tau on per…
Mc-Seem Dec 2, 2025
25d1ba3
Update tau variance test to reflect changes in integrator
Mc-Seem Dec 7, 2025
f4e44e3
Add tets to tau_variance and refactor
Mc-Seem Dec 8, 2025
3d42212
Merge remote-tracking branch 'origin/metric-tensor-perf-geom' into me…
Mc-Seem Dec 8, 2025
a97640e
Alternative tau variance routine
IdoAkkerman Dec 10, 2025
95e51b0
Expand tau_variance_alt to pyramids and prisms
Mc-Seem Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cases/condif2/condif.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//--------------------------------------------------------------
// Solution function for convection-diffusion
//
// To compile run, for example:
// mpicc -shared -o libfun.so -fPIC condif.c
// gcc -shared -o libfun.so -fPIC condif.c
//--------------------------------------------------------------

#include <math.h>
#include <stdio.h>


double sol_phi(double *coord, int dim, double time)
{
return 0.0;
}

void advection(double *coord, int dim, double time, double *adv, int vdim)
{
double r = sqrt(coord[0]*coord[0] + coord[1]*coord[1]);

adv[0] = -coord[0]/r;//-sqrt(2.0)/2.0;
adv[1] = -coord[1]/r;//-sqrt(2.0)/2.0;
}

double force(double *coord, int dim, double time)
{
return 1.0;
}

double mu(double *coord, int dim, double time)
{
return 0.00001;
}

56 changes: 56 additions & 0 deletions cases/condif2/condif_ms.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//--------------------------------------------------------------
// Solution function for convection-diffusion -- manufactured solution
//
// To compile run, for example:
// mpicc -shared -o libfun.so -fPIC condif_ms.c
// gcc -shared -o libfun.so -fPIC condif_ms.c
//--------------------------------------------------------------

# TO BE MODIFIED ???
bla

#include <math.h>
#include <stdio.h>

void advection(double *x, int dim, double t, double *adv, int vdim)
{
adv[0] = sqrt(2.0)/2.0;
adv[1] = sqrt(2.0)/2.0;
}

double mu(double *x, int dim, double t)
{
return 0.01;
}

double sol_phi(double *x, int dim, double t)
{
return sin(M_PI*x[0])*sin(M_PI*x[1]);
}

void grad_phi(double *x, int dim, double t, double *grad, int vdim)
{
grad[0] = M_PI*cos(M_PI*x[0])*sin(M_PI*x[1]);
grad[1] = M_PI*sin(M_PI*x[0])*cos(M_PI*x[1]);
}

double lap_phi(double *x, int dim, double t)
{
return -2*M_PI*M_PI*sin(M_PI*x[0])*sin(M_PI*x[1]);
}

double force(double *x, int dim, double t)
{
double a[dim];
double grad[dim];
advection(x, dim, t, a, dim);
grad_phi(x, dim, t, grad, dim);

double res = - mu(x, dim, t)*lap_phi(x, dim, t);
for (int i = 0; i < dim; i++)
{
res += a[i]*grad[i];
}

return res;
}
64 changes: 64 additions & 0 deletions cases/condif2/quart-circle-eps.mesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
MFEM NURBS mesh v1.0

#
# MFEM Geometry Types (see fem/geom.hpp):
#
# SEGMENT = 1
# SQUARE = 3
# CUBE = 5
#

dimension
2

elements
1
1 3 0 1 2 3

boundary
4
1 1 0 1
3 1 2 3
4 1 3 0
2 1 1 2

edges
4
0 0 1
0 3 2
1 0 3
1 1 2

vertices
4

knotvectors
2
2 3 0 0 0 1 1 1
2 3 0 0 0 1 1 1

weights
1
1
1
1
0.707106781
0.707106781
1
1
0.707106781

FiniteElementSpace
FiniteElementCollection: NURBS2
VDim: 2
Ordering: 1

0 0.001
0.001 0
1 0
0 1
0.001 0.001
1 1
0 0.001
0.001 0
0.001 0.001
64 changes: 64 additions & 0 deletions cases/condif2/quart-circle.mesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
MFEM NURBS mesh v1.0

#
# MFEM Geometry Types (see fem/geom.hpp):
#
# SEGMENT = 1
# SQUARE = 3
# CUBE = 5
#

dimension
2

elements
1
1 3 0 1 2 3

boundary
4
1 1 0 1
3 1 2 3
4 1 3 0
2 1 1 2

edges
4
0 0 1
0 3 2
1 0 3
1 1 2

vertices
4

knotvectors
2
2 3 0 0 0 1 1 1
2 3 0 0 0 1 1 1

weights
1
1
1
1
0.707106781
0.707106781
1
1
0.707106781

FiniteElementSpace
FiniteElementCollection: NURBS2
VDim: 2
Ordering: 1

0 0.00
0.00 0
1 0
0 1
0.00 0.00
1 1
0 0.5
0.5 0
0.5 0.5
9 changes: 9 additions & 0 deletions cases/condif2/run-nurbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
gcc -shared -o libfun.so -fPIC condif.c

exe=../../build/supg/supg
mesh=quart-circle.mesh

rm output* log*

mpirun -n 1 $exe -m $mesh -o 2 -r 3 --strong-bdr "1 2 3 4" -l libfun.so | tee log0
35 changes: 35 additions & 0 deletions cases/condif3/condif.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//--------------------------------------------------------------
// Solution function for convection-diffusion
//
// To compile run, for example:
// mpicc -shared -o libfun.so -fPIC condif.c
// gcc -shared -o libfun.so -fPIC condif.c
//--------------------------------------------------------------

#include <math.h>
#include <stdio.h>


double sol_phi(double *coord, int dim, double time)
{
double r = sqrt(coord[0]*coord[0] + coord[1]*coord[1]);

return 0.5*(1.0 - cos(2*M_PI*fmin(1.0, r)));
}

void advection(double *coord, int dim, double time, double *adv, int vdim)
{
adv[0] = coord[1];
adv[1] = -coord[0];
}

double force(double *coord, int dim, double time)
{
return 0.0;
}

double mu(double *coord, int dim, double time)
{
return 0.0;
}

55 changes: 55 additions & 0 deletions cases/condif3/condif_ms.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//--------------------------------------------------------------
// Solution function for convection-diffusion -- manufactured solution
//
// To compile run, for example:
// mpicc -shared -o libfun.so -fPIC condif_ms.c
// gcc -shared -o libfun.so -fPIC condif_ms.c
//--------------------------------------------------------------

## ??

#include <math.h>
#include <stdio.h>

void advection(double *x, int dim, double t, double *adv, int vdim)
{
adv[0] = sqrt(2.0)/2.0;
adv[1] = sqrt(2.0)/2.0;
}

double mu(double *x, int dim, double t)
{
return 0.01;
}

double sol_phi(double *x, int dim, double t)
{
return sin(M_PI*x[0])*sin(M_PI*x[1]);
}

void grad_phi(double *x, int dim, double t, double *grad, int vdim)
{
grad[0] = M_PI*cos(M_PI*x[0])*sin(M_PI*x[1]);
grad[1] = M_PI*sin(M_PI*x[0])*cos(M_PI*x[1]);
}

double lap_phi(double *x, int dim, double t)
{
return -2*M_PI*M_PI*sin(M_PI*x[0])*sin(M_PI*x[1]);
}

double force(double *x, int dim, double t)
{
double a[dim];
double grad[dim];
advection(x, dim, t, a, dim);
grad_phi(x, dim, t, grad, dim);

double res = - mu(x, dim, t)*lap_phi(x, dim, t);
for (int i = 0; i < dim; i++)
{
res += a[i]*grad[i];
}

return res;
}
10 changes: 10 additions & 0 deletions cases/condif3/run-nurbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
gcc -shared -o libfun.so -fPIC condif.c

exe=../../build/supg/supg
mesh=square.mesh
mesh=square-slit.mesh

rm output* log*

mpirun -n 1 $exe -m $mesh -o 2 -r 3 --strong-bdr "1 2" -l libfun.so | tee log0
Loading