BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_check_unit.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12
13#ifndef BELFEM_FN_CHECK_UNIT_HPP
14#define BELFEM_FN_CHECK_UNIT_HPP
15
16#include "typedefs.hpp"
17#include "stringtools.hpp"
18
19namespace belfem
20{
24 inline bool
25 check_unit( const value & aValue, const string & aUnit )
26 {
27 return aValue.second == unit_to_si( aUnit ).second ;
28 }
29}
30#endif //BELFEM_FN_CHECK_UNIT_HPP
USER GUIDES:
Definition cl_Capacitor.cpp:16
value unit_to_si(const string &aString)
Definition stringtools.cpp:335
std::pair< real, unit > value
Definition typedefs.hpp:74
bool check_unit(const value &aValue, const string &aUnit)
check if a value has the correct unit
Definition fn_check_unit.hpp:25