refactor solver (untested)
This commit is contained in:
parent
8682ee1ff8
commit
ff3951ba35
1 changed files with 194 additions and 124 deletions
|
|
@ -1,9 +1,29 @@
|
|||
/*
|
||||
* Apply PEC and preconditioner.
|
||||
*
|
||||
* Template parameters:
|
||||
* ctype name of complex type (eg. cdouble)
|
||||
* pec false iff no PEC anyhwere
|
||||
*
|
||||
* Arguments:
|
||||
* ctype *E (output) E-field
|
||||
* ctype *Pr Entries of (diagonal) right preconditioner matrix
|
||||
* ctype *p (input vector)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
//Defines to clean up operation names
|
||||
#define ctype {{ctype}}_t
|
||||
#define zero {{ctype}}_new(0.0, 0.0)
|
||||
#define mul {{ctype}}_mul
|
||||
|
||||
|
||||
{%- if pec -%}
|
||||
if (pec[i] != 0) {
|
||||
E[i] = cdouble_new(0.0, 0.0);
|
||||
E[i] = zero;
|
||||
} else
|
||||
{%- endif -%}
|
||||
{
|
||||
E[i] = cdouble_mul(Pr[i], p[i]);
|
||||
E[i] = mul(Pr[i], p[i]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue