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

Function N_VWrmsNorm

externalpackages/PVODE/source/nvector.cpp:473–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471
472
473real N_VWrmsNorm(N_Vector x, N_Vector w)
474{
475 integer N, N_global;
476 real sum = ZERO, *xd, *wd, gsum;
477 machEnvType machenv;
478
479 N = x->length;
480 N_global = x->global_length;
481 xd = x->data;
482 wd = w->data;
483 machenv = x->machEnv;
484
485 #pragma omp parallel for reduction(+: sum)
486 for (integer i=0; i < N; i++) {
487 real prodi = xd[i] * wd[i];
488 sum += prodi * prodi;
489 }
490
491 gsum = PVecAllReduce(sum, 1, machenv);
492 return(RSqrt(gsum / N_global));
493}
494
495real N_VMin(N_Vector x)
496{

Callers 9

PVBBDDQJacFunction · 0.85
CVSpgmrSolveFunction · 0.85
CVSpgmrAtimesDQFunction · 0.85
CVodeFunction · 0.85
CVYddNormFunction · 0.85
CVnlsFunctionalFunction · 0.85
CVNewtonIterationFunction · 0.85
CVComputeEtaqm1Function · 0.85
CVComputeEtaqp1Function · 0.85

Calls 2

PVecAllReduceFunction · 0.85
RSqrtFunction · 0.85

Tested by

no test coverage detected