Exemple #1
0
LagrangeField3D::LagrangeField3D (const ASMs3DLag* patch,
                                  const RealArray& v,
                                  char basis,
				  const char* name) : FieldBase(name)
{
  patch->getNodalCoordinates(coord);
  patch->getSize(n1,n2,n3);
  patch->getOrder(p1,p2,p3);
  nno = n1*n2*n3;
  nelm = (n1-1)*(n2-1)*(n3-1)/(p1*p2*p3);

  // Ensure the values array has compatible length, pad with zeros if necessary
  values.resize(nno);
  RealArray::const_iterator end = v.size() > nno ? v.begin()+nno : v.end();
  std::copy(v.begin(),end,values.begin());
}
Exemple #2
0
SplineField2D::SplineField2D (const ASMs2D* patch,
                              const RealArray& v, char nbasis,
                              const char* name)
  : FieldBase(name), basis(patch->getBasis(nbasis)), surf(patch->getSurface())
{
  const int n1 = basis->numCoefs_u();
  const int n2 = basis->numCoefs_v();
  nno = n1*n2;

  const int p1 = basis->order_u();
  const int p2 = basis->order_v();
  nelm = (n1-p1+1)*(n2-p2+1);

  // Ensure the values array has compatible length, pad with zeros if necessary
  values.resize(nno);
  RealArray::const_iterator end = v.size() > nno ? v.begin()+nno : v.end();
  std::copy(v.begin(),end,values.begin());
}