19 :
Operator(), mesh_(mesh), order_(order), dim_(mesh_.SpaceDimension()),
20 vdim_(mesh_.SpaceDimension()), ne_(mesh_.GetNE()), h1_fec_(order_, dim_),
29 out <<
"#dofs: " << global_tdof_size << std::endl;
138 const auto d_dX = dX.
Read();
143 d_Y[d_ess_tdof_list[i]] = d_dX[d_ess_tdof_list[i]];
164 for (
int i = 0; i <
dim_; i++)
171 Vector vin_local, vout_local;
172 vin_local.
MakeRef(Ke_diag, i * sce_sz, sce_sz);
173 vout_local.
MakeRef(K_diag_local, i * scl_sz, scl_sz);
181 vout.
MakeRef(K_diag, i * sct_sz, sct_sz);
194 int submat = ess_idx % num_submats;
195 int row = ess_idx / num_submats;
196 for (
int j = 0; j <
dim_; j++)
200 K_diag_submats(submat, row, j) = 1.0;
204 K_diag_submats(submat, row, j) = 0.0;
205 K_diag_submats(submat, j, row) = 0.0;
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
std::function< void(const int, const Array< double > &, const Array< double > &, const Array< double > &, const Vector &, const Vector &, const Vector &, Vector &)> element_kernel_assemble_diagonal_wrapper
Wrapper for the assembly of the gradient on each diagonal element.
void SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
Class for an integration rule - an Array of IntegrationPoint.
virtual const Operator * GetProlongationMatrix() const
The returned Operator is owned by the FiniteElementSpace.
const GeometricFactors * geometric_factors_
Vector X_el_
Input state E-vector.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
const GeometricFactors * GetGeometricFactors(const IntegrationRule &ir, const int flags, MemoryType d_mt=MemoryType::DEFAULT)
Return the mesh geometric factors corresponding to the given integration rule.
void SetSize(int s)
Resize the vector to size s.
virtual void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
const Operator * h1_prolongation_
int Size() const
Returns the size of the vector.
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
virtual double * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
virtual void Mult(const Vector &U, Vector &Y) const override
Compute the residual Y = R(U) representing the elasticity equation with a material model chosen by ca...
ElasticityOperator(ParMesh &mesh, const int order)
virtual const double * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number...
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
void AssembleGradientDiagonal(Vector &Ke_diag, Vector &K_diag_local, Vector &K_diag) const
Assemble the linearization of the residual K = dR(U)/dU.
Memory< double > & GetMemory()
Return a reference to the Memory object used by the Vector.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
const ElementRestrictionOperator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
std::function< void(const int, const Array< double > &, const Array< double > &, const Array< double > &, const Vector &, const Vector &, const Vector &, Vector &, const Vector &)> element_apply_gradient_kernel_wrapper
Wrapper for the application of the gradient of the residual.
Vector J
Jacobians of the element transformations at all quadrature points.
const Array< double > & GetWeights() const
Return the quadrature weights in a contiguous array.
Vector Y_el_
Output state E-Vector.
Vector detJ
Determinants of the Jacobians at all quadrature points.
void SyncAlias(const Memory &base, int alias_size) const
Update the alias Memory *this to match the memory location (all valid locations) of its base Memory...
ParMesh * GetParMesh() const
int q1d_
Number of quadrature points in 1D.
const Operator * h1_element_restriction_
const T * HostRead() const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), false).
HYPRE_BigInt GlobalTrueVSize() const
Vector X_local_
Input state L-vector.
Vector Y_local_
Output state L-vector.
int GetVDim() const
Returns vector dimension.
virtual const FiniteElement * GetFE(int i) const
const int ne_
Number of elements in the mesh (rank local)
void forall(int N, lambda &&body)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
int GetOrder(int i) const
Returns the polynomial degree of the i'th finite element.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
The ordering method used when the number of unknowns per mesh node (vector dimension) is bigger than ...
int height
Dimension of the output / number of rows in the matrix.
Array< double > B
Basis functions evaluated at quadrature points.
virtual int GetTrueVSize() const
Return the number of local vector true dofs.
ElasticityGradientOperator is a wrapper class to pass ElasticityOperator::AssembleGradientDiagonal an...
int d1d_
Number of degrees of freedom in 1D.
virtual double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
Array< int > ess_tdof_list_
std::function< void(const int, const Array< double > &, const Array< double > &, const Array< double > &, const Vector &, const Vector &, const Vector &, Vector &)> element_apply_kernel_wrapper
Wrapper for the application of the residual R(U).
Array< double > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
Lexicographic ordering for tensor-product FiniteElements.
int Size() const
Return the logical size of the array.
NQPT x VDIM x NE (values) / NQPT x VDIM x DIM x NE (grads)
void GradientMult(const Vector &dX, Vector &Y) const
Multiply the linearization of the residual R(U) wrt to the current state U by a perturbation dX...
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
ParFiniteElementSpace h1_fes_
H1 finite element space.
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
Class for parallel meshes.
Operator & GetGradient(const Vector &U) const override
Get the Gradient object.
int width
Dimension of the input / number of columns in the matrix.