Skip to content

Commit 79fbc22

Browse files
committed
Merge remote-tracking branch 'origin2/master' into documentation
2 parents 9cb2c26 + 07b0a1e commit 79fbc22

24 files changed

+589
-257
lines changed

Doxyfile

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ STRIP_FROM_INC_PATH = gotools-core/include \
150150
qualitymodule/include \
151151
isogeometric_model/include \
152152
lrsplines2D/include \
153+
lrsplines3D/include \
153154
topology/include \
154155
viewlib/include
155156

gotools-core/include/GoTools/geometry/streamable_doxymain.h

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ g2-format:
8686
\arg \c \em CylinderVolume, entity code = 722,
8787
\arg \c \em ConeVolume, entity code = 723,
8888
\arg \c \em TorusVolume, entity code = 724
89+
\arg \c \em LRSplineVolume, entity code = 793
8990
9091
In the following the file format corresponding to most of the entities listed
9192
above will be described. Note that the g2-file format is a simple format that

gotools-core/include/GoTools/utils/gotools-doxymain.h

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ on the model
8888
\li \ref qualitymodule. A set of tools to check the quality of CAD models
8989
\li \ref isogeometric_model. A set of tools related to isogeometric analysis
9090
\li \ref lrsplines2d. LR spline surfaces
91+
\li \ref lrsplines3d. LR spline volumes
9192
9293
GoTools depends on:
9394
\li <a href="http://www.sintef.no/SISL">SISL</a> (available with

lrsplines2D/include/GoTools/lrsplines2D/LRBSpline2D.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class LRBSpline2D : public Streamable
7979
/// \param c_g coefficient
8080
/// \param weight rational weight (1 if non-rational surface)
8181
/// \param bspline_u univariate B-spline in first parameter direction
82-
/// \param bspline_v univariate B-spline in first second direction
82+
/// \param bspline_v univariate B-spline in second parameter direction
8383
/// \param gamma scaling factor
8484
/// \param rational indicates rational surface
8585
LRBSpline2D(const Point& c_g, double weight,
@@ -156,7 +156,7 @@ class LRBSpline2D : public Streamable
156156
/// Evaluate the LRBSpline2D or its derivative in (u, v), looking
157157
/// up the knot values from the arrays pointed to by 'kvals_u' and
158158
/// 'kvals_v' (the actual indices to the relevant knots are already
159-
/// stored in the LRBSpline2D). If u_deriv = n and v_deriv = m,
159+
/// stored in the associated BSplineUniLR). If u_deriv = n and v_deriv = m,
160160
/// the partial derivative d^(n+m) B / du^n dv^m will be computed. If
161161
/// the basis function is positioned at the upper boundary of the
162162
/// domain in either the u or v direction, the consideration of

lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h

+12
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,30 @@ namespace Go
6666
typedef Element2D simpleElement;
6767

6868

69+
/// Grid evaluation of the elements of an LR B-spline surface.
6970
// =============================================================================
7071
class LRSplineEvalGrid
7172
// =============================================================================
7273
{
7374
public:
7475

76+
// Constructor
7577
LRSplineEvalGrid();
7678

7779
typedef double param_float_type;
7880

7981
// LRSplineEvalGrid(int numElements);
8082

83+
/// Constructor given an LR B-spline surface
8184
LRSplineEvalGrid(LRSplineSurface& lr_spline);
8285

86+
/// Iterator to the first element of the LR B-spline surface
8387
std::vector<Element2D>::iterator elements_begin()// const
8488
{
8589
return elements_.begin();
8690
}
8791

92+
/// Iterator past the last element of the LR B-spline surface
8893
std::vector<Element2D>::iterator elements_end()// const
8994
{
9095
return elements_.end();
@@ -150,16 +155,19 @@ class LRSplineEvalGrid
150155
return 3; // If dim is 1 we use the parameter domain as the first two dimensions.
151156
}
152157

158+
/// Order (polynomial degree + 1) of the surface in the first parameter direction
153159
int orderU() const
154160
{
155161
return order_u_;
156162
}
157163

164+
/// Order (polynomial degree + 1) of the surface in the second parameter direction
158165
int orderV() const
159166
{
160167
return order_v_;
161168
}
162169

170+
/// Lower left corner of element
163171
void low(const Element2D &e, double &u, double &v)
164172
{
165173
u = e.umin();
@@ -170,6 +178,7 @@ class LRSplineEvalGrid
170178
v /= orig_dom_.vmax()-orig_dom_.vmin();
171179
}
172180

181+
/// Upper right corner of element
173182
void high(const Element2D &e, double &u, double &v)
174183
{
175184
u = e.umax();
@@ -183,6 +192,9 @@ class LRSplineEvalGrid
183192
// Copy and paste from code in r2gl.
184193
void testCoefComputation();
185194

195+
/// Compute Bezier coefficients of element based on a grid of sample points obtained
196+
/// by evaluating the surface in the element. The number of sample points depends on
197+
/// the polynomial degree
186198
inline void computeBezCoefs(int dim, const double *points, int orderU, int orderV, double *coefs)
187199
{
188200
if ((orderU != 3 && orderU != 4) || (orderV != 3 && orderV != 4)) {

lrsplines2D/include/GoTools/lrsplines2D/LRSplineMBA.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ namespace Go
6464
/// Compute distances between points stored with the surface and
6565
/// update LRSplineSurface according to data points stored in the surface elements
6666
/// using the MBA algorithm
67+
/// Parallel version
6768
/// \param srf surface to update
6869
/// \param significant_factor multiplicator for weight on significant points
6970
/// \param sgn indicates if only points with a given signed distance is
7071
/// to be included in the computations. Only for 1D surfaces
71-
/// Parallel version
7272
void MBADistAndUpdate_omp(LRSplineSurface *srf,
7373
double significant_factor = 1.0,
7474
int sgn=0);
@@ -85,11 +85,11 @@ namespace Go
8585

8686
/// Update LRSplineSurface according to data points stored in the surface elements
8787
/// using the MBA algorithm
88+
/// Parallel version
8889
/// \param srf surface to update
8990
/// \param significant_factor multiplicator for weight on significant points
9091
/// \param sgn indicates if only points with a given signed distance is
9192
/// to be included in the computations. Only for 1D surfaces
92-
/// Parallel version
9393
void MBAUpdate_omp(LRSplineSurface *srf,
9494
double significant_factor = 1.0,
9595
int sgn=0);

lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ namespace Go
250250

251251
/// Return the spline surface represented by this surface, if any
252252
/// The user may get the spline surface lying in the (refined)
253-
/// regular grid by calling the function
254-
/// expandToFullTensorProduct().
253+
/// regular grid by calling the function expandToFullTensorProduct().
255254
virtual SplineSurface* asSplineSurface();
256255

257256
// inherited from GeomObject
@@ -318,7 +317,7 @@ namespace Go
318317
/// \param upar parameter value in first parameter direction
319318
/// \param vpar parameter value in second parameter direction
320319
/// \param derivs number of derivatives to compute (0 = only point)
321-
/// Output: Partial derivatives up to order derivs (pts[0]=S(u,v),
320+
/// \param Output: Partial derivatives up to order derivs (pts[0]=S(u,v),
322321
/// pts[1]=dS/du=S_u, pts[2]=S_v, pts[3]=S_uu, pts[4]=S_uv, pts[5]=S_vv, ...)
323322
/// inherited from ParamSurface
324323
virtual void point(std::vector<Point>& pts,

lrsplines2D/src/LRSurfApprox.C

+4-4
Original file line numberDiff line numberDiff line change
@@ -799,16 +799,16 @@ void LRSurfApprox::getClassifiedPts(vector<double>& outliers, int& nmb_outliers,
799799
// Update surface
800800
if (useMBA_ || ki >= toMBA_)
801801
{
802-
#ifdef DEBUG
802+
//#ifdef DEBUG
803803
std::cout << "Using MBA" << std::endl;
804-
#endif
804+
//#endif
805805
runMBAUpdate(true);
806806
}
807807
else
808808
{
809-
#ifdef DEBUG
809+
//#ifdef DEBUG
810810
std::cout << "Using LS" << std::endl;
811-
#endif
811+
//#endif
812812
try {
813813
LSapprox.updateLocals();
814814
performSmooth(&LSapprox);

lrsplines3D/include/GoTools/lrsplines3D/Direction3D.h

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
namespace Go
2020
{
2121

22+
/// Specifies parameter direction of volume (along first (x) parameter: d = XDIR;
23+
/// along second (y) parameter: YDIR; along third (z) parameter: ZDIR)
2224
enum Direction3D {XDIR=0, YDIR=1, ZDIR=2};
2325

2426
}; // end namespace Go

lrsplines3D/include/GoTools/lrsplines3D/Element3D.h

+36-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ namespace Go {
2424
class LRBSpline3D;
2525

2626

27+
/// Storage for data points situated in this element, and accuracy information derived from
28+
/// these points with relation to the LR B-spline volume where the element belongs.
29+
/// This volume is expected to approximate the point cloud where the points
30+
/// of this element make up a sub set
2731
struct Approx3DData
2832
{
2933
Approx3DData()
@@ -196,34 +200,56 @@ struct Approx3DData
196200
};
197201

198202

203+
/// An element (or a mesh cell) in an LR B-spline volume description. The
204+
/// elements contain information about the LRBSpline3D having this element
205+
/// in its support and has the potential of storing data points corresponding
206+
/// to this element with derived accuracy information.
199207

200208

201209
class Element3D
202210
{
203211
public:
212+
/// Constructor for an empty element
204213
Element3D();
214+
/// Constructor giving element boundaries
205215
Element3D(double start_u, double start_v, double start_w, double stop_u, double stop_v, double stop_w);
216+
/// Remove a B-spline with this element in its support from the vector maintained in the element
206217
void removeSupportFunction(LRBSpline3D *f);
218+
/// Add a B-spline with this element in its support from the vector maintained in the elemen
207219
void addSupportFunction(LRBSpline3D *f);
220+
/// Split element in the given direction and value. Called from volume refinement.
208221
Element3D *split(Direction3D split_dir, double par_value);
209222
Element3D* copy();
210223
// get/set methods
224+
/// Start parameter in the first parameter direction
211225
double umin() const { return start_u_; }
226+
/// Start parameter in the second parameter direction
212227
double vmin() const { return start_v_; }
228+
/// Start parameter in the third parameter direction
213229
double wmin() const { return start_w_; }
230+
/// End parameter in the first parameter direction
214231
double umax() const { return stop_u_; }
232+
/// End parameter in the second parameter direction
215233
double vmax() const { return stop_v_; }
234+
/// End parameter in the third parameter direction
216235
double wmax() const { return stop_w_; }
236+
/// Volume of element domain
217237
double volume() const { return (stop_w_-start_w_)*(stop_v_-start_v_)*(stop_u_-start_u_); }
238+
/// Start iterator to B-splines with this element in their support
218239
std::vector<LRBSpline3D*>::iterator supportBegin() { return support_.begin(); }
240+
/// End iterator to B-splines with this element in their support
219241
std::vector<LRBSpline3D*>::iterator supportEnd() { return support_.end(); }
242+
/// Start iterator to B-splines with this element in their support
220243
std::vector<LRBSpline3D*>::const_iterator supportBegin()const { return support_.begin(); }
244+
/// End iterator to B-splines with this element in their support
221245
std::vector<LRBSpline3D*>::const_iterator supportEnd() const { return support_.end(); }
246+
/// Return a reference to the vector of B-splines with this element in their support
222247
const std::vector<LRBSpline3D*>& getSupport() const
223248
{
224249
return support_;
225250
}
226251

252+
/// Check if the parameter pair is contained in the element domain
227253
bool contains(double upar, double vpar, double wpar)
228254
{
229255
return (upar >= start_u_ && upar <= stop_u_ &&
@@ -232,13 +258,21 @@ class Element3D
232258
}
233259

234260

261+
/// Accsess one specified B-spline with this element in the support
235262
LRBSpline3D* supportFunction(int i) { return support_[i]; }
263+
/// Number of B-splines having this element in their support
236264
int nmbBasisFunctions() const { return (int)support_.size(); }
265+
/// Modify the start of the element domain in the first parameter direction
237266
void setUmin(double u) { start_u_ = u; }
267+
/// Modify the start of the element domain in the second parameter direction
238268
void setVmin(double v) { start_v_ = v; }
269+
/// Modify the start of the element domain in the third parameter direction
239270
void setWmin(double w) { start_w_ = w; }
271+
/// Modify the end of the element domain in the first parameter direction
240272
void setUmax(double u) { stop_u_ = u; }
273+
/// Modify the end of the element domain in the second parameter direction
241274
void setVmax(double v) { stop_v_ = v; }
275+
/// Modify the end of the element domain in the third parameter direction
242276
void setWmax(double w) { stop_w_ = w; }
243277

244278
bool isOverloaded() const;
@@ -424,8 +458,8 @@ class Element3D
424458
approx_data_->resetAccuracyInfo();
425459
}
426460

427-
// Update accuracy statistics in points. Number of outside
428-
// points is NOT changed
461+
/// Update accuracy statistics in points.
462+
/// Number of outside points is NOT changed
429463
void updateAccuracyInfo();
430464

431465
/// Check if the element has been modified lately

0 commit comments

Comments
 (0)