Update geometry according to displacement that is in current fields.
Adds a summary item to the summary info list.
73 set<int> updatedVerts, updatedEdges, updatedFaces;
75 dim = graph->GetSpaceDimension();
76 Array<OneD, Array<OneD, NekDouble> > phys (dim);
77 Array<OneD, Array<OneD, NekDouble> > coord(dim);
79 for (i = 0; i < fields[0]->GetExpSize(); ++i)
82 int offset = fields[0]->GetPhys_Offset(i);
83 int nquad = exp->GetTotPoints();
87 for (j = 0; j < dim; ++j)
89 phys[j] = Array<OneD, NekDouble>(
90 nquad, fields[j]->UpdatePhys() + 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 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())
147 (*pt)(0) + edgePhys[0][k*(nEdgePts-1)],
148 (*pt)(1) + edgePhys[1][k*(nEdgePts-1)],
151 updatedVerts.insert(
id);
156 SpatialDomains::Curve>::AllocateSharedPtr(
160 for (k = 0; k < nEdgePts; ++k)
163 MemoryManager<SpatialDomains::PointGeom>
165 dim, edge->GetGlobalID(),
166 edgeCoord[0][k] + edgePhys[0][k],
167 edgeCoord[1][k] + edgePhys[1][k], 0.0);
169 curve->m_points.push_back(vert);
172 curvedEdges[edge->GetGlobalID()] = curve;
173 updatedEdges.insert(edge->GetGlobalID());
178 exp->GetCoords(coord[0], coord[1], coord[2]);
181 std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(
184 for (j = 0; j < exp->GetNtraces(); ++j)
189 exp->as<LocalRegions::Expansion3D>();
192 if (updatedFaces.find(face->GetGlobalID()) !=
199 LibUtilities::BasisKey B0 = exp->GetTraceBasisKey(j,0);
200 LibUtilities::BasisKey B1 = exp->GetTraceBasisKey(j,1);
201 int nq0 = B0.GetNumPoints();
202 int nq1 = B1.GetNumPoints();
208 "Deformation requires GLL points in both "
209 "directions on a face.");
211 Array<OneD, Array<OneD, NekDouble> > newPos(dim);
218 faceexp = MemoryManager<StdRegions::StdTriExp>::
219 AllocateSharedPtr(B0, B1);
223 faceexp = MemoryManager<StdRegions::StdQuadExp>::
224 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(
232 j, faceexp, phys [k], tmp, orient);
233 exp3d->GetTracePhysVals(
234 j, faceexp, coord[k], newPos[k], orient);
236 nq0*nq1, tmp, 1, newPos[k], 1, newPos[k], 1);
241 int nq = max(nq0, nq1);
245 LibUtilities::PointsKey edgePts(
247 LibUtilities::PointsKey triPts(
250 Array<OneD, Array<OneD, NekDouble> > intPos(dim);
252 for (k = 0; k < dim; ++k)
254 intPos[k] = Array<OneD, NekDouble>(nq*nq);
256 faceexp->GetPointsKeys()[0],
257 faceexp->GetPointsKeys()[1],
258 newPos[k], edgePts, edgePts, intPos[k]);
261 int edgeOff[2][4][2] = {
276 for (k = 0; k < face->GetNumVerts(); ++k)
279 int id = face->GetVid(k);
283 if (updatedVerts.find(
id) == updatedVerts.end())
288 intPos[0][edgeOff[o][k][0]],
289 intPos[1][edgeOff[o][k][0]],
290 intPos[2][edgeOff[o][k][0]]);
291 updatedVerts.insert(
id);
295 id = face->GetEid(k);
296 if (updatedEdges.find(
id) == updatedEdges.end())
301 MemoryManager<SpatialDomains::Curve>
306 const int offset = edgeOff[o][k][0];
307 const int pos = edgeOff[o][k][1];
311 for (l = nq-1; l >= 0; --l)
313 int m = offset + pos*l;
315 MemoryManager<SpatialDomains::PointGeom>
317 dim, edge->GetGlobalID(),
318 intPos[0][m], intPos[1][m],
320 curve->m_points.push_back(vert);
325 for (l = 0; l < nq; ++l)
327 int m = offset + pos*l;
329 MemoryManager<SpatialDomains::PointGeom>
331 dim, edge->GetGlobalID(),
332 intPos[0][m], intPos[1][m],
334 curve->m_points.push_back(vert);
338 curvedEdges[edge->GetGlobalID()] = curve;
339 updatedEdges.insert(edge->GetGlobalID());
350 SpatialDomains::Curve>::AllocateSharedPtr(
359 const LibUtilities::BasisKey B0(
361 LibUtilities::PointsKey(
363 const LibUtilities::BasisKey B1(
365 LibUtilities::PointsKey(
367 StdRegions::StdNodalTriExp nodalTri(B0, B1, pType);
368 StdRegions::StdTriExp tri (B0, B1);
370 for (k = 0; k < dim; ++k)
372 Array<OneD, NekDouble> nodal(nq*nq);
375 faceexp->GetBasis(0)->GetBasisKey(),
376 faceexp->GetBasis(1)->GetBasisKey(),
377 newPos[k], B0, B1, nodal);
379 Array<OneD, NekDouble> tmp1(nq*(nq+1)/2);
380 Array<OneD, NekDouble> tmp2(nq*(nq+1)/2);
382 tri.FwdTrans(nodal, tmp1);
383 nodalTri.ModalToNodal(tmp1, tmp2);
387 for (l = 0; l < nq*(nq+1)/2; ++l)
390 MemoryManager<SpatialDomains::PointGeom>
392 dim, face->GetGlobalID(),
393 newPos[0][l], newPos[1][l], newPos[2][l]);
394 curve->m_points.push_back(vert);
399 for (l = 0; l < nq*nq; ++l)
402 MemoryManager<SpatialDomains::PointGeom>
404 dim, face->GetGlobalID(),
405 intPos[0][l], intPos[1][l], intPos[2][l]);
406 curve->m_points.push_back(vert);
410 curvedFaces[face->GetGlobalID()] = curve;
411 updatedFaces.insert(face->GetGlobalID());
417 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
@ eGaussRadauMAlpha1Beta0
Gauss Radau pinned at x=-1, .
@ 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.