• 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

0.0
/src/problems/phantomimage.cpp
1
#include "problems/phantomimage.hpp"
2
#include "common/config.hpp"
3
#include "common/io.hpp"
4
#include "common/mesh.hpp"
5
#include "toolboxes/interpolation.hpp"
6

7
// ---- 2d test case
8

NEW
9
PhantomImage::PhantomImage( Config* settings, Mesh* mesh, QuadratureBase* quad ) : ProblemBase( settings, mesh, quad ) {}
×
10

11
PhantomImage::~PhantomImage() {}
×
12

×
13
std::vector<VectorVector> PhantomImage::GetExternalSource( const Vector& energies ) {
×
14
    return std::vector<VectorVector>( energies.size(), std::vector<Vector>( _mesh->GetNumCells(), Vector( _settings->GetNQuadPoints(), 0.0 ) ) );
15
}
×
16

×
17
VectorVector PhantomImage::SetupIC() {
18
    VectorVector psi( _mesh->GetNumCells(), Vector( _settings->GetNQuadPoints(), 1e-10 ) );
19
    auto cellMids         = _mesh->GetCellMidPoints();
×
20
    double s              = 0.1;
×
21
    double enterPositionX = 0.0;
×
22
    double enterPositionY = 0.5;
×
23
    for( unsigned j = 0; j < cellMids.size(); ++j ) {
×
24
        double x = cellMids[j][0] - enterPositionX;
×
25
        double y = cellMids[j][1] - enterPositionY;
×
26
        psi[j]   = 1.0 / ( s * sqrt( 2 * M_PI ) ) * std::exp( -( x * x + y * y ) / ( 2 * s * s ) );
×
27
    }
×
28
    return psi;
×
29
}
30

×
31
std::vector<double> PhantomImage::GetDensity( const VectorVector& cellMidPoints ) {
32

33
    std::string imageFile = _settings->GetCTFile();
×
34
    std::string meshFile  = _settings->GetMeshFile();
NEW
35
    ErrorMessages::Error( "Python API support is deprecated for KiT-RT. This function needs to be rewritten.\n Use a python script to first create "
×
NEW
36
                          "the mesh, then call KiT-RT from Python. This is the recommended workflow for stability and performance.",
×
NEW
37
                          CURRENT_FUNCTION );
×
38

39
    Matrix gsImage = Matrix( 0, 0 );    //    createSU2MeshFromImage( imageFile, meshFile ); DEprecated
40
    auto bounds    = _mesh->GetBounds();
41

×
42
    double xMin = bounds[0].first;
×
43
    double xMax = bounds[0].second;
44
    double yMin = bounds[1].first;
×
45
    double yMax = bounds[1].second;
×
46

×
47
    unsigned m = gsImage.rows();
×
48
    unsigned n = gsImage.columns();
49

×
50
    Vector x( m ), y( n );
×
51
    for( unsigned i = 0; i < m; ++i ) {
52
        x[i] = xMin + static_cast<double>( i ) / static_cast<double>( m - 1 ) * ( xMax - xMin );
×
53
    }
×
54
    for( unsigned i = 0; i < n; ++i ) y[i] = yMin + static_cast<double>( i ) / static_cast<double>( n - 1 ) * ( yMax - yMin );
×
55

56
    Interpolation interp( x, y, gsImage );
×
57
    std::vector<double> result( _mesh->GetNumCells(), 0.0 );
58
    for( unsigned i = 0; i < _mesh->GetNumCells(); ++i ) {
×
59
        result[i] = std::clamp( interp( cellMidPoints[i][0], cellMidPoints[i][1] ), 0.0, 1.85 );
×
60
    }
×
61
    return result;
×
62
}
63

×
64
VectorVector PhantomImage::GetScatteringXS( const Vector& /*energies*/ ) {
65
    // @TODO
66
    // Specified in subclasses
×
67
    return VectorVector( 1, Vector( 1, 0.0 ) );
68
}
69

×
70
VectorVector PhantomImage::GetTotalXS( const Vector& /*energies*/ ) {
71
    // @TODO
72
    // Specified in subclasses
×
73
    return VectorVector( 1, Vector( 1, 0.0 ) );
74
}
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