Skip to content

Commit

Permalink
add constructor for cut cell MeshData where vx, vy are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Jan 14, 2023
1 parent 051c179 commit 9660ba1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/cut_cell_meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ cells placed along each dimension.
MeshData(rd::RefElemData, curves, cells_per_dimension; kwargs...) =
MeshData(rd::RefElemData, curves, cells_per_dimension, cells_per_dimension; kwargs...)

function MeshData(rd::RefElemData, curves, cells_per_dimension_x, cells_per_dimension_y;
function MeshData(rd::RefElemData, curves,
cells_per_dimension_x::Int, cells_per_dimension_y::Int;
quad_rule_face = get_1d_quadrature(rd),
coordinates_min=(-1.0, -1.0), coordinates_max=(1.0, 1.0),
precompute_operators=false)
Expand All @@ -517,6 +518,17 @@ function MeshData(rd::RefElemData, curves, cells_per_dimension_x, cells_per_dime
vx = LinRange(coordinates_min[1], coordinates_max[1], cells_per_dimension_x + 1)
vy = LinRange(coordinates_min[2], coordinates_max[2], cells_per_dimension_y + 1)

return MeshData(rd, curves, vx, vy; quad_rule_face, precompute_operators)
end

function MeshData(rd::RefElemData, curves,
vx::AbstractVector, vy::AbstractVector;
quad_rule_face=get_1d_quadrature(rd),
precompute_operators=false)

cells_per_dimension_x = length(vx) - 1
cells_per_dimension_y = length(vy) - 1

# compute mesh intersections and cut cell elements.
# `regions` is a matrix of dimensions `(cells_per_dimension_x, cells_per_dimension_y)` with 3 values:
# * 1: cut cell
Expand Down

0 comments on commit 9660ba1

Please sign in to comment.