25 for (
int i = 0; i < D.
Size(); i++)
40 for (
int i = 0; i < D.
Size(); i++)
52 int dim, ndof1, ndof2, ndof, ndoftotal;
60 ndof1 : ndof1 + ndof2;
69 marker1 = (*elem_marker)[elem1];
83 marker2 = (*elem_marker)[elem2];
129 ndof = elem1f ? ndof1 : ndof2;
142 Vector dshapephysdd(ndof);
171 for (
int i = 0; i <
dim; i++)
174 grad_phys_dir[i]->CopyRows(grad_phys, i*ndof, (i+1)*ndof-1);
182 for (
int i = 0; i <
nterms; i++)
184 int sz1 =
static_cast<int>(pow(
dim, i+1));
186 int loc_col_per_dof = sz1;
187 int tot_col_per_dof = loc_col_per_dof*
dim;
188 for (
int k = 0; k <
dim; k++)
190 grad_work.
SetSize(ndof, ndof*sz1);
196 Mult(*grad_phys_dir[k], grad_phys_work, grad_work);
200 Mult(*grad_phys_dir[k], *dkphi_dxk[i-1], grad_work);
204 for (
int j = 0; j < ndof; j++)
206 for (
int d = 0; d < loc_col_per_dof; d++)
209 grad_work.
GetColumn(j*loc_col_per_dof+d, col);
210 dkphi_dxk[i]->SetCol(j*tot_col_per_dof+k*loc_col_per_dof+d, col);
216 for (
int i = 0; i < grad_phys_dir.
Size(); i++)
218 delete grad_phys_dir[i];
223 for (
int i = 1; i <
nterms; i++)
225 Factorial(i) = Factorial(i-1)*(i+2);
231 Vector q_hess_dot_d(ndof);
251 nor(0) = 2*eip1.
x - 1.0;
262 if (!elem1f) {
nor *= -1; }
291 for (
int i = 0; i <
nterms; i++)
293 int sz1 =
static_cast<int>(pow(
dim, i+1));
296 dkphi_dxk[i]->MultTranspose(
shape, T1_wrk);
300 for (
int j = 0; j < i+1; j++)
302 int sz2 =
static_cast<int>(pow(
dim, i-j));
308 Vector q_hess_dot_d_work(ndof);
310 q_hess_dot_d_work *= 1./Factorial(i);
311 q_hess_dot_d += q_hess_dot_d_work;
328 int offset = elem1f ? 0 : ndof1;
329 elmat.
CopyMN(temp_elmat, offset, offset);
331 for (
int i = 0; i < dkphi_dxk.
Size(); i++)
341 mfem_error(
"SBM2DirichletLFIntegrator::AssembleRHSElementVect");
354 int dim, ndof1, ndof2, ndof, ndoftotal;
361 ndoftotal = ndof1 + ndof2;
374 marker1 = (*elem_marker)[elem1];
388 marker2 = (*elem_marker)[elem2];
438 int offset = elem1f ? 0 : ndof1;
477 for (
int i = 0; i <
dim; i++)
480 grad_phys_dir[i]->CopyRows(grad_phys, i*ndof, (i+1)*ndof-1);
489 for (
int i = 0; i <
nterms; i++)
491 int sz1 =
static_cast<int>(pow(
dim, i+1));
493 int loc_col_per_dof = sz1;
494 for (
int k = 0; k <
dim; k++)
496 grad_work.
SetSize(ndof, ndof*sz1);
502 Mult(*grad_phys_dir[k], grad_phys_work, grad_work);
506 Mult(*grad_phys_dir[k], *dkphi_dxk[i-1], grad_work);
510 for (
int j = 0; j < ndof; j++)
512 for (
int d = 0; d < loc_col_per_dof; d++)
515 int tot_col_per_dof = loc_col_per_dof*
dim;
516 grad_work.
GetColumn(j*loc_col_per_dof+d, col);
517 dkphi_dxk[i]->SetCol(j*tot_col_per_dof+k*loc_col_per_dof+d, col);
523 for (
int i = 0; i < grad_phys_dir.
Size(); i++)
525 delete grad_phys_dir[i];
530 for (
int i = 1; i <
nterms; i++)
532 Factorial(i) = Factorial(i-1)*(i+2);
538 Vector q_hess_dot_d(ndof);
558 nor(0) = 2*eip.
x - 1.0;
567 if (!elem1f) {
nor *= -1; }
610 for (
int i = 0; i <
nterms; i++)
612 int sz1 =
static_cast<int>(pow(
dim, i+1));
615 dkphi_dxk[i]->MultTranspose(
shape, T1_wrk);
619 for (
int j = 0; j < i+1; j++)
621 int sz2 =
static_cast<int>(pow(
dim, i-j));
627 Vector q_hess_dot_d_work(ndof);
629 q_hess_dot_d_work *= 1./Factorial(i);
630 q_hess_dot_d += q_hess_dot_d_work;
636 temp_elvect.
Add(w, wrk);
639 for (
int i = 0; i < dkphi_dxk.
Size(); i++)
650 int dim, ndof1, ndof2, ndof, ndoftotal;
658 ndof1 : ndof1 + ndof2;
667 marker1 = (*elem_marker)[elem1];
682 marker2 = (*elem_marker)[elem2];
728 ndof = elem1f ? ndof1 : ndof2;
768 for (
int i = 0; i <
dim; i++)
771 grad_phys_dir[i]->CopyRows(grad_phys, i*ndof, (i+1)*ndof-1);
779 for (
int i = 0; i <
nterms; i++)
781 int sz1 =
static_cast<int>(pow(
dim, i+1));
783 int loc_col_per_dof = sz1;
784 int tot_col_per_dof = loc_col_per_dof*
dim;
785 for (
int k = 0; k <
dim; k++)
787 grad_work.
SetSize(ndof, ndof*sz1);
793 Mult(*grad_phys_dir[k], grad_phys_work, grad_work);
797 Mult(*grad_phys_dir[k], *dkphi_dxk[i-1], grad_work);
801 for (
int j = 0; j < ndof; j++)
803 for (
int d = 0; d < loc_col_per_dof; d++)
806 grad_work.
GetColumn(j*loc_col_per_dof+d, col);
807 dkphi_dxk[i]->SetCol(j*tot_col_per_dof+k*loc_col_per_dof+d, col);
813 for (
int i = 0; i < grad_phys_dir.
Size(); i++)
815 delete grad_phys_dir[i];
820 for (
int i = 1; i <
nterms; i++)
822 Factorial(i) = Factorial(i-1)*(i+1);
829 Vector q_hess_dot_d_nhat(ndof);
848 nor(0) = 2*eip1.
x - 1.0;
857 vN->
Eval(Nhat, Trans, ip, D);
860 if (!elem1f) {
nor *= -1; }
894 q_hess_dot_d_nhat = 0.;
895 for (
int i = 0; i <
nterms; i++)
897 int sz1 =
static_cast<int>(pow(
dim, i+1));
900 dkphi_dxk[i]->MultTranspose(
shape, T1_wrk);
904 for (
int j = 0; j < i+1; j++)
906 int sz2 =
static_cast<int>(pow(
dim, i-j));
912 Vector q_hess_dot_d_work(ndof);
914 q_hess_dot_d_work *= 1./Factorial(i);
915 q_hess_dot_d_nhat += q_hess_dot_d_work;
918 wrk = q_hess_dot_d_nhat;
919 wrk *= ip.
weight * n_dot_ntilde;
923 int offset = elem1f ? 0 : ndof1;
924 elmat.
CopyMN(temp_elmat, offset, offset);
926 for (
int i = 0; i < dkphi_dxk.
Size(); i++)
935 mfem_error(
"SBM2NeumannLFIntegrator::AssembleRHSElementVect");
948 int dim, ndof1, ndof2, ndof, ndoftotal;
955 ndoftotal = ndof1 + ndof2;
968 marker1 = (*elem_marker)[elem1];
982 marker2 = (*elem_marker)[elem2];
1031 int offset = elem1f ? 0 : ndof1;
1062 nor(0) = 2*eip.
x - 1.0;
1069 vN->
Eval(Nhat, Tr, ip, D);
1072 if (!elem1f) {
nor *= -1; }
1088 temp_elvect.
Add(1., wrk);
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
int Find(const T &el) const
Return the first index where 'el' is found; return -1 if not found.
Data type dense matrix using column-major storage.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
void MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
real_t * GetData() const
Returns the matrix data array.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
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 GetColumn(int c, Vector &col) const
Abstract class for all finite elements.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
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...
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement....
int GetDim() const
Returns the reference space dimension for the finite element.
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...
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...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Class for integration point with weight.
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
virtual void AssembleFaceMatrix(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Trans, DenseMatrix &elmat)
int par_shared_face_count
ShiftedFunctionCoefficient * uD
int par_shared_face_count
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
ShiftedVectorFunctionCoefficient * vN
int par_shared_face_count
virtual void AssembleFaceMatrix(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Trans, DenseMatrix &elmat)
ShiftedFunctionCoefficient * uN
ShiftedVectorFunctionCoefficient * vN
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
int par_shared_face_count
std::function< real_t(const Vector &)> Function
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
std::function< void(const Vector &, Vector &)> Function
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
int GetVDim()
Returns dimension of the vector.
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 SetDataAndSize(real_t *d, int s)
Set the Vector data and size.
Vector & Set(const real_t a, const Vector &x)
(*this) = a * x
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
Vector & Add(const real_t a, const Vector &Va)
(*this) += a * Va
void CalcOrtho(const DenseMatrix &J, Vector &n)
void mfem_error(const char *msg)
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void AddMult_a_VWt(const real_t a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
void AddMult_a_VVt(const real_t a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
real_t p(const Vector &x, real_t t)