• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CSMMLab / KiT-RT / #94

27 May 2025 08:36PM UTC coverage: 46.655% (+0.009%) from 46.646%
#94

push

travis-ci

ScSteffen
merged from main

0 of 5 new or added lines in 1 file covered. (0.0%)

2 existing lines in 2 files now uncovered.

4422 of 9478 relevant lines covered (46.66%)

57163.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/solvers/mnsolver_normalized.cpp
1
#include "solvers/mnsolver_normalized.hpp"
2
#include "common/config.hpp"
3
#include "common/io.hpp"
4
#include "common/mesh.hpp"
5
#include "entropies/entropybase.hpp"
6
#include "fluxes/numericalflux.hpp"
7
#include "optimizers/newtonoptimizer.hpp"
8
#include "optimizers/optimizerbase.hpp"
9
#include "optimizers/partregularizednewtonoptimizer.hpp"
10
#include "problems/problembase.hpp"
11
#include "quadratures/quadraturebase.hpp"
12
#include "solvers/mnsolver.hpp"
13
#include "toolboxes/errormessages.hpp"
14
#include "toolboxes/textprocessingtoolbox.hpp"
15
#include "velocitybasis/sphericalbase.hpp"
16

17
// externals
18
#include "spdlog/spdlog.h"
19
#include <iostream>
20

21
MNSolverNormalized::MNSolverNormalized( Config* settings ) : MNSolver( settings ) {
×
22
    _u0 = Vector( _nCells, 0.0 );
×
23
    if( _settings->GetRegularizerGamma() > 0 ) {
×
24
        _optimizer2 = new PartRegularizedNewtonOptimizer( settings );
×
25
    }
26
    else {
27
        _optimizer2 = new NewtonOptimizer( settings );
×
28
    }
29
    _sol2 = VectorVector( _nCells, Vector( _nSystem, 0.0 ) );
×
30
}
31

32
MNSolverNormalized::~MNSolverNormalized() {}
×
33

×
34
void MNSolverNormalized::IterPreprocessing( unsigned /*idx_pseudotime*/ ) {
×
35
    Vector alpha_norm_per_cell( _nCells, 0 );    // ONLY FOR DEBUGGING! THIS SLOWS DOWN THE CODE
36

×
NEW
37
    // ------- Entropy closure Step ----------------
×
38
    for( unsigned idx_cell = 0; idx_cell < _nCells; idx_cell++ ) {
39
        _u0[idx_cell] = _sol[idx_cell][0];
NEW
40
        _sol[idx_cell] /= _u0[idx_cell];    // assume _u0 > 0 always!!
×
NEW
41
    }
×
UNCOV
42

×
43

44
    _optimizer->SolveMultiCell( _alpha, _sol, _momentBasis, alpha_norm_per_cell );
45

NEW
46
    // ------- Solution reconstruction step ----
×
47
#pragma omp parallel for
48
    for( unsigned idx_cell = 0; idx_cell < _nCells; idx_cell++ ) {
NEW
49

×
50
        alpha_norm_per_cell[idx_cell] *= _momentBasis[0][0] * 0.5 * _settings->GetRegularizerGamma();    // is constant
51
        // std::cout << alpha_norm << "|" << _momentBasis[0][0] << "\n";
52
        for( unsigned idx_quad = 0; idx_quad < _nq; idx_quad++ ) {
53
            // compute the kinetic density at all grid cells
54
            _kineticDensity[idx_cell][idx_quad] =
55
                _u0[idx_cell] * _entropy->EntropyPrimeDual( blaze::dot( _alpha[idx_cell], _momentBasis[idx_quad] ) - alpha_norm_per_cell[idx_cell] );
56
        }
57
    }
58

59
    // ------ Compute slope limiters and cell gradients ---
60
    if( _reconsOrder > 1 ) {
61
        _mesh->ComputeSlopes( _nq, _solDx, _solDy, _kineticDensity );               // parallel
62
        _mesh->ComputeLimiter( _nq, _solDx, _solDy, _kineticDensity, _limiter );    // parallel
×
63
    }
×
64
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc