38 const word& functionName,
42 polyFitter_(functionName,geomDir),
47 for (
const label dirn : geomDir_)
69 List<T> fitData = polyFitter_.fitData
77 return GradType(fitData[1],fitData[2],fitData[3]);
90 ret[i] = fitData[dimCounter];
117 return GradType(fitData[1],fitData[2],fitData[3]);
120 label dimCounter = 0;
126 if (geomDir_[i] == 1)
129 ret.row(i, fitData[dimCounter]);
142 const Map<List<vector>>& positions,
143 const Map<List<T>>& listValue
148 Map<GradType> gradMap(positions.
capacity());
152 const label key = iter.key();
153 const List<vector>& positions = iter.val();
155 GradType grad(this->grad(positions, listValue[key]));
157 gradMap.insert(key, grad);
164template class Foam::leastSquareGrad<Foam::scalar>;
165template class Foam::leastSquareGrad<Foam::vector>;
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
label capacity() const noexcept
Size of the underlying storage.
Estimates the gradient with a least square scheme in a cell.
outerProduct< vector, T >::type grad(const List< vector > &positions, const List< T > &listValue)
Return the gradient of the cell.
leastSquareGrad(const word &functionName, const labelVector &geomDir)
Construct from components.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
A class for handling words, derived from Foam::string.
Vector< label > labelVector
Vector of labels.
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.