Skip to content

[QUESTION] How to access vertices of both triangles sharing an edge in a fem.integrand function? #629

@akrivx

Description

@akrivx

Hi,

I'm working with a triangle mesh and using fem.Sides to represent edges. I'd like to compute a scalar quantity per interior edge (i.e., an edge shared by two triangles) using fem.interpolate, and for that, I need access to the four vertices involved (ignoring boundary edges where the quantity is zero):

  • The two vertices that form the shared edge, and
  • The vertex opposite the edge in each of the two adjacent triangles.

Ideally, I'd like to retrieve these vertex indices in a consistent and orderly way (e.g., counter-clockwise).

I know that given a sample point on a side, I can map it to the adjacent triangles using fem.to_inner_cell / fem.to_outer_cell, but I can't figure out how to retrieve the vertex indices or coordinates for those elements or the edge itself.

Are there any examples showing how to do this, or suggestions for recovering this 4-vertex configuration from within a fem.integrand?

Thanks,
Chris

Metadata

Metadata

Assignees

Labels

questionThe issue author requires information

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions