36#include <boost/algorithm/string.hpp>
87 m_SmoothAdvection(false)
97 std::string velids[] = {
"u",
"v",
"w"};
104 for (j = 0; j < numfields; ++j)
107 if (boost::iequals(velids[i], var))
113 ASSERTL0(j != numfields,
"Failed to find field: " + var);
133 std::string vConvectiveType;
138 vConvectiveType =
"NoAdvection";
142 vConvectiveType =
"Convective";
145 vConvectiveType =
"Linearised";
152 if (
m_session->DefinesTag(
"AdvectiveType") &&
156 vConvectiveType =
m_session->GetTag(
"AdvectiveType");
161 vConvectiveType, vConvectiveType);
185 for (
size_t i = 0; i <
m_fields.size(); ++i)
193 BndConds =
m_fields[i]->GetBndConditions();
194 BndExp =
m_fields[i]->GetBndCondExpansions();
195 for (
size_t n = 0; n < BndConds.size(); ++n)
197 if (boost::iequals(BndConds[n]->GetUserDefined(),
"Radiation"))
200 BndConds[n]->GetBoundaryConditionType() ==
202 "Radiation boundary condition must be of type Robin <R>");
210 radpts += BndExp[n]->GetTotPoints();
212 if (boost::iequals(BndConds[n]->GetUserDefined(),
213 "ZeroNormalComponent"))
215 ASSERTL0(BndConds[n]->GetBoundaryConditionType() ==
217 "Zero Normal Component boundary condition option must "
218 "be of type Dirichlet <D>");
233 for (
size_t n = 0; n < BndConds.size(); ++n)
235 if (boost::iequals(BndConds[n]->GetUserDefined(),
"Radiation"))
238 int npoints = BndExp[n]->GetNpoints();
244 BndExp[n]->GetCoords(x0, x1, x2);
247 std::static_pointer_cast<
249 ->m_robinPrimitiveCoeff;
261 for (
size_t i = 0; i <
m_fields.size(); ++i)
263 for (
size_t n = 0; n <
m_fields[i]->GetBndConditions().size(); ++n)
265 if (boost::istarts_with(
266 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
277 i, n,
m_fields[i]->GetBndConditions()[n]->GetUserDefined());
288 for (
size_t n = 0; n <
m_fields[0]->GetBndConditions().size(); ++n)
291 for (
size_t i = 0; i <
m_velocity.size(); ++i)
294 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
299 for (
size_t j = 0; j <
m_velocity.size(); ++j)
302 ->GetBndConditions()[n]
303 ->GetBoundaryConditionType() ==
305 "All velocities with userdefined tag: "
306 "\"MovingFrameWall\" must be Dirichlet boundary "
309 ->GetBndConditions()[n]
312 "If any of the velocity components at a "
313 "boundary is defined as \"MovingFrameWall\", "
314 "the rest of velocity components are also "
315 "must be defined as \"MovingFrameWall\" ");
320 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
321 "MovingFrameDomainVel"))
325 for (
size_t j = 0; j <
m_velocity.size(); ++j)
329 ->GetBndConditions()[n]
330 ->GetBoundaryConditionType() ==
332 "All velocities with userdefined tag: "
333 "\"MovingFrameDomainVel\" must be Dirichlet boundary "
336 ->GetBndConditions()[n]
338 "MovingFrameDomainVel"),
339 "If any of the velocity components at a "
340 "boundary is defined as \"MovingFrameDomainVel\", "
341 "the rest of velocity components are also "
342 "must be defined as \"MovingFrameDomainVel\" ");
358 std::vector<std::string> vSuffix = {
"_x",
"_y",
"_z"};
359 for (
size_t i = 0; i < 3; ++i)
362 std::string sTheta =
"Theta" + vSuffix[i];
366 dTheta = boost::lexical_cast<NekDouble>(it->second);
378 std::vector<std::string> vSuffix = {
"_x",
"_y",
"_z"};
379 for (
size_t i = 0; i < 3; ++i)
381 std::string sTheta =
"Theta" + vSuffix[i];
406 size_t npoints =
m_fields[0]->GetNpoints();
407 for (
size_t i = 0; i < VelDim; ++i)
414 x->PreApply(
m_fields, velocity, velocity, time);
428 size_t nvariables =
m_fields.size();
430 for (i = 0; i < nvariables; ++i)
432 for (n = 0; n <
m_fields[i]->GetBndConditions().size(); ++n)
434 if (
m_fields[i]->GetBndConditions()[n]->IsTimeDependent())
437 m_fields[i]->EvaluateBoundaryConditions(time, varName);
439 else if (boost::istarts_with(
440 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
467 BndConds =
m_fields[fieldid]->GetBndConditions();
468 BndExp =
m_fields[fieldid]->GetBndCondExpansions();
474 size_t elmtid, nq, offset, boundary;
478 for (cnt = n = 0; n < BndConds.size(); ++n)
480 std::string type = BndConds[n]->GetUserDefined();
482 if ((BndConds[n]->GetBoundaryConditionType() ==
484 (boost::iequals(type,
"Radiation")))
486 size_t nExp = BndExp[n]->GetExpSize();
487 for (i = 0; i < nExp; ++i, cnt++)
490 elmt =
m_fields[fieldid]->GetExp(elmtid);
491 offset =
m_fields[fieldid]->GetPhys_Offset(elmtid);
493 U =
m_fields[fieldid]->UpdatePhys() + offset;
494 Bc = BndExp[n]->GetExp(i);
499 nq = Bc->GetTotPoints();
501 elmt->GetTracePhysVals(boundary, Bc, U, ubc);
506 1, &ubc[0], 1, &ubc[0], 1);
509 BndExp[n]->UpdateCoeffs() + BndExp[n]->GetCoeff_Offset(i);
511 Bc->IProductWRTBase(ubc, Bvals);
513 cnt1 += BndExp[n]->GetTotPoints();
517 cnt += BndExp[n]->GetExpSize();
526 static bool Setup =
false;
549 size_t elmtid, nq, boundary;
556 for (cnt = n = 0; n < BndConds[0].size(); ++n)
558 if ((BndConds[0][n]->GetBoundaryConditionType() ==
560 (boost::iequals(BndConds[0][n]->GetUserDefined(),
561 "ZeroNormalComponent")))
563 size_t nExp = BndExp[0][n]->GetExpSize();
564 for (i = 0; i < nExp; ++i, cnt++)
570 normals = elmt->GetTraceNormal(boundary);
572 nq = BndExp[0][n]->GetExp(i)->GetTotPoints();
577 Bphys = BndExp[k][n]->UpdatePhys() +
578 BndExp[k][n]->GetPhys_Offset(i);
579 Bc = BndExp[k][n]->GetExp(i);
589 Bphys = BndExp[k][n]->UpdatePhys() +
590 BndExp[k][n]->GetPhys_Offset(i);
591 Bcoeffs = BndExp[k][n]->UpdateCoeffs() +
592 BndExp[k][n]->GetCoeff_Offset(i);
593 Bc = BndExp[k][n]->GetExp(i);
594 Vmath::Vvtvp(nq, normvel, 1, normals[k], 1, Bphys, 1, Bphys,
596 Bc->FwdTransBndConstrained(Bphys, Bcoeffs);
602 cnt += BndExp[0][n]->GetExpSize();
613 "Womersley parameters for this boundary have not been set up");
619 size_t M_coeffs = WomParam->m_wom_vel.size();
622 NekDouble axis_normal = WomParam->m_axisnormal[fldid];
632 BndCondExp =
m_fields[fldid]->GetBndCondExpansions()[bndid];
638 size_t exp_npts = BndCondExp->GetExpSize();
644 for (k = 1; k < M_coeffs; k++)
647 zt[k] = std::exp(zi * omega_c * k_c * m_time_c);
651 for (i = 0; i < exp_npts; ++i, cnt++)
654 bc = BndCondExp->GetExp(i);
655 nfq = bc->GetTotPoints();
659 for (j = 0; j < nfq; j++)
661 wbc[j] = WomParam->m_poiseuille[i][j];
662 for (k = 1; k < M_coeffs; k++)
664 zvel = WomParam->m_zvel[i][j][k] * zt[k];
665 wbc[j] = wbc[j] + zvel.real();
672 Bvals = BndCondExp->UpdateCoeffs() + BndCondExp->GetCoeff_Offset(i);
675 bc->FwdTrans(wbc, Bvals);
682 std::string::size_type indxBeg = womStr.find_first_of(
':') + 1;
683 string filename = womStr.substr(indxBeg, string::npos);
685 TiXmlDocument doc(filename);
687 bool loadOkay = doc.LoadFile();
689 (std::string(
"Failed to load file: ") + filename).c_str());
691 TiXmlHandle docHandle(&doc);
695 TiXmlElement *nektar = doc.FirstChildElement(
"NEKTAR");
696 ASSERTL0(nektar,
"Unable to find NEKTAR tag in file.");
698 TiXmlElement *wombc = nektar->FirstChildElement(
"WOMERSLEYBC");
699 ASSERTL0(wombc,
"Unable to find WOMERSLEYBC tag in file.");
702 TiXmlElement *womparam = wombc->FirstChildElement(
"WOMPARAMS");
703 ASSERTL0(womparam,
"Unable to find WOMPARAMS tag in file.");
706 TiXmlElement *params = womparam->FirstChildElement(
"W");
707 map<std::string, std::string> Wparams;
714 propstr = params->Attribute(
"PROPERTY");
717 "Failed to read PROPERTY value Womersley BC Parameter");
720 valstr = params->Attribute(
"VALUE");
723 "Failed to read VALUE value Womersley BC Parameter");
725 std::transform(propstr.begin(), propstr.end(), propstr.begin(),
727 Wparams[propstr] = valstr;
729 params = params->NextSiblingElement(
"W");
736 Wparams.count(
"RADIUS") == 1,
737 "Failed to find Radius parameter in Womersley boundary conditions");
738 std::vector<NekDouble>
rad;
743 Wparams.count(
"PERIOD") == 1,
744 "Failed to find period parameter in Womersley boundary conditions");
745 std::vector<NekDouble> period;
750 Wparams.count(
"AXISNORMAL") == 1,
751 "Failed to find axisnormal parameter in Womersley boundary conditions");
752 std::vector<NekDouble> anorm;
759 Wparams.count(
"AXISPOINT") == 1,
760 "Failed to find axispoint parameter in Womersley boundary conditions");
761 std::vector<NekDouble> apt;
770 TiXmlElement *coeff = wombc->FirstChildElement(
"FOURIERCOEFFS");
773 TiXmlElement *fval = coeff->FirstChildElement(
"F");
776 int nextFourierCoeff = -1;
782 TiXmlAttribute *fvalAttr = fval->FirstAttribute();
783 std::string attrName(fvalAttr->Name());
786 (std::string(
"Unknown attribute name: ") + attrName).c_str());
788 err = fvalAttr->QueryIntValue(&indx);
789 ASSERTL0(err == TIXML_SUCCESS,
"Unable to read attribute ID.");
791 std::string coeffStr = fval->FirstChild()->ToText()->ValueStr();
792 vector<NekDouble> coeffvals;
797 (std::string(
"Problem reading value of fourier coefficient, ID=") +
798 boost::lexical_cast<string>(indx))
801 coeffvals.size() == 2,
803 "Have not read two entries of Fourier coefficicent from ID=" +
804 boost::lexical_cast<string>(indx))
810 fval = fval->NextSiblingElement(
"F");
829 BndCondExp =
m_fields[fldid]->GetBndCondExpansions()[bndid];
836 size_t exp_npts = BndCondExp->GetExpSize();
850 for (k = 1; k < M_coeffs; k++)
853 lamda_n[k] = i_pow_3q2 * alpha_c *
sqrt(k_c[k]);
858 for (i = 0; i < exp_npts; ++i, cnt++)
861 bc = BndCondExp->GetExp(i);
862 nfq = bc->GetTotPoints();
867 bc->GetCoords(x, y,
z);
875 for (j = 0; j < nfq; j++)
878 (y[j] - x0[1]) * (y[j] - x0[1]) +
879 (
z[j] - x0[2]) * (
z[j] - x0[2])) /
886 (1. - rqR.real() * rqR.real());
892 for (k = 1; k < M_coeffs; k++)
897 (z1 - (zJ0r / zJ0[k]));
917 boost::ignore_unused(time);
938 for (
size_t n = 0; n < BndExp[0].size(); ++n)
940 if (BndConds[0][n]->GetBoundaryConditionType() ==
942 (boost::iequals(BndConds[0][n]->GetUserDefined(),
945 npoints = BndExp[0][n]->GetNpoints();
952 for (
size_t k = 0; k <
m_velocity.size(); ++k)
958 for (
size_t k = 0; k < 3; ++k)
962 BndExp[0][n]->GetCoords(coords[0], coords[1], coords[2]);
991 velocities[0], 1, velocities[0], 1);
994 1, velocities[1], 1, velocities[1], 1);
1012 Vmath::Vmul(npoints, unitArray[k], 1, velocities[k], 1,
1013 BndExp[k][n]->UpdatePhys(), 1);
1020 BndExp[k][n]->SetWaveSpace(
false);
1022 BndExp[k][n]->FwdTransBndConstrained(
1023 BndExp[k][n]->GetPhys(), BndExp[k][n]->UpdateCoeffs());
1058 for (
size_t n = 0; n < BndExp[0].size(); ++n)
1060 if (BndConds[0][n]->GetBoundaryConditionType() ==
1062 (boost::iequals(BndConds[0][n]->GetUserDefined(),
1063 "MovingFrameDomainVel")))
1065 npoints = BndExp[0][n]->GetNpoints();
1066 for (
size_t k = 0; k <
m_velocity.size(); ++k)
1073 for (
size_t k = 0; k < 3; ++k)
1077 BndExp[0][n]->GetCoords(coords[0], coords[1], coords[2]);
1081 for (
size_t k = 0; k <
m_velocity.size(); ++k)
1084 std::static_pointer_cast<
1087 ->m_dirichletCondition;
1089 condition.
Evaluate(coords[0], coords[1], coords[2], time,
1103 tmp0 = definedVels[m], 1, tmp1 = velocities[l],
1104 1, tmp2 = velocities[l], 1);
1111 Vmath::Vmul(npoints, unitArray[k], 1, velocities[k], 1,
1112 BndExp[k][n]->UpdatePhys(), 1);
1119 BndExp[k][n]->SetWaveSpace(
false);
1121 BndExp[k][n]->FwdTransBndConstrained(
1122 BndExp[k][n]->GetPhys(), BndExp[k][n]->UpdateCoeffs());
1142 boost::ignore_unused(SpeedSoundFactor);
1144 size_t nelmt =
m_fields[0]->GetExpSize();
1153 for (
size_t i = 0; i < 2; ++i)
1162 for (
size_t i = 0; i < nvel; ++i)
1190 int nPts = physfield[0].size();
1203 velocity[i] = physfield[i];
1217 "Arrays have different dimensions, cannot set moving frame "
1226 "Arrays have different dimensions, cannot get moving frame "
1239 const bnu::matrix<NekDouble> &vProjMat)
1242 "Matrices have different numbers of rows, cannot Set the "
1243 "moving frame projection matrix");
1245 "Matrices have different numbers of columns, cannot Set the "
1246 "moving frame projection matrix");
1247 for (
size_t i = 0; i < vProjMat.size1(); ++i)
1249 for (
size_t j = 0; j < vProjMat.size2(); ++j)
1257 bnu::matrix<NekDouble> &vProjMat)
1260 "Matrices have different numbers of rows, cannot Get the "
1261 "moving frame projection matrix");
1263 "Matrices have different numbers of columns, cannot Get the "
1264 "moving frame projection matrix");
1266 for (
size_t i = 0; i < vProjMat.size1(); ++i)
1268 for (
size_t j = 0; j < vProjMat.size2(); ++j)
1283 "Arrays have different size, cannot set moving frame angles");
1284 for (
size_t i = 0; i < vFrameTheta.size(); ++i)
1298 "Arrays have different size, cannot get moving frame angles");
1310 vector<std::string> vForceList;
1311 bool hasForce{
false};
1313 if (!
m_session->DefinesElement(
"Nektar/Forcing"))
1318 TiXmlElement *vForcing =
m_session->GetElement(
"Nektar/Forcing");
1321 TiXmlElement *vForce = vForcing->FirstChildElement(
"FORCE");
1324 string vType = vForce->Attribute(
"TYPE");
1326 vForceList.push_back(vType);
1327 vForce = vForce->NextSiblingElement(
"FORCE");
1331 for (
auto &f : vForceList)
1333 if (boost::iequals(f, sForce))
1347 std::string sMRFForcingType =
"MovingReferenceFrame";
1355 TiXmlElement *vForcing =
m_session->GetElement(
"Nektar/Forcing");
1358 TiXmlElement *vForce = vForcing->FirstChildElement(
"FORCE");
1361 string vType = vForce->Attribute(
"TYPE");
1364 if (boost::iequals(vType, sMRFForcingType))
1366 TiXmlElement *pivotElmt =
1367 vForce->FirstChildElement(
"PivotPoint");
1372 std::stringstream pivotPointStream;
1373 std::string pivotPointStr = pivotElmt->GetText();
1374 pivotPointStream.str(pivotPointStr);
1378 pivotPointStream >> pivotPointStr;
1379 if (!pivotPointStr.empty())
1382 m_session->GetInterpreter(), pivotPointStr);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
Array< OneD, NekDouble > m_pivotPoint
virtual Array< OneD, NekDouble > v_GetMaxStdVelocity(const NekDouble SpeedSoundFactor) override
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
Womersley parameters if required.
virtual MultiRegions::ExpListSharedPtr v_GetPressure() override
virtual int v_GetForceDimension()=0
void SetWomersleyBoundary(const int fldid, const int bndid)
Set Womersley Profile if specified.
virtual void v_GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels) override
void SetZeroNormalVelocity()
Set Normal Velocity Component to Zero.
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
void SetMRFDomainVelBCs(const NekDouble &time)
NekDouble m_kinvis
Kinematic viscosity.
virtual ~IncNavierStokes()
virtual void v_GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density) override
virtual void v_GetMovingFrameAngles(Array< OneD, NekDouble > &vFrameTheta) override
void SetRadiationBoundaryForcing(int fieldid)
Set Radiation forcing term.
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
bool DefinedForcing(const std::string &sForce)
void SetMRFWallBCs(const NekDouble &time)
virtual void v_SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels) override
void GetPivotPoint(Array< OneD, NekDouble > &vPivotPoint)
virtual bool v_PreIntegrate(int step) override
void SetUpWomersley(const int fldid, const int bndid, std::string womstr)
Set Up Womersley details.
virtual void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
ExtrapolateSharedPtr m_extrapolation
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
static std::string eqTypeLookupIds[]
virtual void v_SetMovingFrameAngles(const Array< OneD, NekDouble > &vFrameTheta) override
virtual void v_GetMovingFrameProjectionMat(bnu::matrix< NekDouble > &vProjMat) override
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
virtual void v_GetVelocity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity) override
EquationType m_equationType
equation type;
virtual void v_SetMovingFrameProjectionMat(const bnu::matrix< NekDouble > &vProjMat) override
int m_nConvectiveFields
Number of fields to be convected;.
void AddForcing(const SolverUtils::ForcingSharedPtr &pForce)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void SetMovingReferenceFrameBCs(const NekDouble &time)
Set the moving reference frame boundary conditions.
IncNavierStokes(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
NekDouble Evaluate() const
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
A base class for PDEs which include an advection component.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
int m_spacedim
Spatial dimension (>= expansion dim).
boost::numeric::ublas::matrix< NekDouble > m_movingFrameProjMat
Projection matrix for transformation between inertial and moving.
NekDouble m_timestep
Time step size.
NekDouble m_time
Current time of simulation.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > m_movingFrameVelsxyz
Moving frame of reference velocities.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum HomogeneousType m_HomogeneousType
SOLVER_UTILS_EXPORT int GetPhys_Offset(int n)
Array< OneD, NekDouble > m_movingFrameTheta
Moving frame of reference angles with respect to the.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Base class for unsteady solvers.
static NekDouble rad(NekDouble x, NekDouble y)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::vector< double > z(NPUPPER)
The above copyright notice and this permission notice shall be included.
std::complex< double > NekComplexDouble
std::shared_ptr< WomersleyParams > WomersleyParamsSharedPtr
const std::string kEquationTypeStr[]
std::complex< Nektar::NekDouble > ImagBesselComp(int n, std::complex< Nektar::NekDouble > y)
Calcualte the bessel function of the first kind with complex double input y. Taken from Numerical Rec...
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
svtvvtp (scalar times vector plus scalar times vector):
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add scalar y = alpha + x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)