Replies: 3 comments 2 replies
-
It is a combination of FacetBasis and Functional wrapper. fbasis = FacetBasis(mesh, ElementTriP1(), facets='top')
@Functional
def integral(w):
return … # w['u'] is the solution
print(integral.assemble(fbasis)) |
Beta Was this translation helpful? Give feedback.
2 replies
-
Adding
a the end of
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I have found a solution in other examples fbasis = FacetBasis(mesh, ElementTriP1(), facets='top')
@Functional
def total(w):
return w['u']
@Functional
def unit(w):
return 1
print('Mean value is')
print(asm(total, fbasis, u=u) / asm(unit, fbasis, u=u)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I managed to solve a problem I'm interested in (got a nice picture too 😄 ) but I'd like to compute some quantity from the solution field over some subset of the boundary. A simplest example could be an average.
Is there some util that can handle this already or does it have to be implemented each time?
The actual integral that I'd like to compute is
at the top boundary for$u(r,Z)$ the advection field as given in example_50.py (this would be total heat flux at the top surface).
Beta Was this translation helpful? Give feedback.
All reactions