-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
1,598 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
|
||
import classy_blocks as cb | ||
from classy_blocks.grading.autograding.grader import HighReGrader | ||
|
||
mesh = cb.Mesh() | ||
|
||
base = cb.Grid([0, 0, 0], [3, 2, 0], 3, 2) | ||
|
||
shape = cb.ExtrudedShape(base, 1) | ||
mesh.add(shape) | ||
mesh.assemble() | ||
finder = cb.GeometricFinder(mesh) | ||
|
||
move_points = [[0, 1, 1], [2, 1, 1], [3, 1, 1]] | ||
|
||
for point in move_points: | ||
vertex = list(finder.find_in_sphere(point))[0] | ||
vertex.translate([0, 0.8, 0]) | ||
|
||
mesh.set_default_patch("walls", "wall") | ||
|
||
# TODO: Hack! mesh.assemble() won't work here but wires et. al. must be updated | ||
mesh.block_list.update() | ||
|
||
grader = HighReGrader(mesh, 0.05) | ||
grader.grade() | ||
|
||
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
import os | ||
|
||
import classy_blocks as cb | ||
from classy_blocks.grading.autograding.grader import SimpleGrader | ||
|
||
# a cylindrical tank with round end caps | ||
diameter = 0.5 | ||
length = 0.5 # including end caps | ||
|
||
# refer to other examples for a proper-ish grading setup | ||
h = 0.05 | ||
|
||
mesh = cb.Mesh() | ||
|
||
cylinder = cb.Cylinder([0, 0, 0], [length, 0, 0], [0, diameter / 2, 0]) | ||
|
||
wall_name = "tank_wall" | ||
|
||
cylinder.chop_axial(start_size=h) | ||
cylinder.chop_radial(start_size=h) | ||
cylinder.chop_tangential(start_size=h) | ||
cylinder.set_outer_patch(wall_name) | ||
|
||
start_cap = cb.Hemisphere.chain(cylinder, start_face=True) | ||
start_cap.chop_axial(start_size=h) | ||
start_cap.set_outer_patch(wall_name) | ||
|
||
end_cap = cb.Hemisphere.chain(cylinder, start_face=False) | ||
end_cap.chop_axial(start_size=h) | ||
end_cap.set_outer_patch(wall_name) | ||
|
||
mesh.add(cylinder) | ||
mesh.add(start_cap) | ||
mesh.add(end_cap) | ||
|
||
grader = SimpleGrader(mesh, 0.05) | ||
grader.grade() | ||
|
||
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
import classy_blocks as cb | ||
from classy_blocks.construct.flat.sketches.disk import QuarterDisk | ||
from classy_blocks.grading.autograding.grader import HighReGrader | ||
from classy_blocks.util import functions as f | ||
|
||
mesh = cb.Mesh() | ||
|
||
axis_point_1 = f.vector(0.0, 0.0, 0.0) | ||
axis_point_2 = f.vector(5.0, 5.0, 0.0) | ||
radius_point_1 = f.vector(0.0, 0.0, 2.0) | ||
|
||
# make a disk with small core block - yields particularly bad cell sizes with normal chops | ||
QuarterDisk.core_ratio = 0.4 | ||
|
||
quarter_disk = QuarterDisk(axis_point_1, radius_point_1, axis_point_1 - axis_point_2) | ||
quarter_cylinder = cb.ExtrudedShape(quarter_disk, f.norm(axis_point_2 - axis_point_1)) | ||
|
||
mesh.add(quarter_cylinder) | ||
|
||
mesh.assemble() | ||
|
||
grader = HighReGrader(mesh, 0.05) | ||
grader.grade() | ||
|
||
mesh.set_default_patch("walls", "wall") | ||
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.