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

Open-Sn / opensn / 16821314466

07 Aug 2025 04:57PM UTC coverage: 74.527% (+1.0%) from 73.488%
16821314466

push

github

web-flow
Merge pull request #708 from wdhawkins/curvilinear_warning

Adding experimental warning to curvilinear solver

3 of 3 new or added lines in 1 file covered. (100.0%)

250 existing lines in 17 files now uncovered.

17543 of 23539 relevant lines covered (74.53%)

44793362.81 hits per line

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

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

4
#include "framework/object_factory.h"
5
#include "framework/runtime.h"
6
#include "framework/logging/log.h"
7

8
namespace opensn
9
{
10

11
ObjectFactory&
12
ObjectFactory::GetInstance() noexcept
12,345✔
13
{
14
  static ObjectFactory singleton;
12,345✔
15
  return singleton;
12,345✔
16
}
17

18
const std::map<std::string, ObjectFactory::ObjectRegistryEntry>&
19
ObjectFactory::GetRegistry() const
×
20
{
21
  return object_registry_;
×
22
}
23

24
bool
25
ObjectFactory::RegistryHasKey(const std::string& key) const
10,287✔
26
{
27
  return object_registry_.count(key) > 0;
10,287✔
28
}
29

30
InputParameters
UNCOV
31
ObjectFactory::GetRegisteredObjectParameters(const std::string& type) const
×
32
{
UNCOV
33
  auto iter = object_registry_.find(type);
×
UNCOV
34
  OpenSnInvalidArgumentIf(iter == object_registry_.end(),
×
35
                          "Object type \"" + type + "\" is not registered in ObjectFactory.");
36

UNCOV
37
  auto& reg_entry = iter->second;
×
38

UNCOV
39
  return reg_entry.get_in_params_func();
×
40
}
41

42
void
43
ObjectFactory::DumpRegister() const
×
44
{
45
  log.Log() << "\n\n";
×
46
  for (const auto& [key, entry] : object_registry_)
×
47
  {
48
    if (log.GetVerbosity() == 0)
×
49
    {
50
      log.Log() << key;
×
51
      continue;
×
52
    }
53

54
    log.Log() << "OBJECT_BEGIN " << key;
×
55

56
    if (entry.get_in_params_func == nullptr)
×
57
      log.Log() << "NOT_CONSTRUCTIBLE";
×
58
    else
59
    {
60
      const auto in_params = entry.get_in_params_func();
×
61
      in_params.DumpParameters();
×
62
    }
×
63

64
    log.Log() << "OBJECT_END\n\n";
×
65
  }
66
  log.Log() << "\n\n";
×
67
}
×
68

69
void
70
ObjectFactory::AssertRegistryKeyAvailable(const std::string& key,
10,287✔
71
                                          const std::string& calling_function) const
72
{
73
  if (RegistryHasKey(key))
10,287✔
74
    OpenSnLogicalError(calling_function + ": Attempted to register Object \"" + key +
×
75
                       "\" but an object with the same name is already registered.");
76
}
10,287✔
77

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