Closed julesghub closed 5 months ago
@lmoresi @jcgraciosa please have a look - we can discuss tomorrow.
One comment. To find boundary names, use uwmesh.view()
... that's not programmatic, of course, but it is a central place for information. For example:
Mesh # 0: tmp_shear_inclusion.msh
| Variable Name | component | degree | type |
| ---------------------------------------------------------- |
| U | 2 | 2 | VECTOR |
| P | 1 | 1 | SCALAR |
| Stress | 3 | 2 | SYM_TENSOR |
| eps_dot | 1 | 2 | SCALAR |
| tau | 1 | 2 | SCALAR |
| psi_star_sl_1_0 | 3 | 1 | SYM_TENSOR |
| ---------------------------------------------------------- |
| Boundary Name | ID | Min Size | Max Size |
| ------------------------------------------------------ |
| bottom | 1 | 79 | 79 |
| right | 2 | 27 | 27 |
| top | 3 | 79 | 79 |
| left | 4 | 27 | 27 |
| inclusion | 5 | 51 | 51 |
| All_Boundaries | 1001 | 135 | 135 |
| ------------------------------------------------------ |
Nice - i'll add the suggestion. Thanks @lmoresi
How about also adding variable_type
in the add_bc
function? This way, users can easily identify whether the boundary condition is applied to a velocity or pressure variable. In a way, this information is conveyed by the number of components in cond
.
Thanks Tyagi - that's a nice idea that JC and I have discussed previously.
I can add it but we need to do lots of tests going forward. Especially getting the variable
correct.
We don't want to always assume v & p. Better to use Petsc's internal representation for the system unknowns.
Added the request @gthyagi and @lmoresi.
New conditions function looks like
add_condition(self, f_id, c_type, conds, boundary, components):
You can specify the f_id to apply it. As I mentioned this is untested numerically with the solver configuration we have.
Components is not really needed any more. Can we absorb it as extra args but not encourage it.
Or deprecation warning.
Regarding the variable type - this makes sense for the essential boundary conditions but not so much for natural bc/s.
True that. Perhaps unknown field equation id - eqid?
Or you could have two different interfaces - one for essential and one for natural ... oh wait a minute ...
@julesghub @lmoresi Can we also add surface integration feature? Currently we have volume integration over the entire mesh. This can help to compute average quantities on inner/outer surfaces in Annulus/Spherical benchmarks.
We have talked about this and I agree that it would be helpful. It's one for @julesghub to implement.
Suggest we create an issue type for "enhancement" and create a new issue.
@julesghub Can you use https://petsc.org/main/manualpages/DMPlex/DMPlexComputeBdIntegral/ ?
Unifying the two BC functions add_dirichlet and add_natural in generic solvers.pyx
Existing functions add_dirichlet / add_natural now point to new add_bc() and are there to support existing models.