construct evaluation matrix
See original GitHub issueGiven a domain and a number of points
within this domain, I would like to construct the small and fat evaluation matrix E
which, given coefficient vector x
returns E @ x
, the values of the corresponding finite element function at the points
. In FEniCS, I could do
def _build_eval_matrix(V, points):
"""Build the sparse m-by-n matrix that maps a coefficient set for a
function in V to the values of that function at m given points.
"""
mesh = V.mesh()
bbt = BoundingBoxTree()
bbt.build(mesh)
dofmap = V.dofmap()
el = V.element()
sdim = el.space_dimension()
rows = []
cols = []
data = []
for i, x in enumerate(points):
cell_id = bbt.compute_first_entity_collision(Point(*x))
cell = Cell(mesh, cell_id)
coordinate_dofs = cell.get_vertex_coordinates()
rows.append(numpy.full(sdim, i))
cols.append(dofmap.cell_dofs(cell_id))
v = el.evaluate_basis_all(x, coordinate_dofs, cell_id)
data.append(v)
rows = numpy.concatenate(rows)
cols = numpy.concatenate(cols)
data = numpy.concatenate(data)
m = len(points)
n = V.dim()
matrix = sparse.csr_matrix((data, (rows, cols)), shape=(m, n))
return matrix
The explicit loop doesn’t hurt much since the number of points
is usually small.
Any hints?
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Putting Together an Evaluation Matrix | CDC
While a matrix provides a 100ft view of your evaluation process, the analysis plan provides a 10ft view and can help make sure...
Read more >Evaluation Matrix Example - AWS
Using an Evalua on Matrix helps to ensure that Engineers make decisions based upon evidence - or, the quan ta ve values that...
Read more >How BAs Can Use a Decision Matrix to Make Tough Choices
A decision matrix is a tool that helps business analysts and other stakeholders evaluate their options with greater clarity and objectivity. A decision...
Read more >Evaluation Matrix - an overview | ScienceDirect Topics
An evaluation matrix was made, crossing, on the one hand, the type of users (main target user of the evaluated application or object)...
Read more >What is a Decision Matrix? Pugh, Problem, or Selection Grid
Decision Matrix Procedure · Brainstorm the evaluation criteria appropriate to the situation. If possible, involve customers in this process. · Discuss and refine ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah,
probes
was unreleased so we decided to use this approach.Alright, next release will be 3.0.0. I was expecting to further test and document some new features but we can always go for 3.0.x if any issues arise. I need to go through the issues and the changelog one more time and see if we are able to tag 3.0.0 in two weeks or so.