1 - adapt1.grd / adapt1.sif
base case. simple rectangle, no discontinuity. heat on top, cold on bottom. coarse mesh. all good.
adapt1.grd:
Code: Select all
***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = Cartesian 2D
Subcell Divisions in 2D = 3 3
Subcell Sizes 1 = 1e-3 1e-3 1e-3
Subcell Sizes 2 = 1e-3 1e-3 1e-3
Material Structure in 2D
2 1 2
2 2 2
3 3 3
End
Materials Interval = 1 3
Boundary Definitions
! type out int double of the boundaries
1 -1 3 1
2 -3 1 1
End
Surface Elements = 10
Triangles = logical true !needed for RGB adaptive meshing
Numbering = Horizontal
Element Degree = 1
Code: Select all
Header
CHECK KEYWORDS Warn
Mesh DB "." "adapt1"
End
Simulation
Max Output Level = 5
Coordinate System = "Cartesian 2D"
Coordinate Mapping(3) = 1 2 3
Simulation Type = "Steady State"
Steady State Max Iterations = 10
Post File = file "adapt.ep"
End
Body 1
Target Bodies(2) = 1 2
Equation = 1
Material = 1
Initial Condition = 1
End
Body 2
Target Bodies(1) = 3
Equation = 1
Material = 1
Initial Condition = 1
End
Equation 1
Heat Equation = True
Active Solvers(1) = 1
End
Solver 1
Exec Solver = "Always"
Equation = "Heat Equation"
Procedure = "HeatSolve" "HeatSolver"
Variable = "Temperature"
Variable Dofs = 1
Optimize Bandwidth = True
Linear System Solver = "Direct"
Linear System Direct Method = "umfpack"
Steady State Convergence Tolerance = 1.0e-5
Stabilize = True
Nonlinear System Convergence Tolerance = 1.0e-4
Nonlinear System Max Iterations = 3
Nonlinear System Newton After Iterations = 2
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 1.0
Adaptive Mesh Refinement = false
Adaptive Remesh = false
Adaptive Save Mesh = true
Adaptive Error Limit = 1e-4
End
Material 1
Density = 1
Heat Conductivity = 1
Heat Capacity = 1
End
Boundary Condition 1
Target Boundaries(1) = 1
Name = COLD
Temperature = 0
End
Boundary Condition 2
Target Boundaries(1) = 2
Name = HOT
Heat Flux BC = True
Heat Flux = 100
End
3 - adapt2.grd / adapt2.sif
(adaptive mesh off) add a discontinuity to the grd file and sif using old method (discontinuous bc 3 in grd file, heat gap defined in sif as bc 3)
runs fine. temperatures look as expected with a jump at bc 3.
adapt2.grd
Code: Select all
***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = Cartesian 2D
Subcell Divisions in 2D = 3 3
Subcell Sizes 1 = 1e-3 1e-3 1e-3
Subcell Sizes 2 = 1e-3 1e-3 1e-3
Material Structure in 2D
2 1 2
2 2 2
3 3 3
End
Materials Interval = 1 3
Boundary Definitions
! type out int double of the boundaries
1 -1 3 1
2 -3 1 1
3 -1 2 2
End
Surface Elements = 10
Triangles = logical true !needed for RGB adaptive meshing
Numbering = Horizontal
Element Degree = 1
Code: Select all
Header
CHECK KEYWORDS Warn
Mesh DB "." "adapt2"
End
Simulation
Max Output Level = 5
Coordinate System = "Cartesian 2D"
Coordinate Mapping(3) = 1 2 3
Simulation Type = "Steady State"
Steady State Max Iterations = 10
Post File = file "adapt.ep"
End
Body 1
Target Bodies(2) = 1 2
Equation = 1
Material = 1
Initial Condition = 1
End
Body 2
Target Bodies(1) = 3
Equation = 1
Material = 1
Initial Condition = 1
End
Equation 1
Heat Equation = True
Active Solvers(1) = 1
End
Solver 1
Exec Solver = "Always"
Equation = "Heat Equation"
Procedure = "HeatSolve" "HeatSolver"
Variable = "Temperature"
Variable Dofs = 1
Optimize Bandwidth = True
Linear System Solver = "Direct"
Linear System Direct Method = "umfpack"
Steady State Convergence Tolerance = 1.0e-5
Stabilize = True
Nonlinear System Convergence Tolerance = 1.0e-4
Nonlinear System Max Iterations = 3
Nonlinear System Newton After Iterations = 2
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 1.0
Adaptive Mesh Refinement = false
Adaptive Remesh = false
Adaptive Save Mesh = true
Adaptive Error Limit = 1e-4
End
Material 1
Density = 1
Heat Conductivity = 1
Heat Capacity = 1
End
Boundary Condition 1
Target Boundaries(1) = 1
Name = COLD
Temperature = 0
End
Boundary Condition 2
Target Boundaries(1) = 2
Name = HOT
Heat Flux BC = True
Heat Flux = 100
End
Boundary Condition 3
Target Boundaries(1) = 3
Name = heatgap
Heat Gap = True
Heat Transfer Coefficient = 1000
End
4. - enable mesh refinement (line 51 in sif to 'true'). SEGFAULT:
Code: Select all
WARNING:: CRS_AddToMatrixElement: Matrix element is to be added to a nonexistent position
WARNING:: CRS_AddToMatrixElement: Row: 333 Col: 58
WARNING:: CRS_AddToMatrixElement: Number of Matrix rows:516
WARNING:: CRS_AddToMatrixElement: Converting CRS to list
ListToCRSMatrix: Matrix format changed from CRS to List
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 ffffffffffffffff
don't double nodes in grd, use new keywords in sif. all is good, jump as expected.
adapt3.grd:
Code: Select all
***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = Cartesian 2D
Subcell Divisions in 2D = 3 3
Subcell Sizes 1 = 1e-3 1e-3 1e-3
Subcell Sizes 2 = 1e-3 1e-3 1e-3
Material Structure in 2D
2 1 2
2 2 2
3 3 3
End
Materials Interval = 1 3
Boundary Definitions
! type out int double of the boundaries
1 -1 3 1
2 -3 1 1
3 -1 2 1
End
Surface Elements = 10
Triangles = logical true !needed for RGB adaptive meshing
Numbering = Horizontal
Element Degree = 1
Code: Select all
Header
CHECK KEYWORDS Warn
Mesh DB "." "adapt3"
End
Simulation
Max Output Level = 5
Coordinate System = "Cartesian 2D"
Coordinate Mapping(3) = 1 2 3
Simulation Type = "Steady State"
Steady State Max Iterations = 10
Post File = file "adapt.ep"
End
Body 1
Target Bodies(2) = 1 2
Equation = 1
Material = 1
Initial Condition = 1
End
Body 2
Target Bodies(1) = 3
Equation = 1
Material = 1
Initial Condition = 1
End
Equation 1
Heat Equation = True
Active Solvers(1) = 1
End
Solver 1
Exec Solver = "Always"
Equation = "Heat Equation"
Procedure = "HeatSolve" "HeatSolver"
Variable = "Temperature"
Variable Dofs = 1
Optimize Bandwidth = True
Linear System Solver = "Direct"
Linear System Direct Method = "umfpack"
Steady State Convergence Tolerance = 1.0e-5
Stabilize = True
Nonlinear System Convergence Tolerance = 1.0e-4
Nonlinear System Max Iterations = 3
Nonlinear System Newton After Iterations = 2
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 1.0
Adaptive Mesh Refinement = false
Adaptive Remesh = false
Adaptive Save Mesh = true
Adaptive Error Limit = 1e-4
End
Material 1
Density = 1
Heat Conductivity = 1
Heat Capacity = 1
End
Boundary Condition 1
Target Boundaries(1) = 1
Name = COLD
Temperature = 0
End
Boundary Condition 2
Target Boundaries(1) = 2
Name = HOT
Heat Flux BC = True
Heat Flux = 100
End
Boundary Condition 3
Target Boundaries(1) = 3
Name = heatgap
Discontinuous Boundary = Logical True
Discontinuous Target Bodies (2) = 2 3
Heat Gap = True
Heat Transfer Coefficient = 1000
End
7. - adding "Discontinuous Bulk Greedy = Logical true", same segfault. set it to false, and it runs, but looking at the ep file in the final RefinedMesh folder, the temperature solution appears to ignore the heat gap even though mesh refinement was very refined around it. (perhaps the gap is there but the heat 'leaks' through it as was seen in other heat gap tests.
I'm guessing since triangle splitting involves putting new nodes on the boundary, somethnig about the discontinuity is unable to adjust both sides of the boundary? odd, then that the Greedy setting allows it to work. in any case, whether it should work or not, a Segfault rather than a controlled warning/error is probably not the desired outcome.