31 typedef memory::shared_ptr< gsScaledOuterNormalField > Ptr;
32 typedef memory::unique_ptr< gsScaledOuterNormalField > uPtr;
49 m_patch(patch), m_side(side), m_scalarField(scalarField)
59 result.resize(this->
targetDim(), u.cols());
62 mapData.side = m_side;
64 m_scalarField.
patches().patch(m_patch).computeMap(mapData);
69 for (
index_t k = 0; k < u.cols(); k++)
71 outerNormal(mapData, k, m_side, normal);
72 result.col(k) = scalarVals(0, k) * (1. / normal.norm()) * normal;
79 virtual std::ostream &
print(std::ostream &os)
const
80 { os <<
"gsScaledOuterNormalField";
return os; };
86 {
return m_scalarField.
function(m_patch).eval(u); }
110 typedef memory::shared_ptr< gsDiffScaledOuterNormalField > Ptr;
111 typedef memory::unique_ptr< gsDiffScaledOuterNormalField > uPtr;
122 Base(patch, side, scalarField), m_targetValue(targetValue)
130 virtual std::ostream &
print(std::ostream &os)
const
131 { os <<
"gsDiffScaledOuterNormalField";
return os; };
140 gsMatrix<T> targetVals(fieldVals.rows(), fieldVals.cols());
141 targetVals.setOnes();
142 targetVals *= m_targetValue;
144 return (targetVals - fieldVals);
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
Function returning the (unit) outer normal vector scaled by the difference of a target value and valu...
Definition gsFlowFieldCreator.h:103
virtual std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsFlowFieldCreator.h:130
A scalar of vector field defined on a m_parametric geometry.
Definition gsField.h:55
const gsFunction< T > & function(int i=0) const
Returns the gsFunction of patch i.
Definition gsField.h:231
const gsMultiPatch< T > & patches() const
Returns gsMultiPatch containing the geometric information on the domain.
Definition gsField.h:210
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
the gsMapData is a cache of pre-computed function (map) values.
Definition gsFuncData.h:349
gsMatrix< T > points
input (parametric) points
Definition gsFuncData.h:372
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Function returning the (unit) outer normal vector scaled by values of a given scalar field.
Definition gsFlowFieldCreator.h:27
short_t targetDim() const
Dimension of the target space.
Definition gsFlowFieldCreator.h:77
virtual std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsFlowFieldCreator.h:79
short_t domainDim() const
Dimension of the (source) domain.
Definition gsFlowFieldCreator.h:76
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition gsFlowFieldCreator.h:57
gsScaledOuterNormalField(index_t patch, boxSide side, const gsField< T > &scalarField)
Constructor.
Definition gsFlowFieldCreator.h:48
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
The G+Smo namespace, containing all definitions for the library.
@ NEED_OUTER_NORMAL
Outward normal on the boundary.
Definition gsForwardDeclarations.h:86