Skip to content

Commit

Permalink
Update full-scale test to include refining output.
Browse files Browse the repository at this point in the history
  • Loading branch information
baagaard-usgs committed Jan 11, 2025
1 parent 4d283db commit e4aa7e1
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/fullscale/linearelasticity/faults-2d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ dist_noinst_DATA = \
shearnoslip.cfg \
shearnoslip_quad.cfg \
shearnoslip_tri.cfg \
shearnoslip_refineoutput.cfg \
shearnoslip_refineoutput_quad.cfg \
shearnoslip_refineoutput_tri.cfg \
zeroslipfn.timedb


Expand Down
26 changes: 26 additions & 0 deletions tests/fullscale/linearelasticity/faults-2d/TestShearNoSlip.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,37 @@ def setUp(self):
return


# -------------------------------------------------------------------------------------------------
class TestQuadGmshRefineOutput(TestCase):

def setUp(self):
self.name = "shearnoslip_refineoutput_quad"
self.mesh = meshes.QuadGmshRefineOutput()
super().setUp()

TestCase.run_pylith(self, self.name, ["shearnoslip.cfg", "shearnoslip_refineoutput.cfg", "shearnoslip_refineoutput_quad.cfg"])
return


# -------------------------------------------------------------------------------------------------
class TestTriGmshRefineOutput(TestCase):

def setUp(self):
self.name = "shearnoslip_refineoutput_tri"
self.mesh = meshes.TriGmshRefineOutput()
super().setUp()

TestCase.run_pylith(self, self.name, ["shearnoslip.cfg", "shearnoslip_refineoutput.cfg", "shearnoslip_refineoutput_tri.cfg"])
return


# -------------------------------------------------------------------------------------------------
def test_cases():
return [
TestQuadGmsh,
TestTriGmsh,
TestQuadGmshRefineOutput,
TestTriGmshRefineOutput,
]


Expand Down
52 changes: 52 additions & 0 deletions tests/fullscale/linearelasticity/faults-2d/meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,58 @@ class QuadGmsh(object):
}


class TriGmshRefineOutput(object):
"""Mesh information for tri mesh using Gmsh with 1 level of refinement for output.
"""
ENTITIES = {
"domain": MeshEntity(ncells=164*4, ncorners=3, nvertices=361+2*(9+8)),
"points": MeshEntity(ncells=3, ncorners=1, nvertices=3),

# Materials
"mat_xneg": MeshEntity(ncells=38*4, ncorners=3, nvertices=97),
"mat_xmid": MeshEntity(ncells=38, ncorners=3, nvertices=30),
"mat_xposypos": MeshEntity(ncells=44, ncorners=3, nvertices=31),
"mat_xposyneg": MeshEntity(ncells=44, ncorners=3, nvertices=31),

# Faults
"fault_xmid": MeshEntity(ncells=8*2, ncorners=2, nvertices=9+8),
"fault_xneg": MeshEntity(ncells=8, ncorners=2, nvertices=9),

# Boundaries
"bc_xneg": MeshEntity(ncells=8, ncorners=2, nvertices=9),
"bc_xpos": MeshEntity(ncells=8*2, ncorners=2, nvertices=9+8),
"bc_yneg": MeshEntity(ncells=8, ncorners=2, nvertices=9+2),
"bc_ypos": MeshEntity(ncells=8*2, ncorners=2, nvertices=9+8+2),
"boundary_ypos": MeshEntity(ncells=16, ncorners=2, nvertices=17+2),
}


class QuadGmshRefineOutput(object):
"""Mesh information for quad mesh using Gmsh with 1 level of refinement for output.
"""
ENTITIES = {
"domain": MeshEntity(ncells=100*4, ncorners=4, nvertices=(11+10)**2 + 2*(11+10)),
"points": MeshEntity(ncells=3, ncorners=1, nvertices=3),

# Materials
"mat_xneg": MeshEntity(ncells=30*4, ncorners=3, nvertices=147),
"mat_xmid": MeshEntity(ncells=20, ncorners=3, nvertices=33),
"mat_xposypos": MeshEntity(ncells=25, ncorners=3, nvertices=36),
"mat_xposyneg": MeshEntity(ncells=25, ncorners=3, nvertices=36),

# Faults
"fault_xmid": MeshEntity(ncells=20*2, ncorners=2, nvertices=11+10),
"fault_xneg": MeshEntity(ncells=10, ncorners=2, nvertices=11),

# Boundaries
"bc_xneg": MeshEntity(ncells=10, ncorners=2, nvertices=11),
"bc_xpos": MeshEntity(ncells=20*2, ncorners=2, nvertices=11+10),
"bc_yneg": MeshEntity(ncells=11, ncorners=2, nvertices=11+2),
"bc_ypos": MeshEntity(ncells=11*2, ncorners=2, nvertices=11+10+2),
"boundary_ypos": MeshEntity(ncells=11*2, ncorners=2, nvertices=11+10+2),
}


class TriCubit(object):
"""Mesh information for tri mesh using Cubit.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ----------------------------------------------------------------------
# problem
# ----------------------------------------------------------------------
[pylithapp.problem.solution_observers]
domain.refine_levels = 1
boundary_ypos.refine_levels = 1


# ----------------------------------------------------------------------
# materials
# ----------------------------------------------------------------------
[pylithapp.problem.materials]
mat_xneg.observers.observer.refine_levels = 1


# ----------------------------------------------------------------------
# faults
# ----------------------------------------------------------------------
[pylithapp.problem.interfaces]
fault_xmid.observers.observer.refine_levels = 1


# ----------------------------------------------------------------------
# boundary conditions
# ----------------------------------------------------------------------
[pylithapp.problem.bc]
bc_xpos.observers.observer.refine_levels = 1
bc_ypos.observers.observer.refine_levels = 1


# End of file
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[pylithapp.metadata]
base = [pylithapp.cfg, shearnoslip.cfg, shearnoslip_refineoutput.cfg]
keywords = [quadrilateral cells]
arguments = [shearnoslip_refineoutput.cfg, shearnoslip_refineoutput_quad.cfg]

[pylithapp.problem]
defaults.name = shearnoslip_refineoutput_quad

# ----------------------------------------------------------------------
# mesh_generator
# ----------------------------------------------------------------------
[pylithapp.mesh_generator.reader]
filename = mesh_quad.msh


# End of file
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[pylithapp.metadata]
base = [pylithapp.cfg, shearnoslip.cfg, shearnoslip_refineoutput.cfg]
keywords = [triangular cells]
arguments = [shearnoslip_refineoutput.cfg, shearnoslip_refineoutput_tri.cfg]

[pylithapp.problem]
defaults.name = shearnoslip_refineoutput_tri

# ----------------------------------------------------------------------
# mesh_generator
# ----------------------------------------------------------------------
[pylithapp.mesh_generator.reader]
filename = mesh_tri.msh


# End of file

0 comments on commit e4aa7e1

Please sign in to comment.