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

Open-Sn / opensn / 25478472129

07 May 2026 04:23AM UTC coverage: 75.685% (+0.3%) from 75.416%
25478472129

push

github

web-flow
Merge pull request #1057 from wdhawkins/c5g7_fixes

Updating tests.json for c5g7 tests and new iterative output.

22081 of 29175 relevant lines covered (75.68%)

65079358.06 hits per line

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

93.33
/framework/math/functions/function.h
1
// SPDX-FileCopyrightText: 2024 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#pragma once
5

6
#include "framework/data_types/vector3.h"
7
#include <functional>
8
#include <vector>
9

10
namespace opensn
11
{
12

13
using ScalarSpatialFunction = std::function<double(const Vector3&)>;
14
using ScalarSpatialMaterialFunction = std::function<double(int, const Vector3&)>;
15
using ScalarMaterialFunction = std::function<double(double, unsigned int)>;
16

17
/// Base class for evaluating spatial material functions given a coordinate.
18
class VectorSpatialFunction : public std::function<std::vector<double>(const Vector3&, std::size_t)>
12✔
19
{
20
public:
21
  VectorSpatialFunction() = default;
22
  VectorSpatialFunction(const std::function<std::vector<double>(const Vector3&, std::size_t)>& src)
16✔
23
    : std::function<std::vector<double>(const Vector3&, std::size_t)>(src)
16✔
24
  {
25
  }
16✔
26
};
27

28
/// Base class for evaluating incoming angular fluxes given group and direction indices.
29
class AngularFluxFunction : public std::function<double(int, int)>
4✔
30
{
31
public:
32
  AngularFluxFunction() = default;
33
  AngularFluxFunction(const std::function<double(int, int)>& src)
16✔
34
    : std::function<double(int, int)>(src)
16✔
35
  {
36
  }
37
};
38

39
/// Base class for evaluating incoming angular fluxes given group, direction, and time.
40
class AngularFluxTimeFunction : public std::function<double(int, int, double)>
96✔
41
{
42
public:
43
  AngularFluxTimeFunction() = default;
44
  AngularFluxTimeFunction(const std::function<double(int, int, double)>& src)
140✔
45
    : std::function<double(int, int, double)>(src)
140✔
46
  {
47
  }
40✔
48
};
49

50
/// Base class for evaluating group-wise strengths given group index and time.
51
class GroupTimeFunction : public std::function<double(unsigned int, double)>
×
52
{
53
public:
54
  GroupTimeFunction() = default;
55
  GroupTimeFunction(const std::function<double(unsigned int, double)>& src)
4✔
56
    : std::function<double(unsigned int, double)>(src)
4✔
57
  {
58
  }
4✔
59
};
60

61
} // namespace opensn
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