# Preferred way to construct block matrices with exact Dirichlet BC (tgv = -1)?

**URL:** <https://community.freefem.org/t/preferred-way-to-construct-block-matrices-with-exact-dirichlet-bc-tgv-1/222>\
**Category:** General Discussion\
**Created:** [January 14, 2020, 4:22pm UTC](https://community.freefem.org/t/preferred-way-to-construct-block-matrices-with-exact-dirichlet-bc-tgv-1/222 "2020-01-14T16:22:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [January 14, 2020, 9:14pm UTC](https://community.freefem.org/t/preferred-way-to-construct-block-matrices-with-exact-dirichlet-bc-tgv-1/222/2 "2020-01-14T21:14:31Z")

</div>

What bookkeeping are you talking about? We could add a new `tgv = -3` to handle this (I wanted to do this for a long time), but in the meantime, you can just impose on your off-diagonal blocks something like:

```auto
varf vGamma(u, v) = on(gamma, u = 1);
real[int] marker = vGamma(0, Vh, tgv = -1);
for[i,j,v : offdiagonal] if(marker[i] > 0.1)) v = 0.0;

```

---

_[View the full topic](https://community.freefem.org/t/preferred-way-to-construct-block-matrices-with-exact-dirichlet-bc-tgv-1/222)._
