2016-08-03 14:51:25 -07:00
|
|
|
/*
|
|
|
|
* Apply PEC and preconditioner.
|
|
|
|
*
|
|
|
|
* Template parameters:
|
2016-08-03 15:04:13 -07:00
|
|
|
* pec false iff no PEC anywhere
|
2016-08-03 14:51:25 -07:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* ctype *E (output) E-field
|
|
|
|
* ctype *Pr Entries of (diagonal) right preconditioner matrix
|
|
|
|
* ctype *p (input vector)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-07-04 16:29:21 -07:00
|
|
|
{%- if pec -%}
|
|
|
|
if (pec[i] != 0) {
|
2016-08-03 14:51:25 -07:00
|
|
|
E[i] = zero;
|
2016-07-04 16:29:21 -07:00
|
|
|
} else
|
|
|
|
{%- endif -%}
|
|
|
|
{
|
2016-08-03 14:51:25 -07:00
|
|
|
E[i] = mul(Pr[i], p[i]);
|
2016-07-04 16:29:21 -07:00
|
|
|
}
|