MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / N_VWL2Norm

Function N_VWL2Norm

externalpackages/PVODE/source/nvector.cpp:531–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529
530
531real N_VWL2Norm(N_Vector x, N_Vector w)
532{
533 integer N, N_global;
534 real sum = ZERO, *xd, *wd, gsum;
535 machEnvType machenv;
536
537 N = x->length;
538 N_global = x->global_length;
539 xd = x->data;
540 wd = w->data;
541 machenv = x->machEnv;
542
543 #pragma omp parallel for reduction(+: sum)
544 for (integer i=0; i < N; i++) {
545 real prodi = xd[i] * wd[i];
546 sum += prodi * prodi;
547 }
548
549 gsum = PVecAllReduce(sum, 1, machenv);
550 return(RSqrt(gsum));
551}
552
553
554real N_VL1Norm(N_Vector x)

Callers

nothing calls this directly

Calls 2

PVecAllReduceFunction · 0.85
RSqrtFunction · 0.85

Tested by

no test coverage detected