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

Open-Sn / opensn / 16766938693

05 Aug 2025 03:26PM UTC coverage: 73.386% (+0.1%) from 73.282%
16766938693

push

github

web-flow
Merge pull request #693 from andrsd/move-bnds

Moving sweep boundaries into `DiscreteOrdinatesProblem`

247 of 311 new or added lines in 19 files covered. (79.42%)

625 existing lines in 49 files now uncovered.

18320 of 24964 relevant lines covered (73.39%)

43106214.05 hits per line

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

12.0
/framework/field_functions/field_function.cc
1
// SPDX-FileCopyrightText: 2024 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#include "framework/field_functions/field_function.h"
5
#include "framework/logging/log_exceptions.h"
6
#include "framework/runtime.h"
7

8
namespace opensn
9
{
10

11
InputParameters
UNCOV
12
FieldFunction::GetInputParameters()
×
13
{
UNCOV
14
  InputParameters params;
×
15

16
  params.AddRequiredParameter<std::string>("name", "The field function name.");
×
UNCOV
17
  params.AddOptionalParameter(
×
18
    "unknown_type", "Scalar", "The type of the variable for this field function");
UNCOV
19
  params.AddOptionalParameter("num_components",
×
20
                              1,
21
                              "The number of components to attach to the variable. "
22
                              "This is only valid for VectorN unknowns.");
23

24
  // Constrain values
25
  params.ConstrainParameterRange(
×
26
    "unknown_type", AllowableRangeList::New({"Scalar", "Vector2", "Vector3", "VectorN"}));
×
UNCOV
27
  params.ConstrainParameterRange("num_components", AllowableRangeLowLimit::New(1));
×
28

29
  return params;
×
UNCOV
30
}
×
31

UNCOV
32
FieldFunction::FieldFunction(const InputParameters& params)
×
33
  : name_(params.GetParamValue<std::string>("name")),
×
34
    unknown_(
×
35
      (params.GetParamValue<std::string>("unknown_type") == "Scalar") ? Unknown(UnknownType::SCALAR)
×
36
      : (params.GetParamValue<std::string>("unknown_type") == "Vector2")
×
37
        ? Unknown(UnknownType::VECTOR_2)
×
38
      : (params.GetParamValue<std::string>("unknown_type") == "Vector3")
×
39
        ? Unknown(UnknownType::VECTOR_2)
×
40
      : (params.GetParamValue<std::string>("unknown_type") == "VectorN")
×
41
        ? Unknown(UnknownType::VECTOR_N, params.GetParamValue<unsigned int>("num_components"))
×
42
        : Unknown(UnknownType::SCALAR)),
43
    unknown_manager_({unknown_})
×
44
{
45
}
×
46

47
FieldFunction::FieldFunction(std::string name, Unknown unknown)
72,108✔
48
  : name_(std::move(name)), unknown_(std::move(unknown)), unknown_manager_({unknown_})
216,324✔
49
{
50
}
144,216✔
51

52
} // 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