Skip to content

Average a CellField over a dimension #1032

Closed Answered by JordiManyer
hgpeterson asked this question in Q&A
Discussion options

You must be logged in to vote

There is no easy way of doing this. I think slicing up domains is something we could expand on. However, and as always, it is involved but not impossible.

The basic structure should go like this:

using Gridap
using Gridap.Geometry

model = CartesianDiscreteModel((0,1,0,1,0,1),(4,4,4))

order = 1
reffe = ReferenceFE(lagrangian,Float64,order)
V = TestFESpace(model,reffe);

function create_face_mask(model::DiscreteModel{Dc,Dp},mask) where {Dc,Dp}
  topo = get_grid_topology(model)
  node_coords = Geometry.get_vertex_coordinates(topo)
  face_to_node = Geometry.get_faces(topo,Dc-1,0)
  face_coords = lazy_map(Broadcasting(Reindex(node_coords)),face_to_node)
  bgface_to_mask = map(mask,face_coord…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hgpeterson
Comment options

@JordiManyer
Comment options

@hgpeterson
Comment options

Answer selected by hgpeterson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants