Loading [MathJax]/extensions/tex2jax.js
OGS
MathLib::WeightedPoint Class Reference

Detailed Description

Represents a point of a certain dimension that has a weight attached.

Used, e.g., in numerical quadrature.

Definition at line 21 of file WeightedPoint.h.

#include <WeightedPoint.h>

Public Member Functions

template<std::size_t dim>
constexpr WeightedPoint (std::array< double, dim > const &coords, double const weight)
 
constexpr WeightedPoint (double const weight)
 Constructs a 0D weighted point.
 
constexpr bool operator== (WeightedPoint const &other) const
 
constexpr bool operator!= (WeightedPoint const &other) const
 
constexpr const double * data () const
 
constexpr double getWeight () const
 
constexpr std::size_t getDimension () const
 The point dimension, i.e., the number of its coordinates.
 
constexpr double operator[] (std::size_t coord_idx) const
 Access a specific coordinate.
 

Private Attributes

double weight_
 
std::array< double, 3 > coords_
 
std::size_t dim_
 

Constructor & Destructor Documentation

◆ WeightedPoint() [1/2]

template<std::size_t dim>
MathLib::WeightedPoint::WeightedPoint ( std::array< double, dim > const & coords,
double const weight )
inlineconstexpr

Constructs a 0...3D weighted point depending on the passed coordinates array.

Definition at line 27 of file WeightedPoint.h.

29 : weight_{weight}, dim_{dim}
30 {
31 static_assert(dim <= 3);
32 std::size_t i = 0;
33 if constexpr (dim > 0) // avoids compiler warning
34 {
35 for (; i < dim; ++i)
36 {
37 coords_[i] = coords[i];
38 }
39 }
40 for (; i < 3; ++i)
41 {
42 // fill the rest with NaN for safety reasons
43 coords_[i] = std::numeric_limits<double>::quiet_NaN();
44 }
45 }
std::array< double, 3 > coords_
constexpr ranges::views::view_closure coords
Definition Mesh.h:234

References coords_.

◆ WeightedPoint() [2/2]

MathLib::WeightedPoint::WeightedPoint ( double const weight)
inlineexplicitconstexpr

Constructs a 0D weighted point.

Definition at line 48 of file WeightedPoint.h.

49 : weight_{weight}, dim_{0}
50 {
51 // fill with NaN for safety reasons
52 coords_.fill(std::numeric_limits<double>::quiet_NaN());
53 }

References coords_.

Member Function Documentation

◆ data()

const double * MathLib::WeightedPoint::data ( ) const
inlineconstexpr

Definition at line 80 of file WeightedPoint.h.

80{ return coords_.data(); }

References coords_.

◆ getDimension()

std::size_t MathLib::WeightedPoint::getDimension ( ) const
inlineconstexpr

The point dimension, i.e., the number of its coordinates.

Definition at line 85 of file WeightedPoint.h.

85{ return dim_; }

References dim_.

Referenced by MeshLib::getBulkElementPoint(), and MathLib::operator<<().

◆ getWeight()

double MathLib::WeightedPoint::getWeight ( ) const
inlineconstexpr

Definition at line 82 of file WeightedPoint.h.

82{ return weight_; }

References weight_.

Referenced by ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::HeatTransportBHELocalAssemblerSoil(), ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::HMPhaseFieldLocalAssembler(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::HTFEM(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::LargeDeformationLocalAssembler(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::LiquidFlowLocalAssembler(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::LocalAssemblerData(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::PhaseFieldLocalAssembler(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::TH2MLocalAssembler(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::ThermalTwoPhaseFlowWithPPLocalAssembler(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::ThermoRichardsMechanicsLocalAssembler(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::TwoPhaseFlowWithPPLocalAssembler(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoLocalAssembler< ShapeFunction, GlobalDim >::TwoPhaseFlowWithPrhoLocalAssembler(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::VolumetricSourceTermLocalAssembler(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::WellboreSimulatorFEM(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::initNsAndWeights(), and MathLib::operator<<().

◆ operator!=()

bool MathLib::WeightedPoint::operator!= ( WeightedPoint const & other) const
inlineconstexpr

Definition at line 75 of file WeightedPoint.h.

76 {
77 return !(*this == other);
78 }

◆ operator==()

bool MathLib::WeightedPoint::operator== ( WeightedPoint const & other) const
inlineconstexpr

Definition at line 55 of file WeightedPoint.h.

56 {
57 if (weight_ != other.weight_)
58 {
59 return false;
60 }
61 if (dim_ != other.dim_)
62 {
63 return false;
64 }
65 for (std::size_t comp = 0; comp < dim_; ++comp)
66 {
67 if (coords_[comp] != other.coords_[comp])
68 {
69 return false;
70 }
71 }
72 return true;
73 }

References coords_, dim_, and weight_.

◆ operator[]()

double MathLib::WeightedPoint::operator[] ( std::size_t coord_idx) const
inlineconstexpr

Access a specific coordinate.

Definition at line 88 of file WeightedPoint.h.

89 {
90 return coords_[coord_idx];
91 }

References coords_.

Member Data Documentation

◆ coords_

std::array<double, 3> MathLib::WeightedPoint::coords_
private

Definition at line 95 of file WeightedPoint.h.

Referenced by WeightedPoint(), WeightedPoint(), data(), operator==(), and operator[]().

◆ dim_

std::size_t MathLib::WeightedPoint::dim_
private

Definition at line 96 of file WeightedPoint.h.

Referenced by getDimension(), and operator==().

◆ weight_

double MathLib::WeightedPoint::weight_
private

Definition at line 94 of file WeightedPoint.h.

Referenced by getWeight(), and operator==().


The documentation for this class was generated from the following file: