Commit 3cca5c14 authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

tidy up of input files pt2


Former-commit-id: c87d7caa
parent d18a2347
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Data Generator for %
% Neural Entropy Closure %
% Author <Steffen Schotthöfer> %
% Date 17.12.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ---- Global settings ----
DATA_GENERATOR_MODE = YES
TRAINING_SET_SIZE = 500
MAX_VALUE_FIRST_MOMENT = 20
REALIZABLE_SET_EPSILON_U0 = 0.05
REALIZABLE_SET_EPSILON_U1 = 0.97
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = trainM0
% Log directory
LOG_DIR = ../result/logs
%
% --- Spherical Basis ----
%
% Choice of basis functions
SPHERICAL_BASIS = SPHERICAL_MONOMIALS
%
% Maximal Moment degree
MAX_MOMENT_SOLVER = 1
%
% --- Entropy settings ----
ENTROPY_FUNCTIONAL = MAXWELL_BOLTZMANN
ENTROPY_OPTIMIZER = NEWTON
%
% ----- Newton Solver Specifications ----
%
NEWTON_FAST_MODE = NO
NEWTON_ITER = 1000000
NEWTON_EPSILON = 0.01
NEWTON_STEP_SIZE = 0.7
NEWTON_LINE_SEARCH_ITER = 1000
%
% ----- Quadrature ----
%
% Quadrature Rule
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
% Quadrature Order
QUAD_ORDER = 8
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checkerboard Benchmarking File MN %
% Author <Steffen Schotthöfer> %
% Date 10.11.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ---- File specifications ----
%
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = MN_checkerboard_Monomials
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = meshes/checkerboard.su2
%MESH_FILE = meshes/checkerboard_debug.su2
%
% ---- Problem specifications ----
%
PROBLEM = CHECKERBOARD
%
% ---- Solver specifications ----
%
SPHERICAL_BASIS = SPHERICAL_MONOMIALS
%
CFL_NUMBER = 0.7
TIME_FINAL = 3
SOLVER = MN_SOLVER
RECONS_ORDER = 1
MAX_MOMENT_SOLVER = 1
%
% ---- Entropy settings ----
%
ENTROPY_FUNCTIONAL = MAXWELL_BOLTZMANN
ENTROPY_OPTIMIZER = ML
NEURAL_MODEL = 7
%
% ----- Newton Solver Specifications ----
%
NEWTON_FAST_MODE = NO
NEWTON_ITER = 100000
NEWTON_EPSILON = 0.0001
NEWTON_STEP_SIZE = 0.7
NEWTON_LINE_SEARCH_ITER = 10000
%
% ---- Boundary Conditions ----
%
BC_DIRICHLET = ( void )
%
% ---- Quadrature ----
%
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
QUAD_ORDER = 12
%
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL, MOMENTS, DUAL_MOMENTS)
VOLUME_OUTPUT_FREQUENCY = 1
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 1
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
HISTORY_OUTPUT_FREQUENCY = 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checkerboard Benchmarking File PN %
% Author <Steffen Schotthöfer> %
% Date 15.02.2021 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = PN_checkerboard
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = checkerboard.su2
%
PROBLEM = CHECKERBOARD
%
%
% ---- Solver specifications ----
%
% Solver type
SOLVER = PN_SOLVER
% CFL number
CFL_NUMBER = 0.5
% Final time for simulation
TIME_FINAL = 2
% Maximal Moment degree
MAX_MOMENT_SOLVER = 2
% Reconstruction order
RECONS_ORDER = 1
% ---- Boundary Conditions ----
% Example: BC_DIRICLET = (dummyMarker1, dummyMarker2)
% Dirichlet Boundary
BC_DIRICHLET = ( void )
%
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL)
VOLUME_OUTPUT_FREQUENCY = 1
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 1
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
HISTORY_OUTPUT_FREQUENCY = 1
% ---- File specifications ----
OUTPUT_DIR = ../result
OUTPUT_FILE = checkerboard
LOG_DIR = ../result/logs
MESH_FILE = checkerboard.su2
% ---- Solver specifications ----
CFL_NUMBER = 0.5
TIME_FINAL = 3.2
PROBLEM = CHECKERBOARD
% ---- Boundary Conditions ----
BC_NEUMANN = ( void )
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
QUAD_ORDER = 10
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL)
VOLUME_OUTPUT_FREQUENCY = 1
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 1
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
HISTORY_OUTPUT_FREQUENCY = 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Linesource Benchmarking File MN %
% Author <Steffen Schotthöfer> %
% Date 01.07.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = exampleMN_mono
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = meshes/linesource.su2
%MESH_FILE = linesource_debug.su2
%
% ---- Problem description ---
%
PROBLEM = LINESOURCE
SCATTER_COEFF = 1
%
% ---- Solver specifications ----
%
% Choice of basis functions
SPHERICAL_BASIS = SPHERICAL_MONOMIALS
% Maximal Moment degree
MAX_MOMENT_SOLVER = 1
% Solver type
SOLVER = MN_SOLVER
% CFL number
CFL_NUMBER = 0.7
% Final time for simulation
TIME_FINAL = 0.5
% Reconstruction order (spatial flux)
RECONS_ORDER = 1
%
% ---- Entropy settings ----
%
ENTROPY_FUNCTIONAL = MAXWELL_BOLTZMANN
ENTROPY_OPTIMIZER = NEWTON
NEURAL_MODEL = 4
%
% ----- Newton Solver Specifications ----
%
NEWTON_FAST_MODE = NO
NEWTON_ITER = 1000
NEWTON_EPSILON = 0.01
NEWTON_STEP_SIZE = 0.7
NEWTON_LINE_SEARCH_ITER = 1000
%
% ---- Boundary Conditions ----
%
% Example: BC_DIRICLET = (dummyMarker1, dummyMarker2)
% Dirichlet Boundary
BC_DIRICHLET = ( void )
%
% ----- Quadrature ----
%
% Quadrature Rule
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
% Quadrature Order
QUAD_ORDER = 8
%
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL, MOMENTS, DUAL_MOMENTS)
VOLUME_OUTPUT_FREQUENCY = 1
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 1
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
HISTORY_OUTPUT_FREQUENCY = 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Linesource Benchmarking File PN %
% Author <Steffen Schotthöfer> %
% Date 01.07.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = examplePN
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = meshes/linesource.su2
%MESH_FILE = meshes/linesource_debug.su2
%
PROBLEM = LINESOURCE
SCATTER_COEFF = 1
%
%
% ---- Solver specifications ----
%
% Solver type
SOLVER = PN_SOLVER
% CFL number
CFL_NUMBER = 0.7
% Final time for simulation
TIME_FINAL = 0.3
% Maximal Moment degree
MAX_MOMENT_SOLVER = 2
% Reconstruction order
RECONS_ORDER = 2
% ---- Boundary Conditions ----
% Example: BC_DIRICLET = (dummyMarker1, dummyMarker2)
% Dirichlet Boundary
BC_DIRICHLET = ( void )
%
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Linesource Benchmarking File SN %
% Author <Steffen Schotthöfer> %
% Date 01.10.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = example_SN
% Log directory
LOG_DIR = ../result/logs
% Mesh File
MESH_FILE = meshes/linesource.su2
%
PROBLEM = LINESOURCE
%
% ---- Solver specifications ----
%
% Solver type
SOLVER = SN_SOLVER
% CFL number
CFL_NUMBER = 0.7
% Final time for simulation
TIME_FINAL = 0.5
% Reconstruction order
RECONS_ORDER = 2
%
% ---- Boundary Conditions ----
% Example: BC_DIRICLET = (dummyMarker1, dummyMarker2)
% Dirichlet Boundary
BC_DIRICHLET = ( void )
%
%% Quadrature Specifications
% Quadrature Type
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
% Quadrature Order
QUAD_ORDER = 8
%
% ----- Output ----
%
VOLUME_OUTPUT = (ANALYTIC, MINIMAL)
VOLUME_OUTPUT_FREQUENCY = 1
This diff is collapsed.
import pygmsh as pg
import numpy as np
import itertools
import os
def add_block(x0,y0,length,char_length,geom):
coords = np.array([
[x0, y0, 0.0],
[x0+length, y0, 0.0],
[x0+length, y0+length, 0.0],
[x0, y0+length, 0.0]
])
return geom.add_polygon(coords, char_length)
char_length = 0.075
geom = pg.opencascade.Geometry()
domain = add_block(0, 0, 7, char_length, geom)
xpos = ypos = [1, 2, 3, 4, 5]
pattern = list(itertools.product(xpos, ypos))[::2]
pattern.pop(7)
boxes = [domain]
for pos in pattern:
boxes.append(add_block(pos[0], pos[1], 1, char_length, geom))
geom.boolean_fragments(boxes,[])
geom.add_physical(domain.lines, label="void")
mesh_code = geom.get_code()
with open("checkerboard.geo","w") as mesh_file:
mesh_file.write(mesh_code)
os.system('gmsh checkerboard.geo -2 -format su2 -save_all')
os.system('rm checkerboard.geo')
This diff is collapsed.
This diff is collapsed.
import pygmsh as pg
import numpy as np
import itertools
import os
def add_block(x0,y0,lengthX, lengthY,char_length,geom):
coords = np.array([
[x0, y0, 0.0],
[x0+lengthX, y0, 0.0],
[x0+lengthX, y0+lengthY, 0.0],
[x0, y0+lengthY, 0.0]
])
return geom.add_polygon(coords, char_length)
char_length = 0.015
geom = pg.opencascade.Geometry()
domain = add_block(-1, -1, 2,2, char_length, geom)
geom.add_raw_code('psource = newp;\nPoint(psource) = {0.0, 0.0, 0.0, '+str(char_length)+'};\nPoint{psource} In Surface{'+domain.id+'};')
geom.add_physical(domain.lines, label="void")
mesh_code = geom.get_code()
with open("linesource.geo","w") as mesh_file:
mesh_file.write(mesh_code)
os.system('gmsh linesource.geo -2 -format su2 -save_all')
os.system('rm linesource.geo')
This diff is collapsed.
NDIME= 2
NELEM= 116
5 31 61 50 0
5 32 62 46 1
5 30 63 42 2
5 29 64 38 3
5 38 59 29 4
5 42 60 30 5
5 50 57 31 6
5 46 58 32 7
5 50 61 52 8
5 38 64 40 9
5 42 63 44 10
5 46 62 48 11
5 40 67 66 12
5 44 68 67 13
5 4 68 48 14
5 48 65 4 15
5 66 67 4 16
5 52 66 65 17
5 67 68 4 18
5 65 66 4 19
5 45 58 46 20
5 49 57 50 21
5 37 59 38 22
5 41 60 42 23
5 10 37 9 24
5 16 41 15 25
5 22 45 21 26
5 28 49 27 27
5 9 33 8 28
5 15 34 14 29
5 21 35 20 30
5 27 36 26 31
5 8 53 7 32
5 26 54 25 33
5 14 55 13 34
5 20 56 19 35
5 9 37 33 36
5 15 41 34 37
5 21 45 35 38
5 27 49 36 39
5 7 31 6 40
5 13 29 12 41
5 19 30 18 42
5 25 32 24 43
5 50 51 36 44
5 46 47 35 45
5 42 43 34 46
5 37 38 33 47
5 41 42 34 48
5 45 46 35 49
5 49 50 36 50
5 34 55 14 51
5 35 56 20 52
5 33 53 8 53
5 36 54 26 54
5 38 39 33 55
5 50 52 51 56
5 7 53 31 57
5 13 55 29 58
5 19 56 30 59
5 25 54 32 60
5 46 48 47 61
5 42 44 43 62
5 51 54 36 63
5 47 56 35 64
5 43 55 34 65
5 38 40 39 66
5 39 53 33 67
5 12 59 11 68
5 18 60 17 69
5 6 57 5 70
5 24 58 23 71
5 51 65 62 72
5 43 67 64 73
5 47 68 63 74
5 39 66 61 75
5 62 65 48 76
5 29 59 12 77
5 30 60 18 78
5 31 57 6 79
5 32 58 24 80
5 51 62 54 81
5 47 63 56 82
5 43 64 55 83
5 39 61 53 84
5 64 67 40 85
5 61 66 52 86
5 63 68 44 87
5 0 69 28 88
5 1 70 10 89
5 2 71 16 90
5 3 72 22 91
5 5 69 0 92
5 11 70 1 93
5 17 71 2 94
5 23 72 3 95
5 53 61 31 96
5 54 62 32 97
5 56 63 30 98
5 55 64 29 99
5 48 68 47 100
5 44 67 43 101
5 40 66 39 102
5 52 65 51 103
5 59 70 11 104
5 60 71 17 105
5 57 69 5 106
5 58 72 23 107
5 10 70 37 108
5 16 71 41 109
5 22 72 45 110
5 28 69 49 111
5 37 70 59 112
5 41 71 60 113
5 45 72 58 114
5 49 69 57 115
NPOIN= 73
-1 -1 0
1 -1 1
1 1 2
-1 1 3
0 0 4
-0.7142857142857149 -1 5
-0.4285714285714292 -1 6
-0.1428571428571446 -1 7
0.1428571428571399 -1 8
0.4285714285714264 -1 9
0.7142857142857131 -1 10
1 -0.7142857142857149 11
1 -0.4285714285714292 12
1 -0.1428571428571446 13
1 0.1428571428571399 14
1 0.4285714285714264 15
1 0.7142857142857131 16
0.7142857142857149 1 17
0.4285714285714292 1 18
0.1428571428571446 1 19
-0.1428571428571399 1 20
-0.4285714285714264 1 21
-0.7142857142857131 1 22
-1 0.7142857142857149 23
-1 0.4285714285714292 24
-1 0.1428571428571446 25
-1 -0.1428571428571399 26
-1 -0.4285714285714264 27
-1 -0.7142857142857131 28
0.7448963933076813 -0.2958993288567857 29
0.2958993288567857 0.7448741604051923 30
-0.2958993288567857 -0.7448741030378044 31
-0.7448741031845852 0.2958993288567857 32
0.2857142857142831 -0.7525641703473035 33
0.7525641703473035 0.2857142857142831 34
-0.2857142857142831 0.7525641703473035 35
-0.7525641703473035 -0.2857142857142831 36
0.5702178944911764 -0.7579779235984792 37
0.4734255300332104 -0.466065525795427 38
0.1404402198315508 -0.503736838265278 39
0.2845189426284829 -0.2574665780487297 40
0.7579779235984792 0.5702178944911764 41
0.4661470678677279 0.473403309657437 42
0.503736838265278 0.1404402198315508 43
0.2579102852452364 0.2845415844608673 44
-0.5702178944911764 0.7579779235984792 45
-0.4734032524689858 0.4661472771842615 46
-0.1404402198315507 0.503736838265278 47
-0.2721302034312204 0.2459355156253109 48
-0.7579779235984792 -0.5702178944911764 49
-0.466147277721191 -0.4734032523222875 50
-0.503736838265278 -0.1404402198315507 51
-0.2525778560309617 -0.2844672438731013 52
-2.331468351712839e-15 -0.7525641703473043 53
-0.7525641703473043 2.331468351712839e-15 54
0.7525641703473044 -2.331468351712839e-15 55
2.331468351712839e-15 0.7525641703473044 56
-0.5704198501505016 -0.7624888023897629 57
-0.762488802424701 0.5704198500865815 58
0.7624941081017629 -0.5704101177783869 59
0.5704198251679464 0.7624888160448267 60
-0.1430030068473814 -0.5190540352845223 61
-0.5182521875839406 0.1424112012706147 62
0.1433268064468278 0.5190587563301933 63
0.519137076837385 -0.1432669710727967 64
-0.2664994196576008 -0.01774102697257066 65
0.01463988089926307 -0.2673640092670581 66
0.2672354663532547 0.01510094398402906 67
0.0002723628997396092 0.2658101411298237 68
-0.7908426264088914 -0.7908426264088909 69
0.7908426264088909 -0.7908426264088914 70
0.7908426264088914 0.7908426264088909 71
-0.7908426264088909 0.7908426264088914 72
NMARK= 1
MARKER_TAG= void
MARKER_ELEMS= 28
3 0 5
3 5 6
3 6 7
3 7 8
3 8 9
3 9 10
3 10 1
3 1 11
3 11 12
3 12 13
3 13 14
3 14 15
3 15 16
3 16 2
3 2 17
3 17 18
3 18 19
3 19 20