https://mooseframework.inl.gov
Loading...
Searching...
No Matches
BSpline.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
13#include "libmesh/point.h"
14#include <vector>
15
16namespace Moose
17{
26{
27public:
28 BSpline(const unsigned int degree,
29 const libMesh::Point & start_point,
30 const libMesh::Point & end_point,
31 const libMesh::RealVectorValue & start_direction,
32 const libMesh::RealVectorValue & end_direction,
33 const unsigned int cps_per_half,
34 const libMesh::Real sharpness,
35 const std::string & caller_name);
36
44
45private:
49 std::vector<libMesh::Real> buildKnotVector() const;
50
54 std::vector<libMesh::Point> createControlPoints() const;
55
65 libMesh::Real CdBBasis(const libMesh::Real t, const unsigned int i, const unsigned int j) const;
66
73 libMesh::Real firstCoeff(const libMesh::Real t, const unsigned int i, const unsigned int j) const;
74
82 secondCoeff(const libMesh::Real t, const unsigned int i, const unsigned int j) const;
83
85 const unsigned int _degree;
95 const unsigned int _cps_per_half;
100 const std::string _caller_name;
102 const std::vector<libMesh::Point> _control_points;
106 const std::vector<libMesh::Real> _knot_vector;
107};
108}
Class implementing a uniform clamped B-Spline curve.
Definition BSpline.h:26
const unsigned int _degree
The polynomial degree of the B-Spline.
Definition BSpline.h:85
libMesh::Real CdBBasis(const libMesh::Real t, const unsigned int i, const unsigned int j) const
Evaluates the the basis function for a B-Spline according to the Cox-de-Boor recursive formula.
Definition BSpline.C:102
libMesh::Point getPoint(const libMesh::Real t) const
Evaluate the BSpline interpolation at given value of t.
Definition BSpline.C:40
const std::vector< libMesh::Real > _knot_vector
The knot vector.
Definition BSpline.h:106
const libMesh::Real _sharpness
sharpness of the curve
Definition BSpline.h:97
libMesh::Real secondCoeff(const libMesh::Real t, const unsigned int i, const unsigned int j) const
Submethod used in CdBBasis routine.
Definition BSpline.C:128
const std::vector< libMesh::Point > _control_points
The control points.
Definition BSpline.h:102
const libMesh::Point _start_point
starting point of spline
Definition BSpline.h:87
const std::string _caller_name
Name of the object working with this class, used for error reporting.
Definition BSpline.h:100
const libMesh::Point _end_point
ending point of spline
Definition BSpline.h:89
libMesh::Real firstCoeff(const libMesh::Real t, const unsigned int i, const unsigned int j) const
Submethod used in CdBBasis routine.
Definition BSpline.C:116
const libMesh::RealVectorValue _end_dir
ending direction of spline
Definition BSpline.h:93
std::vector< libMesh::Real > buildKnotVector() const
Internal method for building the knot vector given the degree and control points.
Definition BSpline.C:63
const unsigned int _cps_per_half
number of control points per half of the spline (vertex is auto-included)
Definition BSpline.h:95
const libMesh::RealVectorValue _start_dir
starting direction of spline
Definition BSpline.h:91
std::vector< libMesh::Point > createControlPoints() const
Creates a vector control points from the SplineUtils set of functions.
Definition BSpline.C:53
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real