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

Function N_VL1Norm

externalpackages/PVODE/source/nvector.cpp:554–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552
553
554real N_VL1Norm(N_Vector x)
555{
556 integer N;
557 real sum = ZERO, gsum, *xd;
558 machEnvType machenv;
559
560
561 N = x->length;
562 xd = x->data;
563 machenv = x->machEnv;
564
565 #pragma omp parallel for reduction(+: sum)
566 for (integer i=0; i<N; i++) sum += ABS(xd[i]);
567
568 gsum = PVecAllReduce(sum, 1, machenv);
569
570 return(gsum);
571}
572
573
574void N_VCompare(real c, N_Vector x, N_Vector z)

Callers

nothing calls this directly

Calls 1

PVecAllReduceFunction · 0.85

Tested by

no test coverage detected