feat(geometry/surface): System for prescripting surface condition and building computational node for surface condition
The surface needs some defined condition (e.g. Isobaric) This module defines how the surface is defined. Again, much like the deformation system this does not actually implement much of the code to deform the surface to that condition; rather, it implements code to allow the prescription to be described robustly at compile time
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include <cmath>
|
||||
#include <stdexcept>
|
||||
#include <array>
|
||||
|
||||
#include "serif/geometry/surface/isobaric.hpp"
|
||||
#include "serif/utils/error/errors.hpp"
|
||||
|
||||
namespace serif::geometry::surface {
|
||||
using namespace utils::errors;
|
||||
|
||||
IsobaricSurface::IsobaricSurface(const Parameters parameters) : IsobaricSurface(parameters.PSurf) {}
|
||||
|
||||
IsobaricSurface::IsobaricSurface(const TargetValue targetPressure) : m_targetPressure(targetPressure) {
|
||||
serif_ensure<SERiFErrorCode::NON_FINITE_VALUE_ERROR, std::invalid_argument>(std::isfinite(targetPressure.value()), "The target surface pressure must be finite, got {}", targetPressure.value());
|
||||
serif_ensure<SERiFErrorCode::NEGATIVE_VALUE_ERROR, std::invalid_argument>(targetPressure.value() >= 0, "The target surface pressure must be non-negative, got {}", targetPressure.value());
|
||||
}
|
||||
|
||||
IsobaricSurface::TargetValue IsobaricSurface::target_pressure() const noexcept {
|
||||
return m_targetPressure;
|
||||
}
|
||||
|
||||
std::array<double, 1> IsobaricSurface::continuation_identity() const noexcept {
|
||||
return {m_targetPressure.value()};
|
||||
}
|
||||
|
||||
PressureSurfaceDescriptor IsobaricSurface::descriptor() const noexcept {
|
||||
return PressureSurfaceDescriptor{
|
||||
.target_pressure = m_targetPressure.value()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user