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)
91 Array<OneD, NekDouble>(nquad, fields[j]->UpdatePhys() + offset);
92 coord[j] = Array<OneD, NekDouble>(nquad);
98 exp->GetCoords(coord[0], coord[1]);
101 std::dynamic_pointer_cast<SpatialDomains::Geometry2D>(
104 for (j = 0; j < exp->GetGeom()->GetNumEdges(); ++j)
109 if (updatedEdges.find(edge->GetGlobalID()) !=
116 int nEdgePts = exp->GetTraceNumPoints(j);
117 Array<OneD, Array<OneD, NekDouble>> edgePhys(dim);
118 Array<OneD, Array<OneD, NekDouble>> edgeCoord(dim);
120 const LibUtilities::BasisKey B(
122 LibUtilities::PointsKey(
125 MemoryManager<StdRegions::StdSegExp>::AllocateSharedPtr(B);
127 for (k = 0; k < dim; ++k)
129 edgePhys[k] = Array<OneD, NekDouble>(nEdgePts);
130 edgeCoord[k] = Array<OneD, NekDouble>(nEdgePts);
131 exp->GetTracePhysVals(j, seg, phys[k], edgePhys[k]);
132 exp->GetTracePhysVals(j, seg, coord[k], edgeCoord[k]);
136 for (k = 0; k < 2; ++k)
138 int id = edge->GetVid(k);
139 if (updatedVerts.find(
id) != updatedVerts.end())
147 (*pt)(0) + edgePhys[0][k * (nEdgePts - 1)],
148 (*pt)(1) + edgePhys[1][k * (nEdgePts - 1)], (*pt)(2));
150 updatedVerts.insert(
id);
155 MemoryManager<SpatialDomains::Curve>::AllocateSharedPtr(
159 for (k = 0; k < nEdgePts; ++k)
162 MemoryManager<SpatialDomains::PointGeom>::
163 AllocateSharedPtr(dim, edge->GetGlobalID(),
164 edgeCoord[0][k] + edgePhys[0][k],
165 edgeCoord[1][k] + edgePhys[1][k],
168 curve->m_points.push_back(vert);
171 curvedEdges[edge->GetGlobalID()] = curve;
172 updatedEdges.insert(edge->GetGlobalID());
177 exp->GetCoords(coord[0], coord[1], coord[2]);
180 std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(
183 for (j = 0; j < exp->GetNtraces(); ++j)
188 exp->as<LocalRegions::Expansion3D>();
191 if (updatedFaces.find(face->GetGlobalID()) !=
198 LibUtilities::BasisKey B0 = exp->GetTraceBasisKey(j, 0);
199 LibUtilities::BasisKey B1 = exp->GetTraceBasisKey(j, 1);
200 int nq0 = B0.GetNumPoints();
201 int nq1 = B1.GetNumPoints();
205 B1.GetPointsType() ==
207 "Deformation requires GLL points in both "
208 "directions on a face.");
210 Array<OneD, Array<OneD, NekDouble>> newPos(dim);
218 MemoryManager<StdRegions::StdTriExp>::AllocateSharedPtr(
223 faceexp = MemoryManager<
224 StdRegions::StdQuadExp>::AllocateSharedPtr(B0, B1);
227 for (k = 0; k < dim; ++k)
229 Array<OneD, NekDouble> tmp(nq0 * nq1);
230 newPos[k] = Array<OneD, NekDouble>(nq0 * nq1);
231 exp3d->GetTracePhysVals(j, faceexp, phys[k], tmp, orient);
232 exp3d->GetTracePhysVals(j, faceexp, coord[k], newPos[k],
234 Vmath::Vadd(nq0 * nq1, tmp, 1, newPos[k], 1, newPos[k], 1);
239 int nq = max(nq0, nq1);
243 LibUtilities::PointsKey edgePts(
247 Array<OneD, Array<OneD, NekDouble>> intPos(dim);
249 for (k = 0; k < dim; ++k)
251 intPos[k] = Array<OneD, NekDouble>(nq * nq);
253 faceexp->GetPointsKeys()[1],
254 newPos[k], edgePts, edgePts,
258 int edgeOff[2][4][2] = {
259 {{0, 1}, {nq - 1, nq}, {nq * (nq - 1), -nq}, {-1, -1}},
263 {nq * (nq - 1), -nq}}};
265 for (k = 0; k < face->GetNumVerts(); ++k)
268 int id = face->GetVid(k);
272 if (updatedVerts.find(
id) == updatedVerts.end())
276 pt->UpdatePosition(intPos[0][edgeOff[o][k][0]],
277 intPos[1][edgeOff[o][k][0]],
278 intPos[2][edgeOff[o][k][0]]);
279 updatedVerts.insert(
id);
283 id = face->GetEid(k);
284 if (updatedEdges.find(
id) == updatedEdges.end())
289 MemoryManager<SpatialDomains::Curve>::
294 const int offset = edgeOff[o][k][0];
295 const int pos = edgeOff[o][k][1];
299 for (l = nq - 1; l >= 0; --l)
301 int m = offset + pos * l;
303 MemoryManager<SpatialDomains::PointGeom>::
305 dim, edge->GetGlobalID(),
306 intPos[0][m], intPos[1][m],
308 curve->m_points.push_back(vert);
313 for (l = 0; l < nq; ++l)
315 int m = offset + pos * l;
317 MemoryManager<SpatialDomains::PointGeom>::
319 dim, edge->GetGlobalID(),
320 intPos[0][m], intPos[1][m],
322 curve->m_points.push_back(vert);
326 curvedEdges[edge->GetGlobalID()] = curve;
327 updatedEdges.insert(edge->GetGlobalID());
338 MemoryManager<SpatialDomains::Curve>::AllocateSharedPtr(
339 face->GetGlobalID(), pType);
346 const LibUtilities::BasisKey B0(
348 LibUtilities::PointsKey(
350 const LibUtilities::BasisKey B1(
352 LibUtilities::PointsKey(
353 nq, LibUtilities::eGaussRadauMAlpha1Beta0));
354 StdRegions::StdNodalTriExp nodalTri(B0, B1, pType);
355 StdRegions::StdTriExp tri(B0, B1);
357 for (k = 0; k < dim; ++k)
359 Array<OneD, NekDouble> nodal(nq * nq);
362 faceexp->GetBasis(0)->GetBasisKey(),
363 faceexp->GetBasis(1)->GetBasisKey(), newPos[k], B0,
366 Array<OneD, NekDouble> tmp1(nq * (nq + 1) / 2);
367 Array<OneD, NekDouble> tmp2(nq * (nq + 1) / 2);
369 tri.FwdTrans(nodal, tmp1);
370 nodalTri.ModalToNodal(tmp1, tmp2);
374 for (l = 0; l < nq * (nq + 1) / 2; ++l)
377 MemoryManager<SpatialDomains::PointGeom>::
378 AllocateSharedPtr(dim, face->GetGlobalID(),
379 newPos[0][l], newPos[1][l],
381 curve->m_points.push_back(vert);
386 for (l = 0; l < nq * nq; ++l)
389 MemoryManager<SpatialDomains::PointGeom>::
390 AllocateSharedPtr(dim, face->GetGlobalID(),
391 intPos[0][l], intPos[1][l],
393 curve->m_points.push_back(vert);
397 curvedFaces[face->GetGlobalID()] = curve;
398 updatedFaces.insert(face->GetGlobalID());
404 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.