71 op, connectivity, values, sideConn, offset, shapeGradient, shapeConnectivity, shapeValues)
75 throw std::logic_error(
"Must have non-null operator.");
77 if (Modifier !=
None && !shapeGradient)
79 throw std::logic_error(
"Must have non-null shape gradient operator.");
83 if (this->CellConnectivity)
85 ncc = this->CellConnectivity->GetNumberOfComponents();
86 this->ConnTuple.resize(ncc);
90 throw std::logic_error(
"DOF sharing requires a cell-connectivity array.");
92 int nvc = this->CellValues->GetNumberOfComponents();
95 this->NumberOfValuesPerFunction = nvc;
96 this->ValueTuple.resize(nvc * ncc);
100 this->NumberOfValuesPerFunction = nvc / this->OpEntry.NumberOfFunctions;
101 this->ValueTuple.resize(nvc);
106 if (Modifier !=
None)
108 this->Jacobian.resize(9);
109 this->ShapeBasisTuple.resize(shapeGradient.NumberOfFunctions * shapeGradient.OperatorSize);
111 if (this->ShapeConnectivity)
113 nsc = this->ShapeConnectivity->GetNumberOfComponents();
114 this->ShapeConnTuple.resize(nsc);
118 throw std::logic_error(
"Shape DOF-sharing requires a shape-connectivity array.");
120 int nvs = this->ShapeValues->GetNumberOfComponents();
123 this->NumberOfShapeValuesPerFunction = nvs;
124 this->ShapeValueTuple.resize(nvs * nsc);
128 this->NumberOfShapeValuesPerFunction = nvs / this->ShapeGradientEntry.NumberOfFunctions;
129 this->ShapeValueTuple.resize(nvs);
203 if (this->LastShapeCellId != this->LastCellId)
205 this->ShapeConnectivity->GetUnsignedTuple(this->LastCellId, this->ShapeConnTuple.data());
206 std::size_t nc = this->ShapeConnTuple.size();
207 int nv = this->ShapeValues->GetNumberOfComponents();
208 for (std::size_t jj = 0; jj < nc; ++jj)
210 this->ShapeValues->GetTuple(
211 this->ShapeConnTuple[jj], this->ShapeValueTuple.data() + nv * jj);
218 if (this->LastShapeCellId != this->LastCellId)
220 this->ShapeValues->GetTuple(this->LastCellId, this->ShapeValueTuple.data());
226 throw std::logic_error(
"Invalid shape DOF-sharing enumerant.");
228 this->ShapeGradientEntry.Op(this->RST, this->ShapeBasisTuple);
229 this->ShapeInnerProduct();
288 InputIterator& inIter, OutputIterator& outIter, vtkTypeUInt64 begin, vtkTypeUInt64 end)
const
290 vtkTypeUInt64 currId;
293 for (vtkTypeUInt64 ii = begin; ii != end; ++ii)
295 currId = inIter.GetCellId(ii);
296 this->SideConnectivity->GetUnsignedTuple(currId - this->Offset, this->SideTuple.data());
297 currId = this->SideTuple[0];
298 if (this->LastCellId != currId)
300 this->CellConnectivity->GetUnsignedTuple(currId, this->ConnTuple.data());
301 std::size_t nc = this->ConnTuple.size();
302 int nv = this->CellValues->GetNumberOfComponents();
303 for (std::size_t jj = 0; jj < nc; ++jj)
305 this->CellValues->GetTuple(this->ConnTuple[jj], this->ValueTuple.data() + nv * jj);
307 this->LastCellId = currId;
309 auto param = inIter.GetParameter(ii);
310 for (
int jj = 0; jj < 3; ++jj)
312 this->RST[jj] = param[jj];
314 this->OpEntry.Op(this->RST, this->BasisTuple);
315 this->InnerProduct(ii, outIter);
318 this->ApplyInverseJacobian(ii, outIter);
322 this->ApplyScaledJacobian(ii, outIter);
328 for (vtkTypeUInt64 ii = begin; ii != end; ++ii)
330 currId = inIter.GetCellId(ii);
331 if (this->LastCellId != currId)
335 this->CellConnectivity->GetUnsignedTuple(currId, this->ConnTuple.data());
336 std::size_t nc = this->ConnTuple.size();
337 int nv = this->CellValues->GetNumberOfComponents();
338 for (std::size_t jj = 0; jj < nc; ++jj)
340 this->CellValues->GetTuple(this->ConnTuple[jj], this->ValueTuple.data() + nv * jj);
342 this->LastCellId = currId;
344 auto param = inIter.GetParameter(ii);
345 for (
int jj = 0; jj < 3; ++jj)
347 this->RST[jj] = param[jj];
349 this->OpEntry.Op(this->RST, this->BasisTuple);
350 this->InnerProduct(ii, outIter);
353 this->ApplyInverseJacobian(ii, outIter);
357 this->ApplyScaledJacobian(ii, outIter);
363 for (vtkTypeUInt64 ii = begin; ii != end; ++ii)
365 currId = inIter.GetCellId(ii);
366 this->SideConnectivity->GetUnsignedTuple(currId - this->Offset, this->SideTuple.data());
367 currId = this->SideTuple[0];
368 if (this->LastCellId != currId)
370 this->CellValues->GetTuple(currId, this->ValueTuple.data());
371 this->LastCellId = currId;
373 auto param = inIter.GetParameter(ii);
374 for (
int jj = 0; jj < 3; ++jj)
376 this->RST[jj] = param[jj];
378 this->OpEntry.Op(this->RST, this->BasisTuple);
379 this->InnerProduct(ii, outIter);
382 this->ApplyInverseJacobian(ii, outIter);
386 this->ApplyScaledJacobian(ii, outIter);
392 for (vtkTypeUInt64 ii = begin; ii != end; ++ii)
394 currId = inIter.GetCellId(ii);
397 if (this->LastCellId != currId)
399 this->CellValues->GetTuple(currId, this->ValueTuple.data());
400 this->LastCellId = currId;
402 auto param = inIter.GetParameter(ii);
403 for (
int jj = 0; jj < 3; ++jj)
405 this->RST[jj] = param[jj];
407 this->OpEntry.Op(this->RST, this->BasisTuple);
408 this->InnerProduct(ii, outIter);
411 this->ApplyInverseJacobian(ii, outIter);
415 this->ApplyScaledJacobian(ii, outIter);
433 OutputIterator, DOFSharing, SourceType, Modifier, ShapeSharing>(
434 op, conn, values, sides, offset, shapeGradient, shapeConnectivity, shapeValues));
435 entry.
Function = [&entry](InputIterator& inIter, OutputIterator& outIter, vtkTypeUInt64 begin,
439 DOFSharing, SourceType, Modifier, ShapeSharing
>*>(entry.
State.get());
440 return (*eval)(inIter, outIter, begin, end);