Update geometry according to displacement that is in current fields.
Adds a summary item to the summary info list.
74 set<int> updatedVerts, updatedEdges, updatedFaces;
76 dim = graph->GetSpaceDimension();
77 Array<OneD, Array<OneD, NekDouble>> phys(dim);
78 Array<OneD, Array<OneD, NekDouble>> coord(dim);
80 for (i = 0; i < fields[0]->GetExpSize(); ++i)
83 int offset = fields[0]->GetPhys_Offset(i);
84 int nquad = exp->GetTotPoints();
88 for (j = 0; j < dim; ++j)
90 phys[j] = Array<OneD, NekDouble>(nquad, PhysVals[j] + offset);
91 coord[j] = Array<OneD, NekDouble>(nquad);
97 exp->GetCoords(coord[0], coord[1]);
100 std::dynamic_pointer_cast<SpatialDomains::Geometry2D>(
103 for (j = 0; j < exp->GetGeom()->GetNumEdges(); ++j)
108 if (updatedEdges.find(edge->GetGlobalID()) !=
115 int nEdgePts = exp->GetTraceNumPoints(j);
116 Array<OneD, Array<OneD, NekDouble>> edgePhys(dim);
117 Array<OneD, Array<OneD, NekDouble>> edgeCoord(dim);
119 const LibUtilities::BasisKey B(
121 LibUtilities::PointsKey(
124 MemoryManager<StdRegions::StdSegExp>::AllocateSharedPtr(B);
126 for (k = 0; k < dim; ++k)
128 edgePhys[k] = Array<OneD, NekDouble>(nEdgePts);
129 edgeCoord[k] = Array<OneD, NekDouble>(nEdgePts);
130 exp->GetTracePhysVals(j, seg, phys[k], edgePhys[k]);
131 exp->GetTracePhysVals(j, seg, coord[k], edgeCoord[k]);
135 for (k = 0; k < 2; ++k)
137 int id = edge->GetVid(k);
138 if (updatedVerts.find(
id) != updatedVerts.end())
146 (*pt)(0) + edgePhys[0][k * (nEdgePts - 1)],
147 (*pt)(1) + edgePhys[1][k * (nEdgePts - 1)], (*pt)(2));
149 updatedVerts.insert(
id);
154 MemoryManager<SpatialDomains::Curve>::AllocateSharedPtr(
158 for (k = 0; k < nEdgePts; ++k)
161 MemoryManager<SpatialDomains::PointGeom>::
162 AllocateSharedPtr(dim, edge->GetGlobalID(),
163 edgeCoord[0][k] + edgePhys[0][k],
164 edgeCoord[1][k] + edgePhys[1][k],
167 curve->m_points.push_back(vert);
170 curvedEdges[edge->GetGlobalID()] = curve;
171 updatedEdges.insert(edge->GetGlobalID());
176 exp->GetCoords(coord[0], coord[1], coord[2]);
179 std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(
182 for (j = 0; j < exp->GetNtraces(); ++j)
187 exp->as<LocalRegions::Expansion3D>();
190 if (updatedFaces.find(face->GetGlobalID()) !=
197 LibUtilities::BasisKey B0 = exp->GetTraceBasisKey(j, 0);
198 LibUtilities::BasisKey B1 = exp->GetTraceBasisKey(j, 1);
199 int nq0 = B0.GetNumPoints();
200 int nq1 = B1.GetNumPoints();
204 B1.GetPointsType() ==
206 "Deformation requires GLL points in both "
207 "directions on a face.");
209 Array<OneD, Array<OneD, NekDouble>> newPos(dim);
217 MemoryManager<StdRegions::StdTriExp>::AllocateSharedPtr(
222 faceexp = MemoryManager<
223 StdRegions::StdQuadExp>::AllocateSharedPtr(B0, B1);
226 for (k = 0; k < dim; ++k)
228 Array<OneD, NekDouble> tmp(nq0 * nq1);
229 newPos[k] = Array<OneD, NekDouble>(nq0 * nq1);
230 exp3d->GetTracePhysVals(j, faceexp, phys[k], tmp, orient);
231 exp3d->GetTracePhysVals(j, faceexp, coord[k], newPos[k],
233 Vmath::Vadd(nq0 * nq1, tmp, 1, newPos[k], 1, newPos[k], 1);
238 int nq = max(nq0, nq1);
242 LibUtilities::PointsKey edgePts(
246 Array<OneD, Array<OneD, NekDouble>> intPos(dim);
248 for (k = 0; k < dim; ++k)
250 intPos[k] = Array<OneD, NekDouble>(nq * nq);
252 faceexp->GetPointsKeys()[1],
253 newPos[k], edgePts, edgePts,
257 int edgeOff[2][4][2] = {
258 {{0, 1}, {nq - 1, nq}, {nq * (nq - 1), -nq}, {-1, -1}},
262 {nq * (nq - 1), -nq}}};
264 for (k = 0; k < face->GetNumVerts(); ++k)
267 int id = face->GetVid(k);
271 if (updatedVerts.find(
id) == updatedVerts.end())
275 pt->UpdatePosition(intPos[0][edgeOff[o][k][0]],
276 intPos[1][edgeOff[o][k][0]],
277 intPos[2][edgeOff[o][k][0]]);
278 updatedVerts.insert(
id);
282 id = face->GetEid(k);
283 if (updatedEdges.find(
id) == updatedEdges.end())
288 MemoryManager<SpatialDomains::Curve>::
293 const int offset = edgeOff[o][k][0];
294 const int pos = edgeOff[o][k][1];
298 for (l = nq - 1; l >= 0; --l)
300 int m = offset + pos * l;
302 MemoryManager<SpatialDomains::PointGeom>::
304 dim, edge->GetGlobalID(),
305 intPos[0][m], intPos[1][m],
307 curve->m_points.push_back(vert);
312 for (l = 0; l < nq; ++l)
314 int m = offset + pos * l;
316 MemoryManager<SpatialDomains::PointGeom>::
318 dim, edge->GetGlobalID(),
319 intPos[0][m], intPos[1][m],
321 curve->m_points.push_back(vert);
325 curvedEdges[edge->GetGlobalID()] = curve;
326 updatedEdges.insert(edge->GetGlobalID());
337 MemoryManager<SpatialDomains::Curve>::AllocateSharedPtr(
338 face->GetGlobalID(), pType);
345 const LibUtilities::BasisKey B0(
347 LibUtilities::PointsKey(
349 const LibUtilities::BasisKey B1(
351 LibUtilities::PointsKey(
352 nq, LibUtilities::eGaussRadauMAlpha1Beta0));
353 StdRegions::StdNodalTriExp nodalTri(B0, B1, pType);
354 StdRegions::StdTriExp tri(B0, B1);
356 for (k = 0; k < dim; ++k)
358 Array<OneD, NekDouble> nodal(nq * nq);
361 faceexp->GetBasis(0)->GetBasisKey(),
362 faceexp->GetBasis(1)->GetBasisKey(), newPos[k], B0,
365 Array<OneD, NekDouble> tmp1(nq * (nq + 1) / 2);
366 Array<OneD, NekDouble> tmp2(nq * (nq + 1) / 2);
368 tri.FwdTrans(nodal, tmp1);
369 nodalTri.ModalToNodal(tmp1, tmp2);
373 for (l = 0; l < nq * (nq + 1) / 2; ++l)
376 MemoryManager<SpatialDomains::PointGeom>::
377 AllocateSharedPtr(dim, face->GetGlobalID(),
378 newPos[0][l], newPos[1][l],
380 curve->m_points.push_back(vert);
385 for (l = 0; l < nq * nq; ++l)
388 MemoryManager<SpatialDomains::PointGeom>::
389 AllocateSharedPtr(dim, face->GetGlobalID(),
390 intPos[0][l], intPos[1][l],
392 curve->m_points.push_back(vert);
396 curvedFaces[face->GetGlobalID()] = curve;
397 updatedFaces.insert(face->GetGlobalID());
403 for (i = 0; i < fields.size(); ++i)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eOrtho_A
Principle Orthogonal Functions .
@ eOrtho_B
Principle Orthogonal Functions .
@ eModified_A
Principle Modified Functions .
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
std::shared_ptr< Curve > CurveSharedPtr
std::unordered_map< int, CurveSharedPtr > CurveMap
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
std::shared_ptr< StdExpansion2D > StdExpansion2DSharedPtr
std::shared_ptr< StdExpansion1D > StdExpansion1DSharedPtr
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.