Skip to content

Commit

Permalink
Merge pull request #24081 from roystgnr/disc_bex
Browse files Browse the repository at this point in the history
discontinuous_spline_extraction option
  • Loading branch information
roystgnr authored Mar 29, 2024
2 parents 3a4cbc8 + b922a82 commit abd38c4
Show file tree
Hide file tree
Showing 22 changed files with 345 additions and 29 deletions.
11 changes: 11 additions & 0 deletions framework/src/meshgenerators/FileMeshGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ FileMeshGenerator::validParams()
"If clear_spline_nodes=true, IsoGeometric Analyis spline nodes "
"and constraints are removed from an IGA mesh, after which only "
"C^0 Rational-Bernstein-Bezier elements will remain.");
params.addParam<bool>("discontinuous_spline_extraction",
false,
"If discontinuous_spline_extraction=true, "
"Rational-Bernstein-Bezier elements extracted from a spline mesh "
"will be disconnected from neighboring elements, coupled only via "
"their extraction operators. This may be less efficient than the "
"default C^0 extracted mesh, but may be necessary if the extracted "
"mesh is non-conforming.");
params.addClassDescription("Read a mesh from a file.");
return params;
}
Expand Down Expand Up @@ -87,6 +95,9 @@ FileMeshGenerator::generate()
{
if (mesh->processor_id() == 0)
{
if (getParam<bool>("discontinuous_spline_extraction"))
exreader->set_discontinuous_bex(true);

exreader->read(_file_name);

if (getParam<bool>("clear_spline_nodes"))
Expand Down
2 changes: 0 additions & 2 deletions modules/solid_mechanics/examples/cframe_iga/tests
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
method = '!DBG'
# See #24187
petsc_version = '>=3.12.0'
# See #25819
dof_id_bytes = 8
valgrind = none
[]
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = test_2edge.e
discontinuous_spline_extraction = true
[]
[]

[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]

[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]

[ICs]
[u]
type = FunctionIC
variable = u
function = 'sin(x)'
[]
[]

[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]

[Outputs]
exodus = true
[]
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
[]
allow_renumbering = false
parallel_type = replicated
allow_renumbering = false # VTK diffs via XMLDiff are
parallel_type = replicated # really fragile
[]

[Variables]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
file = PressurizedCyl_Patch6_4Elem.e
clear_spline_nodes = true
[]
allow_renumbering = false
parallel_type = replicated
allow_renumbering = false # VTK diffs via XMLDiff are
parallel_type = replicated # really fragile
[]

[Variables]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
discontinuous_spline_extraction = true
[]
[]

[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]

[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]

[ICs]
[u]
type = FunctionIC
variable = u
function = 'sin(x)'
[]
[]

[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]

[Outputs]
exodus = true
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
discontinuous_spline_extraction = true
[]
[]

[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]

[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[rxn]
type = Reaction
variable = u
rate = -0.1
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]

[ICs]
[u]
type = FunctionIC
variable = u
function = '1.0'
[]
[]

[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]

[Outputs]
exodus = true
[]
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
type = FileMeshGenerator
file = Cube_With_Sidesets.e
[]
allow_renumbering = false
parallel_type = replicated
allow_renumbering = false # VTK diffs via XMLDiff are
parallel_type = replicated # really fragile
[]

[Variables]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = test_quadratic.e
discontinuous_spline_extraction = true
[]
[]

[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]

[ICs]
[u]
type = FunctionIC
variable = u
function = 'x'
[]
[]

[Kernels]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[./time]
type = TimeDerivative
variable = u
block = 0
[../]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]

[Executioner]
type = Transient
num_steps = 1
solve_type = NEWTON
dt = 1
[]

[Outputs]
exodus = true
[]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
<PUnstructuredGrid GhostLevel="1">
<PPointData RationalWeights="RationalWeights">
<PDataArray type="Int32" Name="libmesh_node_id"/>
<PDataArray type="Float64" Name="RationalWeights"/>
<PDataArray type="Float64" Name="u"/>
</PPointData>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
<UnstructuredGrid>
<Piece NumberOfPoints="25" NumberOfCells="4">
<PointData RationalWeights="RationalWeights">
<DataArray type="Int32" Name="libmesh_node_id" format="ascii" RangeMin="16" RangeMax="40">
16 17 18 19 20 21
22 23 24 25 26 27
28 29 30 31 32 33
34 35 36 37 38 39
40
</DataArray>
<DataArray type="Float64" Name="RationalWeights" format="ascii" RangeMin="0.8535533905941428" RangeMax="1.000000000000019">
1.000000000000002 0.8535533905941428 0.8535533905941497 1.000000000000005 0.8535533905941461 0.8535533905941527
1.000000000000012 0.8535533905941521 0.8535533905941588 0.8535533905941567 1.000000000000002 0.8535533905941592
1.000000000000004 0.8535533905941656 1.0000000000000115 1.000000000000019 0.8535533905941581 0.853553390594165
1.000000000000002 0.853553390594143 0.8535533905941495 0.8535533905941719 1.000000000000019 0.853553390594156
1.000000000000001
</DataArray>
<DataArray type="Float64" Name="u" format="ascii" RangeMin="0" RangeMax="0.4794383698264516">
0.4794383698264516 0.47785813166466456 0.47345648342332447 0.47937076789790656 0.477804004039832 0.4734428002629079
0.4792017393054785 0.47766875832572725 0.47340889522507873 0 0 0
<DataArray type="Float64" Name="u" format="ascii" RangeMin="0" RangeMax="0.4860195810457867">
0.4860195810457867 0.48453973583237864 0.4804644157236139 0.48595583094624695 0.48448931984066745 0.48045391278373695
0.485796482609765 0.48436340785780146 0.48042797248844604 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
<PUnstructuredGrid GhostLevel="1">
<PPointData RationalWeights="RationalWeights">
<PDataArray type="Int32" Name="libmesh_node_id"/>
<PDataArray type="Float64" Name="RationalWeights"/>
<PDataArray type="Float64" Name="u"/>
</PPointData>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
<UnstructuredGrid>
<Piece NumberOfPoints="41" NumberOfCells="4">
<PointData RationalWeights="RationalWeights">
<DataArray type="Int32" Name="libmesh_node_id" format="ascii" RangeMin="0" RangeMax="40">
0 1 2 3 4 5
6 7 8 9 10 11
12 13 14 15 16 17
18 19 20 21 22 23
24 25 26 27 28 29
30 31 32 33 34 35
36 37 38 39 40
</DataArray>
<DataArray type="Float64" Name="RationalWeights" format="ascii" RangeMin="0.8535533905941428" RangeMax="1.000000000000019">
1.000000000000002 0.8535533905941428 0.8535533905941567 1.000000000000002 1.000000000000005 0.8535533905941461
0.8535533905941592 1.000000000000004 1.000000000000019 0.8535533905941581 0.8535533905941719 1.000000000000019
Expand All @@ -12,14 +21,14 @@
1.0000000000000115 1.000000000000019 0.8535533905941581 0.853553390594165 1.000000000000002 0.853553390594143
0.8535533905941495 0.8535533905941719 1.000000000000019 0.853553390594156 1.000000000000001
</DataArray>
<DataArray type="Float64" Name="u" format="ascii" RangeMin="0.4664190830301079" RangeMax="0.47941867657053144">
0.47941867657053144 0.4793470160152781 0.46700861382638914 0.4664190830301079 0.4794061486286514 0.4793335948962325
0.4670174842023429 0.46643240648164813 0.4789510392927619 0.4788559857818215 0.46737074950821267 0.46688048895779016
0.4788890594965306 0.47879152897639765 0.4674236823510491 0.46694417032597063 0.47941867657053144 0.47788827474102535
0.4731778149208336 0.47935239194713514 0.4778339381041117 0.47316833690414034 0.47917859396070667 0.47769192507288627
0.47314445359715235 0.4683219129028348 0.4664190830301079 0.4683625381259725 0.4664850859282808 0.4684695154461442
0.46665644771971915 0.4789924330106902 0.47754011391283846 0.4731196986377274 0.4788890594965306 0.47745638288945796
0.4731076056637234 0.4685851008080247 0.4668403989903176 0.46865155015628907 0.46694417032597063
<DataArray type="Float64" Name="u" format="ascii" RangeMin="0.47445598718343496" RangeMax="0.48603151780879367">
0.48603151780879367 0.48576107973844235 0.47504872784287416 0.47445598718343496 0.48601958977655924 0.4857486294487372
0.4750570768596925 0.4744689533746331 0.4855891196012813 0.48531027773763513 0.4753867178447443 0.47489867992056944
0.4855307957818521 0.48525155364613637 0.47543616234385805 0.4749595435801812 0.48603151780879367 0.48455306103882423
0.4804049037906583 0.4859687630127081 0.4845026921292515 0.4803965713929476 0.48580435468892025 0.4843712066686249
0.4803756754727022 0.476166228893085 0.47445598718343496 0.4762048058286064 0.4745194276450756 0.4763062311269181
0.47468381664760123 0.48562834741833366 0.48423076218860617 0.4803541322625197 0.4855307957818521 0.4841535162208571
0.4803438579949972 0.47641578987894656 0.4748601800172304 0.47647876717561843 0.4749595435801812
</DataArray>
</PointData>
<CellData>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit abd38c4

Please sign in to comment.