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

openmc-dev / openmc / 23916574395

02 Apr 2026 06:50PM UTC coverage: 81.336% (+0.01%) from 81.324%
23916574395

Pull #3734

github

web-flow
Merge 3420117d8 into d9b30bbbd
Pull Request #3734: Specify temperature from a field (structured mesh only)

17720 of 25601 branches covered (69.22%)

Branch coverage included in aggregate %.

183 of 204 new or added lines in 15 files covered. (89.71%)

69 existing lines in 3 files now uncovered.

58284 of 67843 relevant lines covered (85.91%)

44753955.49 hits per line

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

92.31
/openmc/field.py
1
from abc import ABC, abstractmethod
11✔
2

3
import openmc
11✔
4

5

6
class ScalarField(ABC):
11✔
7
    """Scalar field defined on a geometric mesh.
8

9
    Attributes
10
    ----------
11
    mesh : Mesh
12
        Spatial mesh associated with the field
13
    values : iterable of float
14
        List of values associated with each mesh cell
15

16
    """
17
    def __init__(self, mesh, values):
11✔
18
        """Initialization.
19

20
        Parameters
21
        ----------
22
        mesh : Mesh
23
            Spatial mesh associated with the field
24
        values : iterable of float
25
            List of values associated with each mesh cell
26

27
        """
28
        self.mesh = mesh
11✔
29
        self.values = values
11✔
30

31
    def __eq__(self, other):
11✔
32
        if not isinstance(other, ScalarField):
11✔
NEW
33
            return NotImplementedError()
×
34
        return self.mesh.id == other.mesh.id and self.values == other.values
11✔
35

36

37
class TemperatureField(ScalarField):
11✔
38
    """Temperature field.
39

40
    Attributes
41
    ----------
42
    mesh : Mesh
43
        Spatial mesh associated with the field
44
    values : iterable of float
45
        List of values associated with each mesh cell
46

47
    """
48
    def __init__(self, mesh, values):
11✔
49
        """Initialization.
50

51
        Parameters
52
        ----------
53
        mesh : Mesh
54
            Spatial mesh associated with the field
55
        values : iterable of float
56
            List of values associated with each mesh cell
57

58
        """
59
        super().__init__(mesh, values)
11✔
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