MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
eltrans.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #include "../mesh/mesh_headers.hpp"
13 #include "fem.hpp"
14 #include <cmath>
15 
16 namespace mfem
17 {
18 
20  : IntPoint(static_cast<IntegrationPoint *>(NULL)),
21  EvalState(0),
22  Attribute(-1),
23  ElementNo(-1)
24 { }
25 
27 {
28  MFEM_ASSERT((EvalState & WEIGHT_MASK) == 0, "");
29  Jacobian();
31  return (Wght = (dFdx.Width() == 0) ? 1.0 : dFdx.Weight());
32 }
33 
35 {
36  MFEM_ASSERT((EvalState & ADJUGATE_MASK) == 0, "");
37  Jacobian();
39  if (dFdx.Width() > 0) { CalcAdjugate(dFdx, adjJ); }
41  return adjJ;
42 }
43 
45 {
46  // TODO: compute as invJ = / adjJ/Weight, if J is square,
47  // \ adjJ/Weight^2, otherwise.
48  MFEM_ASSERT((EvalState & INVERSE_MASK) == 0, "");
49  Jacobian();
51  if (dFdx.Width() > 0) { CalcInverse(dFdx, invJ); }
53  return invJ;
54 }
55 
56 
58  const Vector& pt, const IntegrationRule &ir)
59 {
60  MFEM_VERIFY(T != NULL, "invalid ElementTransformation");
61  MFEM_VERIFY(pt.Size() == T->GetSpaceDim(), "invalid point");
62 
63  DenseMatrix physPts;
64  T->Transform(ir, physPts);
65 
66  // Initialize distance and index of closest point
67  int minIndex = -1;
68  double minDist = std::numeric_limits<double>::max();
69 
70  // Check all integration points in ir
71  const int npts = ir.GetNPoints();
72  for (int i = 0; i < npts; ++i)
73  {
74  double dist = pt.DistanceTo(physPts.GetColumn(i));
75  if (dist < minDist)
76  {
77  minDist = dist;
78  minIndex = i;
79  }
80  }
81  return minIndex;
82 }
83 
85  const Vector& pt, const IntegrationRule &ir)
86 {
87  MFEM_VERIFY(T != NULL, "invalid ElementTransformation");
88  MFEM_VERIFY(pt.Size() == T->GetSpaceDim(), "invalid point");
89 
90  // Initialize distance and index of closest point
91  int minIndex = -1;
92  double minDist = std::numeric_limits<double>::max();
93 
94  // Check all integration points in ir using the local metric at each point
95  // induced by the transformation.
96  Vector dp(T->GetSpaceDim()), dr(T->GetDimension());
97  const int npts = ir.GetNPoints();
98  for (int i = 0; i < npts; ++i)
99  {
100  const IntegrationPoint &ip = ir.IntPoint(i);
101  T->Transform(ip, dp);
102  dp -= pt;
103  T->SetIntPoint(&ip);
104  T->InverseJacobian().Mult(dp, dr);
105  double dist = dr.Norml2();
106  // double dist = dr.Normlinf();
107  if (dist < minDist)
108  {
109  minDist = dist;
110  minIndex = i;
111  }
112  }
113  return minIndex;
114 }
115 
117 {
118  std::ostream &out = mfem::out;
119 
120  // separator:
121  switch (mode%3)
122  {
123  case 0: out << ", "; break;
124  case 1: out << "Newton: "; break;
125  case 2: out << " "; break;
126  // "Newton: iter = xx, "
127  }
128  switch ((mode/3)%4)
129  {
130  case 0: out << "iter = " << std::setw(2) << int(val); break;
131  case 1: out << "delta_ref = " << std::setw(11) << val; break;
132  case 2: out << " err_phys = " << std::setw(11) << val; break;
133  case 3: break;
134  }
135  // ending:
136  switch ((mode/12)%4)
137  {
138  case 0: break;
139  case 1: out << '\n'; break;
140  case 2: out << " (converged)\n"; break;
141  case 3: out << " (actual)\n"; break;
142  }
143 }
144 
146  const Vector &pt,
147  const char *suffix)
148 {
149  std::ostream &out = mfem::out;
150 
151  out << prefix << " = (";
152  for (int j = 0; j < pt.Size(); j++)
153  {
154  out << (j > 0 ? ", " : "") << pt(j);
155  }
156  out << ')' << suffix;
157 }
158 
160  IntegrationPoint &ip)
161 {
162  MFEM_ASSERT(pt.Size() == T->GetSpaceDim(), "invalid point");
163 
164  const double phys_tol = phys_rtol*pt.Normlinf();
165 
166  const int geom = T->GetGeometryType();
167  const int dim = T->GetDimension();
168  const int sdim = T->GetSpaceDim();
169  IntegrationPoint xip, prev_xip;
170  double xd[3], yd[3], dxd[3], dx_norm = -1.0, err_phys, real_dx_norm = -1.0;
171  Vector x(xd, dim), y(yd, sdim), dx(dxd, dim);
172  bool hit_bdr = false, prev_hit_bdr = false;
173 
174  // Use ip0 as initial guess:
175  xip = *ip0;
176  xip.Get(xd, dim); // xip -> x
177  if (print_level >= 3)
178  {
179  NewtonPrint(1, 0.); // iter 0
180  NewtonPrintPoint(", ref_pt", x, "\n");
181  }
182 
183  for (int it = 0; true; )
184  {
185  // Remarks:
186  // If f(x) := 1/2 |pt-F(x)|^2, then grad(f)(x) = -J^t(x) [pt-F(x)].
187  // Linearize F(y) at y=x: F(y) ~ L[x](y) := F(x) + J(x) [y-x].
188  // Newton iteration for F(y)=b is given by L[x_old](x_new) = b, i.e.
189  // F(x_old) + J(x_old) [x_new-x_old] = b.
190  //
191  // To minimize: 1/2 |F(y)-b|^2, subject to: l(y) >= 0, we may consider the
192  // iteration: minimize: |L[x_old](x_new)-b|^2, subject to l(x_new) >= 0,
193  // i.e. minimize: |F(x_old) + J(x_old) [x_new-x_old] - b|^2.
194 
195  // This method uses:
196  // Newton iteration: x := x + J(x)^{-1} [pt-F(x)]
197  // or when dim != sdim: x := x + [J^t.J]^{-1}.J^t [pt-F(x)]
198 
199  // Compute the physical coordinates of the current point:
200  T->Transform(xip, y);
201  if (print_level >= 3)
202  {
203  NewtonPrint(11, 0.); // continuation line
204  NewtonPrintPoint("approx_pt", y, ", ");
205  NewtonPrintPoint("exact_pt", pt, "\n");
206  }
207  subtract(pt, y, y); // y = pt-y
208 
209  // Check for convergence in physical coordinates:
210  err_phys = y.Normlinf();
211  if (err_phys < phys_tol)
212  {
213  if (print_level >= 1)
214  {
215  NewtonPrint(1, (double)it);
216  NewtonPrint(3, dx_norm);
217  NewtonPrint(30, err_phys);
218  }
219  ip = xip;
220  if (solver_type != Newton) { return Inside; }
221  return Geometry::CheckPoint(geom, ip, ip_tol) ? Inside : Outside;
222  }
223  if (print_level >= 1)
224  {
225  if (it == 0 || print_level >= 2)
226  {
227  NewtonPrint(1, (double)it);
228  NewtonPrint(3, dx_norm);
229  NewtonPrint(18, err_phys);
230  }
231  }
232 
233  if (hit_bdr)
234  {
235  xip.Get(xd, dim); // xip -> x
236  if (prev_hit_bdr || it == max_iter || print_level >= 2)
237  {
238  prev_xip.Get(dxd, dim); // prev_xip -> dx
239  subtract(x, dx, dx); // dx = xip - prev_xip
240  real_dx_norm = dx.Normlinf();
241  if (print_level >= 2)
242  {
243  NewtonPrint(41, real_dx_norm);
244  }
245  if (prev_hit_bdr && real_dx_norm < ref_tol)
246  {
247  if (print_level >= 0)
248  {
249  if (print_level <= 1)
250  {
251  NewtonPrint(1, (double)it);
252  NewtonPrint(3, dx_norm);
253  NewtonPrint(18, err_phys);
254  NewtonPrint(41, real_dx_norm);
255  }
256  mfem::out << "Newton: *** stuck on boundary!\n";
257  }
258  return Outside;
259  }
260  }
261  }
262 
263  if (it == max_iter) { break; }
264 
265  // Perform a Newton step:
266  T->SetIntPoint(&xip);
267  T->InverseJacobian().Mult(y, dx);
268  x += dx;
269  it++;
270  if (solver_type != Newton)
271  {
272  prev_xip = xip;
273  prev_hit_bdr = hit_bdr;
274  }
275  xip.Set(xd, dim); // x -> xip
276 
277  // Perform projection based on solver_type:
278  switch (solver_type)
279  {
280  case Newton: break;
282  hit_bdr = !Geometry::ProjectPoint(geom, prev_xip, xip); break;
284  hit_bdr = !Geometry::ProjectPoint(geom, xip); break;
285  default: MFEM_ABORT("invalid solver type");
286  }
287  if (print_level >= 3)
288  {
289  NewtonPrint(1, double(it));
290  xip.Get(xd, dim); // xip -> x
291  NewtonPrintPoint(", ref_pt", x, "\n");
292  }
293 
294  // Check for convergence in reference coordinates:
295  dx_norm = dx.Normlinf();
296  if (dx_norm < ref_tol)
297  {
298  if (print_level >= 1)
299  {
300  NewtonPrint(1, (double)it);
301  NewtonPrint(27, dx_norm);
302  }
303  ip = xip;
304  if (solver_type != Newton) { return Inside; }
305  return Geometry::CheckPoint(geom, ip, ip_tol) ? Inside : Outside;
306  }
307  }
308  if (print_level >= 0)
309  {
310  if (print_level <= 1)
311  {
312  NewtonPrint(1, (double)max_iter);
313  NewtonPrint(3, dx_norm);
314  NewtonPrint(18, err_phys);
315  if (hit_bdr) { NewtonPrint(41, real_dx_norm); }
316  }
317  mfem::out << "Newton: *** iteration did not converge!\n";
318  }
319  ip = xip;
320  return Unknown;
321 }
322 
324  IntegrationPoint &ip)
325 {
326  MFEM_VERIFY(T != NULL, "invalid ElementTransformation");
327 
328  // Select initial guess ...
329  switch (init_guess_type)
330  {
331  case Center:
333  break;
334 
335  case ClosestPhysNode:
336  case ClosestRefNode:
337  {
338  const int order = std::max(T->Order()+rel_qpts_order, 0);
339  if (order == 0)
340  {
342  }
343  else
344  {
345  const int old_type = GlobGeometryRefiner.GetType();
347  RefinedGeometry &RefG =
349  int closest_idx = (init_guess_type == ClosestPhysNode) ?
350  FindClosestPhysPoint(pt, RefG.RefPts) :
351  FindClosestRefPoint(pt, RefG.RefPts);
352  ip0 = &RefG.RefPts.IntPoint(closest_idx);
353  GlobGeometryRefiner.SetType(old_type);
354  }
355  break;
356  }
357 
358  case GivenPoint:
359  break;
360 
361  default:
362  MFEM_ABORT("invalid initial guess type");
363  }
364 
365  // Call the solver ...
366  return NewtonSolve(pt, ip);
367 }
368 
369 
371  Geometry::Type GeomType)
372 {
373  switch (GeomType)
374  {
375  case Geometry::POINT : FElem = &PointFE; break;
376  case Geometry::SEGMENT : FElem = &SegmentFE; break;
377  case Geometry::TRIANGLE : FElem = &TriangleFE; break;
378  case Geometry::SQUARE : FElem = &QuadrilateralFE; break;
379  case Geometry::TETRAHEDRON : FElem = &TetrahedronFE; break;
380  case Geometry::CUBE : FElem = &HexahedronFE; break;
381  case Geometry::PRISM : FElem = &WedgeFE; break;
382  default:
383  MFEM_ABORT("unknown Geometry::Type!");
384  }
385  int dim = FElem->GetDim();
386  int dof = FElem->GetDof();
387  const IntegrationRule &nodes = FElem->GetNodes();
388  PointMat.SetSize(dim, dof);
389  for (int j = 0; j < dof; j++)
390  {
391  nodes.IntPoint(j).Get(&PointMat(0,j), dim);
392  }
393  geom = GeomType;
394  space_dim = dim;
395 }
396 
397 const DenseMatrix &IsoparametricTransformation::EvalJacobian()
398 {
399  MFEM_ASSERT(space_dim == PointMat.Height(),
400  "the IsoparametricTransformation has not been finalized;"
401  " call FinilizeTransformation() after setup");
402  MFEM_ASSERT((EvalState & JACOBIAN_MASK) == 0, "");
403 
404  dshape.SetSize(FElem->GetDof(), FElem->GetDim());
405  dFdx.SetSize(PointMat.Height(), dshape.Width());
406  if (dshape.Width() > 0)
407  {
408  FElem->CalcDShape(*IntPoint, dshape);
409  Mult(PointMat, dshape, dFdx);
410  }
412 
413  return dFdx;
414 }
415 
416 const DenseMatrix &IsoparametricTransformation::EvalHessian()
417 {
418  MFEM_ASSERT(space_dim == PointMat.Height(),
419  "the IsoparametricTransformation has not been finalized;"
420  " call FinilizeTransformation() after setup");
421  MFEM_ASSERT((EvalState & HESSIAN_MASK) == 0, "");
422 
423  int Dim = FElem->GetDim();
424  d2shape.SetSize(FElem->GetDof(), (Dim*(Dim+1))/2);
425  d2Fdx2.SetSize(PointMat.Height(), d2shape.Width());
426  if (d2shape.Width() > 0)
427  {
428  FElem->CalcHessian(*IntPoint, d2shape);
429  Mult(PointMat, d2shape, d2Fdx2);
430  }
432 
433  return d2Fdx2;
434 }
435 
437 {
438  switch (FElem->Space())
439  {
440  case FunctionSpace::Pk:
441  return (FElem->GetOrder()-1);
442  case FunctionSpace::Qk:
443  return (FElem->GetOrder());
444  default:
445  mfem_error("IsoparametricTransformation::OrderJ()");
446  }
447  return 0;
448 }
449 
451 {
452  switch (FElem->Space())
453  {
454  case FunctionSpace::Pk:
455  return (FElem->GetOrder() - 1) * FElem->GetDim();
456  case FunctionSpace::Qk:
457  return (FElem->GetOrder() * FElem->GetDim() - 1);
458  default:
459  mfem_error("IsoparametricTransformation::OrderW()");
460  }
461  return 0;
462 }
463 
465 {
466  if (FElem->Space() == fe->Space())
467  {
468  int k = FElem->GetOrder();
469  int d = FElem->GetDim();
470  int l = fe->GetOrder();
471  switch (fe->Space())
472  {
473  case FunctionSpace::Pk:
474  return ((k-1)*(d-1)+(l-1));
475  case FunctionSpace::Qk:
476  return (k*(d-1)+(l-1));
477  }
478  }
479  mfem_error("IsoparametricTransformation::OrderGrad(...)");
480  return 0;
481 }
482 
484  Vector &trans)
485 {
486  shape.SetSize(FElem->GetDof());
487  trans.SetSize(PointMat.Height());
488 
489  FElem -> CalcShape(ip, shape);
490  PointMat.Mult(shape, trans);
491 }
492 
494  DenseMatrix &tr)
495 {
496  int dof, n, dim, i, j, k;
497 
498  dim = PointMat.Height();
499  dof = FElem->GetDof();
500  n = ir.GetNPoints();
501 
502  shape.SetSize(dof);
503  tr.SetSize(dim, n);
504 
505  for (j = 0; j < n; j++)
506  {
507  FElem -> CalcShape (ir.IntPoint(j), shape);
508  for (i = 0; i < dim; i++)
509  {
510  tr(i, j) = 0.0;
511  for (k = 0; k < dof; k++)
512  {
513  tr(i, j) += PointMat(i, k) * shape(k);
514  }
515  }
516  }
517 }
518 
520  DenseMatrix &result)
521 {
522  MFEM_ASSERT(matrix.Height() == GetDimension(), "invalid input");
523  result.SetSize(PointMat.Height(), matrix.Width());
524 
525  IntegrationPoint ip;
526  Vector col;
527 
528  for (int j = 0; j < matrix.Width(); j++)
529  {
530  ip.Set(matrix.GetColumn(j), matrix.Height());
531 
532  result.GetColumnReference(j, col);
533  Transform(ip, col);
534  }
535 }
536 
538  IntegrationPoint &ip2)
539 {
540  double vec[3];
541  Vector v (vec, Transf.GetPointMat().Height());
542 
543  Transf.Transform (ip1, v);
544  ip2.Set(vec, v.Size());
545 }
546 
548  IntegrationRule &ir2)
549 {
550  int i, n;
551 
552  n = ir1.GetNPoints();
553  for (i = 0; i < n; i++)
554  {
555  Transform (ir1.IntPoint(i), ir2.IntPoint(i));
556  }
557 }
558 
559 }
int GetNPoints() const
Returns the number of the points in the integration rule.
Definition: intrules.hpp:245
Abstract class for Finite Elements.
Definition: fe.hpp:232
void Set(const double *p, const int dim)
Definition: intrules.hpp:37
int NewtonSolve(const Vector &pt, IntegrationPoint &ip)
Definition: eltrans.cpp:159
void Get(double *p, const int dim) const
Definition: intrules.hpp:51
int GetDim() const
Returns the reference space dimension for the finite element.
Definition: fe.hpp:308
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
DenseMatrix & GetPointMat()
Read and write access to the underlying point matrix describing the transformation.
Definition: eltrans.hpp:321
Use a specific point, set with SetInitialGuess().
Definition: eltrans.hpp:130
Geometry::Type GetGeometryType() const
Return the Geometry::Type of the reference element.
Definition: eltrans.hpp:92
const IntegrationPoint * IntPoint
Definition: eltrans.hpp:26
ElementTransformation * T
Definition: eltrans.hpp:161
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:407
const Geometry::Type geom
Definition: ex1.cpp:40
Use the center of the reference element.
Definition: eltrans.hpp:121
virtual int Transform(const Vector &pt, IntegrationPoint &ip)
Given a point, pt, in physical space, find its reference coordinates, ip.
Definition: eltrans.cpp:323
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Definition: table.cpp:476
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
Definition: operator.hpp:63
int GetDimension() const
Return the dimension of the reference element.
Definition: eltrans.hpp:95
void SetIntPoint(const IntegrationPoint *ip)
Definition: eltrans.hpp:56
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
Definition: densemat.cpp:2089
void NewtonPrint(int mode, double val)
Definition: eltrans.cpp:116
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition: fe.hpp:318
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
int Size() const
Returns the size of the vector.
Definition: vector.hpp:157
const DenseMatrix & EvalAdjugateJ()
Definition: eltrans.cpp:34
int Space() const
Returns the type of space on each element.
Definition: fe.hpp:328
const DenseMatrix & InverseJacobian()
Definition: eltrans.hpp:82
double Normlinf() const
Returns the l_infinity norm of the vector.
Definition: vector.cpp:729
Tensor products of polynomials of order k.
Definition: fe.hpp:216
virtual void Transform(const IntegrationPoint &, Vector &)
Definition: eltrans.cpp:483
Polynomials of order k.
Definition: fe.hpp:215
const IntegrationPoint & GetCenter(int GeomType)
Return the center of the given Geometry::Type, GeomType.
Definition: geom.hpp:70
void NewtonPrintPoint(const char *prefix, const Vector &pt, const char *suffix)
Definition: eltrans.cpp:145
int FindClosestRefPoint(const Vector &pt, const IntegrationRule &ir)
Find the IntegrationPoint mapped closest to pt, using a norm that approximates the (unknown) distance...
Definition: eltrans.cpp:84
double Weight() const
Definition: densemat.cpp:506
PointFiniteElement PointFE
Definition: point.cpp:30
Geometry Geometries
Definition: fe.cpp:12638
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Definition: intrules.hpp:248
The point is inside the element.
Definition: eltrans.hpp:154
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Definition: operator.hpp:57
void SetType(const int t)
Set the Quadrature1D type of points to use for subdivision.
Definition: geom.hpp:263
The point is probably outside the element.
Definition: eltrans.hpp:155
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
Definition: error.cpp:153
virtual int OrderGrad(const FiniteElement *fe)
Order of adj(J)^t.grad(fi)
Definition: eltrans.cpp:464
const DenseMatrix & Jacobian()
Return the Jacobian matrix of the transformation at the currently set IntegrationPoint, using the method SetIntPoint().
Definition: eltrans.hpp:71
TriLinear3DFiniteElement HexahedronFE
Definition: hexahedron.cpp:52
int GetSpaceDim() const
Get the dimension of the target (physical) space.
Definition: eltrans.hpp:100
const IntegrationRule & GetNodes() const
Definition: fe.hpp:367
GeometryRefiner GlobGeometryRefiner
Definition: geom.cpp:1395
IntegrationRule RefPts
Definition: geom.hpp:239
RefinedGeometry * Refine(Geometry::Type Geom, int Times, int ETimes=1)
Definition: geom.cpp:925
void GetColumn(int c, Vector &col) const
Definition: densemat.cpp:1287
double DistanceTo(const double *p) const
Compute the Euclidean distance to another vector.
Definition: vector.hpp:542
void trans(const Vector &x, Vector &p)
Definition: toroid.cpp:239
class H1_WedgeElement WedgeFE
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
Definition: densemat.cpp:2197
const DenseMatrix & EvalInverseJ()
Definition: eltrans.cpp:44
static bool ProjectPoint(int GeomType, const IntegrationPoint &beg, IntegrationPoint &end)
Project a point end, onto the given Geometry::Type, GeomType.
Definition: geom.cpp:511
void SetIdentityTransformation(Geometry::Type GeomType)
Definition: eltrans.cpp:370
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition: fe.hpp:314
void subtract(const Vector &x, const Vector &y, Vector &z)
Definition: vector.cpp:385
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:105
void Transform(const IntegrationPoint &, IntegrationPoint &)
Definition: eltrans.cpp:537
void GetColumnReference(int c, Vector &col)
Definition: densemat.hpp:270
class Linear3DFiniteElement TetrahedronFE
Definition: fe.cpp:12625
Linear2DFiniteElement TriangleFE
Definition: fe.cpp:12621
Class for integration point with weight.
Definition: intrules.hpp:25
The algorithm failed to determine where the point is.
Definition: eltrans.hpp:156
int GetType() const
Get the Quadrature1D type of points used for subdivision.
Definition: geom.hpp:265
int dim
Definition: ex24.cpp:43
int FindClosestPhysPoint(const Vector &pt, const IntegrationRule &ir)
Find the IntegrationPoint mapped closest to pt.
Definition: eltrans.cpp:57
IsoparametricTransformation Transf
Definition: eltrans.hpp:347
Vector data type.
Definition: vector.hpp:48
void Mult(const double *x, double *y) const
Matrix vector multiplication.
Definition: densemat.cpp:173
virtual void Transform(const IntegrationPoint &, Vector &)=0
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
Definition: geom.cpp:348
const IntegrationPoint * ip0
Definition: eltrans.hpp:164
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Definition: densemat.hpp:90
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Definition: globals.hpp:66
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
BiLinear2DFiniteElement QuadrilateralFE
Linear1DFiniteElement SegmentFE
Definition: segment.cpp:49