25 for (
int i = 0; i < D.
Size(); i++)
37 int dim, ndof1, ndof2, ndof, ndoftotal;
45 ndof1 : ndof1 + ndof2;
54 marker1 = (*elem_marker)[elem1];
68 marker2 = (*elem_marker)[elem2];
74 if (marker1 == ShiftedFaceMarker::SBElementType::INSIDE &&
75 (marker2 == ShiftedFaceMarker::SBElementType::CUT ||
81 else if (marker1 == ShiftedFaceMarker::SBElementType::CUT &&
82 marker2 == ShiftedFaceMarker::SBElementType::INSIDE)
95 if (marker1 == ShiftedFaceMarker::SBElementType::CUT &&
96 (marker2 == ShiftedFaceMarker::SBElementType::OUTSIDE ||
102 else if (marker1 == ShiftedFaceMarker::SBElementType::OUTSIDE &&
103 marker2 == ShiftedFaceMarker::SBElementType::CUT)
114 ndof = elem1f ? ndof1 : ndof2;
127 Vector dshapephysdd(ndof);
156 for (
int i = 0; i <
dim; i++)
159 grad_phys_dir[i]->CopyRows(grad_phys, i*ndof, (i+1)*ndof-1);
163 grad_phys_work.
SetSize(ndof, ndof*dim);
167 for (
int i = 0; i <
nterms; i++)
169 int sz1 = pow(dim, i+1);
170 dkphi_dxk[i] =
new DenseMatrix(ndof, ndof*sz1*dim);
171 int loc_col_per_dof = sz1;
172 int tot_col_per_dof = loc_col_per_dof*
dim;
173 for (
int k = 0; k <
dim; k++)
175 grad_work.
SetSize(ndof, ndof*sz1);
181 Mult(*grad_phys_dir[k], grad_phys_work, grad_work);
185 Mult(*grad_phys_dir[k], *dkphi_dxk[i-1], grad_work);
189 for (
int j = 0; j < ndof; j++)
191 for (
int d = 0; d < loc_col_per_dof; d++)
194 grad_work.
GetColumn(j*loc_col_per_dof+d, col);
195 dkphi_dxk[i]->SetCol(j*tot_col_per_dof+k*loc_col_per_dof+d, col);
201 for (
int i = 0; i < grad_phys_dir.
Size(); i++)
203 delete grad_phys_dir[i];
208 for (
int i = 1; i <
nterms; i++)
210 Factorial(i) = Factorial(i-1)*(i+2);
216 Vector q_hess_dot_d(ndof);
236 nor(0) = 2*eip1.
x - 1.0;
246 double nor_dot_d =
nor*D;
279 for (
int i = 0; i <
nterms; i++)
281 int sz1 = pow(dim, i+1);
284 dkphi_dxk[i]->MultTranspose(
shape, T1_wrk);
288 for (
int j = 0; j < i+1; j++)
290 int sz2 = pow(dim, i-j);
296 Vector q_hess_dot_d_work(ndof);
298 q_hess_dot_d_work *= 1./Factorial(i);
299 q_hess_dot_d += q_hess_dot_d_work;
316 int offset = elem1f ? 0 : ndof1;
317 elmat.
CopyMN(temp_elmat, offset, offset);
320 for (
int i = 0; i < dkphi_dxk.
Size(); i++)
330 mfem_error(
"SBM2DirichletLFIntegrator::AssembleRHSElementVect");
343 int dim, ndof1, ndof2, ndof, ndoftotal;
350 ndoftotal = ndof1 + ndof2;
363 marker1 = (*elem_marker)[elem1];
377 marker2 = (*elem_marker)[elem2];
383 if ( marker1 == ShiftedFaceMarker::SBElementType::INSIDE &&
384 (marker2 == ShiftedFaceMarker::SBElementType::CUT ||
391 else if (marker1 == ShiftedFaceMarker::SBElementType::CUT &&
392 marker2 == ShiftedFaceMarker::SBElementType::INSIDE)
406 if (marker1 == ShiftedFaceMarker::SBElementType::CUT &&
407 (marker2 == ShiftedFaceMarker::SBElementType::OUTSIDE ||
414 else if (marker1 == ShiftedFaceMarker::SBElementType::OUTSIDE &&
415 marker2 == ShiftedFaceMarker::SBElementType::CUT)
466 for (
int i = 0; i <
dim; i++)
469 grad_phys_dir[i]->CopyRows(grad_phys, i*ndof, (i+1)*ndof-1);
474 grad_phys_work.
SetSize(ndof, ndof*dim);
478 for (
int i = 0; i <
nterms; i++)
480 int sz1 = pow(dim, i+1);
481 dkphi_dxk[i] =
new DenseMatrix(ndof, ndof*sz1*dim);
482 int loc_col_per_dof = sz1;
483 for (
int k = 0; k <
dim; k++)
485 grad_work.
SetSize(ndof, ndof*sz1);
491 Mult(*grad_phys_dir[k], grad_phys_work, grad_work);
495 Mult(*grad_phys_dir[k], *dkphi_dxk[i-1], grad_work);
499 for (
int j = 0; j < ndof; j++)
501 for (
int d = 0; d < loc_col_per_dof; d++)
504 int tot_col_per_dof = loc_col_per_dof*
dim;
505 grad_work.
GetColumn(j*loc_col_per_dof+d, col);
506 dkphi_dxk[i]->SetCol(j*tot_col_per_dof+k*loc_col_per_dof+d, col);
512 for (
int i = 0; i < grad_phys_dir.
Size(); i++)
514 delete grad_phys_dir[i];
519 for (
int i = 1; i <
nterms; i++)
521 Factorial(i) = Factorial(i-1)*(i+2);
527 Vector q_hess_dot_d(ndof);
548 nor(0) = 2*eip.
x - 1.0;
556 double nor_dot_d =
nor*D;
603 for (
int i = 0; i <
nterms; i++)
605 int sz1 = pow(dim, i+1);
608 dkphi_dxk[i]->MultTranspose(
shape, T1_wrk);
612 for (
int j = 0; j < i+1; j++)
614 int sz2 = pow(dim, i-j);
620 Vector q_hess_dot_d_work(ndof);
622 q_hess_dot_d_work *= 1./Factorial(i);
623 q_hess_dot_d += q_hess_dot_d_work;
629 temp_elvect.
Add(w, wrk);
631 int offset = elem1f ? 0 : ndof1;
632 for (
int i = 0; i < temp_elvect.
Size(); i++)
634 elvect(i+offset) = temp_elvect(i);
638 for (
int i = 0; i < dkphi_dxk.
Size(); i++)
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for all finite elements.
int Size() const
Return the logical size of the array.
int GetDim() const
Returns the reference space dimension for the finite element.
Class for an integration rule - an Array of IntegrationPoint.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
void SetSize(int s)
Resize the vector to size s.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
double * GetData() const
Returns the matrix data array.
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
void CalcOrtho(const DenseMatrix &J, Vector &n)
int par_shared_face_count
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
void AddMult_a_VWt(const double a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
void AddMult_a_VVt(const double a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
int GetVDim()
Returns dimension of the vector.
void GetColumn(int c, Vector &col) const
double p(const Vector &x, double t)
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
Vector & Set(const double a, const Vector &x)
(*this) = a * x
std::function< double(const Vector &)> Function
Vector & Add(const double a, const Vector &Va)
(*this) += a * Va
Class for integration point with weight.
virtual void AssembleFaceMatrix(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Trans, DenseMatrix &elmat)
void Mult(const double *x, double *y) const
Matrix vector multiplication.
void CopyMN(const DenseMatrix &A, int m, int n, int Aro, int Aco)
Copy the m x n submatrix of A at row/col offsets Aro/Aco to *this.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
int par_shared_face_count
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...
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
ShiftedFunctionCoefficient * uD