Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IPhysicalUnitConverter.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IPhysicalUnitConverter.h (C) 2000-2025 */
9/* */
10/* Interface of a unit converter. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPHYSICALUNITCONVERTER_H
13#define ARCANE_CORE_IPHYSICALUNITCONVERTER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \internal
30 * \brief Interface of a unit converter.
31 *
32 * The converter is created via IPhysicalUnitSystem::createConverter().
33 */
34class ARCANE_CORE_EXPORT IPhysicalUnitConverter
35{
36 public:
37
38 virtual ~IPhysicalUnitConverter() = default; //!< Releases resources.
39
40 public:
41
42 //! Returns the converted value of \a value.
43 virtual Real convert(Real value) = 0;
44
45 //! Returns the converted values of \a input_values in \a output_values.
46 virtual void convert(RealConstArrayView input_values,
47 RealArrayView output_values) = 0;
48
49 //! Starting unit
50 virtual IPhysicalUnit* fromUnit() = 0;
51
52 //! Target unit
53 virtual IPhysicalUnit* toUnit() = 0;
54};
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
59} // namespace Arcane
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64#endif
Declarations of Arcane's general types.
virtual void convert(RealConstArrayView input_values, RealArrayView output_values)=0
Returns the converted values of input_values in output_values.
virtual Real convert(Real value)=0
Returns the converted value of value.
virtual IPhysicalUnit * toUnit()=0
Target unit.
virtual IPhysicalUnit * fromUnit()=0
Starting unit.
virtual ~IPhysicalUnitConverter()=default
Releases resources.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
double Real
Type representing a real number.
ArrayView< Real > RealArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:459
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488