NurbsSurface.cc File Reference
#include <array>
#include "NurbsSurface.h"
#include "NurbsUtils.h"
#include "Logger.h"
#include "Math/ExtendedMath.h"

Functions

std::ostream & operator<< (std::ostream &os, const NurbsSurface &a)
 
std::istream & operator>> (std::istream &is, NurbsSurface &a)
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const NurbsSurface a 
)

Adds all elements of the vector to an output stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in]osthe output stream,
[in]aThe vector of interest
Returns
the output stream with vector elements added
356 {
357  os << "mu " << a.knotsU_.size() << ' ';
358  os << "mv " << a.knotsV_.size() << ' ';
359  os << "nu " << a.controlPoints_.size() << ' ';
360  os << "nv " << a.controlPoints_[0].size() << ' ';
361  os << "knotsU ";
362  for (const auto k : a.knotsU_) os << k << ' ';
363  os << "knotsV ";
364  for (const auto k : a.knotsV_) os << k << ' ';
365  os << "controlPoints ";
366  for (const auto& cp0 : a.controlPoints_) for (const auto cp : cp0) os << cp << ' ';
367  os << "weights ";
368  for (const auto& w0 : a.weights_) for (const auto w : w0) os << w << ' ';
369  os << "closedInUV " << a.closedInU_ << ' ' << a.closedInV_;
370  os << " periodicInUV " << a.periodicInU_ << ' ' << a.periodicInV_;
371  return os;
372 }
RowVector3d w
Definition: Matrix_resize_int.cpp:3
const Scalar * a
Definition: level2_cplx_impl.h:32
char char char int int * k
Definition: level2_impl.h:374

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
NurbsSurface a 
)

Reads all elements of a given vector from an input stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in,out]isthe input stream
[in,out]athe vector to be read in
Returns
the input stream from which the vector elements were read
382 {
383  std::string dummy;
384  unsigned mu, mv, nu, nv;
385  is >> dummy >> mu;
386  is >> dummy >> mv;
387  is >> dummy >> nu;
388  is >> dummy >> nv;
389 
390  is >> dummy;
391  std::vector<double> knotsU;
392  knotsU.resize(mu);
393  for (auto& k : knotsU) is >> k;
394 
395  is >> dummy;
396  std::vector<double> knotsV;
397  knotsV.resize(mv);
398  for (auto& k : knotsV) is >> k;
399 
400  is >> dummy;
401  std::vector<std::vector<Vec3D>> controlPoints;
402  controlPoints.resize(nu);
403  for (auto& cp0 : controlPoints) {
404  cp0.resize(nv);
405  for (auto& cp : cp0) is >> cp;
406  }
407 
408  is >> dummy;
409  std::vector<std::vector<double>> weights;
410  weights.resize(nu);
411  for (auto& w0 : weights) {
412  w0.resize(nv);
413  for (auto& w : w0) is >> w;
414  }
415 
416  a.set(knotsU,knotsV,controlPoints,weights);
417 
418  // After setting, since in that method the defaults are set to false.
419  // Also, check if dummy variable exist, for backwards compatibility.
420  is >> dummy;
421  if (dummy == "closedInUV")
422  {
423  is >> a.closedInU_;
424  is >> a.closedInV_;
425  }
426  is >> dummy;
427  if (dummy == "periodicInUV")
428  {
429  is >> a.periodicInU_;
430  is >> a.periodicInV_;
431  }
432 
433  return is;
434 }
std::complex< double > mu
Definition: time_harmonic_fourier_decomposed_linear_elasticity/cylinder/cylinder.cc:52
list weights
Definition: calibrate.py:94
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286