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

CSMMLab / KiT-RT / #95

28 May 2025 02:06AM UTC coverage: 46.655% (-11.1%) from 57.728%
#95

push

travis-ci

web-flow
Release 2025 (#44)

* New neural models (#30)

* extend kitrt script

* added new neural models

* extend to m3 models

* added M3_2D models

* added M2 and M4 models

* configure ml optimizer for high order models

* added configuration for high order models

* add option for rotation postprcessing in neural networks. remove unneccessary python scripts

* started rotational symmetric postprocessing

* added rotational invariance postprocessing for m2 and m1 models

* fix post merge bugs

* created hohlraum mesh

* add hohlraum tes case

* add hohlraum test case

* add hohlraum cfg filees

* fixed hohlraum testcase

* add hohlraum cfg files

* changed hohlraum cfg

* changed hohlraum testcase to isotropic inflow source boundary condition

* added ghost cell bonudary for hohlraum testcase

* update readme and linesource mesh creator

* added proper scaling for linesource reference solution

* regularized newton debugging

* Data generator with reduced objective functional (#33)

* added reduced optimizer for sampling

* remove old debugging comments

* mesh acceleration (#38)

* added new ansatz (#36)

* added new ansatz

* debug new ansatz

* branch should be abandoned here

* debug new ansatz

* fix scaling error new ansatz

* fix config errors

* temporarily fixed dynamic ansatz rotation bug

* fix inheritance error for new ansatz

* mesh acceleration

* add structured hohlraum

* Mesh acc (#41)

* mesh acceleration

* added floor value for starmap moment methods

* enable accelleration

* delete minimum value starmap

* Update README.md

* Spherical harmonics nn (#40)

* added new ansatz

* debug new ansatz

* branch should be abandoned here

* debug new ansatz

* fix scaling error new ansatz

* fix config errors

* temporarily fixed dynamic ansatz rotation bug

* fix inheritance error for new ansatz

* mesh acceleration

* add structured hohlraum

* added sph... (continued)

767 of 3019 new or added lines in 51 files covered. (25.41%)

131 existing lines in 8 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

45.71
/src/problems/starmapvalidation.cpp
1
#include "problems/starmapvalidation.hpp"
2
#include "common/config.hpp"
3
#include "common/io.hpp"
4
#include "common/mesh.hpp"
5
#include "problems/problembase.hpp"
6
#include "solvers/csdpn_starmap_constants.hpp"
7
#include "toolboxes/errormessages.hpp"
8
#include "toolboxes/interpolation.hpp"
9
#include "velocitybasis/sphericalbase.hpp"
10

11
#include <fstream>
12
#include <numeric>
13

14
StarMapValidation_SN::StarMapValidation_SN( Config* settings, Mesh* mesh, QuadratureBase* quad ) : ProblemBase( settings, mesh, quad ) {}
4✔
15

16
StarMapValidation_SN::~StarMapValidation_SN() {}
×
17

×
NEW
18
VectorVector StarMapValidation_SN::GetScatteringXS( const Vector& /*energies*/ ) {
×
19
    // @TODO
20
    // Specified in subclasses
×
21
    return VectorVector( 1, Vector( 1, 0.0 ) );
22
}
23

×
24
VectorVector StarMapValidation_SN::GetTotalXS( const Vector& /*energies*/ ) {
25
    // @TODO
26
    // Specified in subclasses
×
27
    return VectorVector( 1, Vector( 1, 0.0 ) );
28
}
29

×
30
std::vector<Matrix> StarMapValidation_SN::GetScatteringXSE( const Vector& /*energies*/, const Matrix& /*angles*/ ) {
31
    // @TODO
32
    // Specified in subclasses
×
33
    // return _physics->GetScatteringXS( energies, angles );
34
    return std::vector<Matrix>( 1, Matrix( 1, 1 ) );
35
}
36

×
37
Vector StarMapValidation_SN::GetTotalXSE( const Vector& /*energies*/ ) {
38
    // @TODO
39
    // Specified in subclasses
×
40
    // return _physics->GetTotalXSE( energies );
41
    return Vector( 1 );
42
}
43

×
44
std::vector<VectorVector> StarMapValidation_SN::GetExternalSource( const Vector& energies ) {
45
    auto zeroVec = Vector( _settings->GetNQuadPoints(), 0.0 );
46
    auto uniform = std::vector<Vector>( _mesh->GetNumCells(), zeroVec );
×
47
    auto Q       = std::vector<VectorVector>( energies.size(), uniform );
×
48
    return Q;
×
49
}
×
50

×
51
VectorVector StarMapValidation_SN::SetupIC() {
52
    VectorVector psi( _mesh->GetNumCells(), Vector( _settings->GetNQuadPoints(), 1e-10 ) );
53
    auto cellMids = _mesh->GetCellMidPoints();
×
54
    // double enterPositionX = 0.5;    // 0.0;
×
55
    // double enterPositionY = 0.5;
×
56
    // double t              = 1e-5;    // pseudo time for gaussian smoothing
57
    const double stddev = .01;
58
    Vector pos_beam     = Vector{ 0.5, 0.5 };
59

×
60
    for( unsigned j = 0; j < cellMids.size(); ++j ) {
×
61
        double x = cellMids[j][0];
62
        double y = cellMids[j][1];
×
63
        double f = NormPDF( x, pos_beam[0], stddev ) * NormPDF( y, pos_beam[1], stddev ) / ( 4 * M_PI );
×
64
        psi[j]   = Vector( _settings->GetNQuadPoints(), f * StarMAPmoments[0] );
×
65
    }
×
66
    return psi;
×
67
}
68

×
69
std::vector<double> StarMapValidation_SN::GetDensity( const VectorVector& /*cellMidPoints*/ ) {
70
    double rhoL = 1.0;
71
    double rhoR = 5.0;
4✔
72
    std::vector<double> rho( _settings->GetNCells(), rhoL );
4✔
73

4✔
74
    // use values rhoR on right third of domain
4✔
75
    auto cellMids = _mesh->GetCellMidPoints();
76
    for( unsigned j = 0; j < cellMids.size(); ++j ) {
77
        double x = cellMids[j][0];
8✔
78
        if( x >= 0.56 ) {
3,604✔
79
            rho[j] = rhoR;
3,600✔
80
        }
3,600✔
81
    }
1,560✔
82
    return rho;
83
}
84

8✔
85
// Moment  version below
86
StarMapValidation_Moment::StarMapValidation_Moment( Config* settings, Mesh* mesh, QuadratureBase* quad )
87
    : StarMapValidation_SN( settings, mesh, quad ) {}
88

4✔
89
StarMapValidation_Moment::~StarMapValidation_Moment() {}
4✔
90

91
VectorVector StarMapValidation_Moment::SetupIC() {
×
92
    SphericalBase* tempBase  = SphericalBase::Create( _settings );
×
93
    unsigned ntotalEquations = tempBase->GetBasisSize();
×
94
    delete tempBase;
95
    // write initial condition
4✔
96
    Vector pos_beam              = Vector{ 0.5, 0.5 };
4✔
97
    VectorVector initialSolution = VectorVector( _mesh->GetNumCells(), Vector( ntotalEquations, 0.0 ) );
4✔
98
    VectorVector cellMidpoints   = _mesh->GetCellMidPoints();
4✔
99
    const double stddev          = .01;
100
    double x = 0.0, y = 0.0, f = 0.0;
8✔
101

8✔
102
    for( unsigned idx_cell = 0; idx_cell < _mesh->GetNumCells(); ++idx_cell ) {
8✔
103
        x = cellMidpoints[idx_cell][0];
4✔
104
        y = cellMidpoints[idx_cell][1];
4✔
105
        f = NormPDF( x, pos_beam[0], stddev ) * NormPDF( y, pos_beam[1], stddev );
106

3,604✔
107
        initialSolution[idx_cell][0] = f * StarMAPmoments[0];
3,600✔
108
        for( unsigned idx_sys = 1; idx_sys < ntotalEquations; idx_sys++ ) {
3,600✔
109
            initialSolution[idx_cell][idx_sys] = f * StarMAPmoments[idx_sys];    // must be VectorVector
3,600✔
110
        }
111
    }
3,600✔
112
    return initialSolution;
230,400✔
113
}
226,800✔
114
std::vector<VectorVector> StarMapValidation_Moment::GetExternalSource( const Vector& energies ) {
115
    SphericalBase* tempBase  = SphericalBase::Create( _settings );
116
    unsigned ntotalEquations = tempBase->GetBasisSize();
8✔
117
    delete tempBase;
118
    // write initial condition
×
119
    auto zeroVec = Vector( ntotalEquations, 0.0 );
×
120
    auto uniform = std::vector<Vector>( _mesh->GetNumCells(), zeroVec );
×
121
    auto Q       = std::vector<VectorVector>( energies.size(), uniform );
×
122
    return Q;
123
}
×
124

×
125
double StarMapValidation_SN::NormPDF( double x, double mu, double sigma ) {
×
126
    return INV_SQRT_2PI / sigma * std::exp( -( ( x - mu ) * ( x - mu ) ) / ( 2.0 * sigma * sigma ) );
×
127
}
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