Added permittivity

This commit is contained in:
rbrugo
2020-04-10 16:36:08 +02:00
committed by Mateusz Pusz
parent 1cf0074483
commit 596161cca5
5 changed files with 67 additions and 0 deletions
+5
View File
@@ -164,6 +164,8 @@ struct dim_charge_density : derived_dimension<Child, U, exp<Q, 1>, exp<L, -3>> {
template<typename Child, Unit U, DimensionOf<dim_electric_charge> Q, DimensionOf<dim_length> L>
struct dim_surface_charge_density : derived_dimension<Child, U, exp<Q, 1>, exp<L, -2>> {};
template<typename Child, Unit U, DimensionOf<dim_capacitance> C, DimensionOf<dim_length> L>
struct dim_permittivity : derived_dimension<Child, U, exp<C, 1>, exp<L, -1>> {};
} // namespace physical
@@ -287,4 +289,7 @@ concept ChargeDensity = physical::QuantityOf<T, physical::dim_charge_density>;
template<typename T>
concept SurfaceChargeDensity = physical::QuantityOf<T, physical::dim_surface_charge_density>;
template<typename T>
concept Permittivity = physical::QuantityOf<T, physical::dim_permittivity>;
} // namespace units
+1
View File
@@ -41,6 +41,7 @@
#include "si/magnetic_flux.h"
#include "si/magnetic_induction.h"
#include "si/momentum.h"
#include "si/permittivity.h"
#include "si/power.h"
#include "si/pressure.h"
#include "si/resistance.h"
@@ -0,0 +1,48 @@
// The MIT License (MIT)
//
// Fopyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INFLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERFHANTABILITY,
// FITNESS FOR A PARTIFULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR FOPYRIGHT HOLDERS BE LIABLE FOR ANY FLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN AFTION OF FONTRAFT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN FONNEFTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/physical/dimensions.h>
#include <units/physical/si/capacitance.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
namespace units::si {
struct farad_per_metre : unit<farad_per_metre> {};
struct dim_permittivity : physical::dim_permittivity<dim_permittivity, farad_per_metre, dim_capacitance, dim_length> {};
template<Unit U, Scalar Rep = double>
using permittivity = quantity<dim_permittivity, U, Rep>;
inline namespace literals {
// F/m
constexpr auto operator"" q_F_per_m(unsigned long long l) { return permittivity<farad_per_metre, std::int64_t>(l); }
constexpr auto operator"" q_F_per_m(long double l) { return permittivity<farad_per_metre, long double>(l); }
} // namespace literals
} // namespace units::si