Comments (2)
I realized the integral computation was way off. I think after projecting the gradient degrees of freedom back onto the finite dimensional space of the solution, the integral,
Here is the updated code:
vfes->GetElementVDofs(indx, vdof_indices);
sol.GetSubVector(vdof_indices, el_vdofs);
fe->ProjectGrad(*fe, *Tr, grad_matrix);
DenseMatrix vdof_mat(el_vdofs.GetData(), ndofs, num_equations);
// beta is num_equations x num_stencil array
// columns of which are the beta values for the given element in the stencil
beta.GetColumnReference(j, beta_col);
.
.
.
Vector grad_vec(ndofs), Mdx(ndofs);
DenseMatrix mass_matrix(ndofs);
if (dim == 1)
{
grad_vdof_mat = vdof_mat;
for (int grad_level = 1; grad_level < order + 1; grad_level++)
{
int_order = 2 * fe->GetOrder() + Tr->OrderW();
const IntegrationRule* ir = &IntRules.Get(fe->GetGeomType(), int_order);
mfem::Mult(grad_matrix, grad_vdof_mat, tmp_mat);
grad_vdof_mat = tmp_mat;
integrand = 0.0;
mass_matrix = 0.0;
// Calculating the (extrapolated) mass integrator
for (int k = 0; k < ir->GetNPoints(); k++)
{
const IntegrationPoint &ip = ir->IntPoint(k);
// j = 0 is the index of the target/troubled element; this is where the integral is evaluated
if (j != 0)
{
Tr_target->Transform(ip, phys_ip);
Tr->TransformBack(phys_ip, extrap_ip);
Tr->SetIntPoint(&extrap_ip);
fe->CalcPhysShape(*Tr, shape);
}
else
{
Tr->SetIntPoint(&ip);
fe->CalcPhysShape(*Tr, shape);
}
w = Tr->Weight() * ip.weight;
AddMult_a_VVt(w, shape, mass_matrix);
}
// x^T M x quadratic form calculation where x are the gradient degrees of freedom
for (int eq = 0 ; eq < num_equations; eq++)
{
grad_vdof_mat.GetColumn(eq, grad_vect);
mass_matrix.Mult(grad_vect, Mdx);
integrand(eq) = grad_vect * Mdx;
}
integrand /= pow(factorial(grad_level), 2);
integrand *= pow(target_el_size, 2 * grad_level - 1);
beta_col += integrand;
}
}
Thank you very much.
from mfem.
I would appreciate if anyone could offer some insight. Thank you.
from mfem.
Related Issues (20)
- Custom IntegrationRule for VectorFEMassIntegrator HOT 2
- Add device tests of Example 14 (DG diffusion) HOT 3
- How to inverse block opeator matrix
- Possible memory leakage of HypreParMatrix HOT 2
- Evaluating integrals of shape functions in neighboring elements HOT 13
- 【VectorDomainLFIntegrator does not provided enough constructors】 HOT 3
- Changes to `socketbuf` result in `SocketStream` objects returning true even if not connected (e.g., to GLVis) HOT 5
- 【Is PWFunctionCoefficient possible?】 HOT 1
- Strange failure in LOBPCG::Solve() HOT 5
- Coefficient Projection for IGA Spaces HOT 5
- Apply double cross of a function by normal vector for Nedelec space.
- Fix the FMS unit test and the FMS example file `data/star-q3.fms`
- 3D electromagnetic proximity effect
- Implement AssemblePABoundary for VectorFEMassIntegrator HOT 2
- Suggested added feature: OptionsParser taking input from file
- HypreBoomerAMG preconditioner memory leaks HOT 6
- Error calling CUDA mfem::forall() with MFEM as a third party library HOT 3
- Maybe inconsistence of "domain_integes_marker" when construct a bilinearform with existed one
- Unit test "LOR AMS" failure with Umpire HOT 1
- parallel install error!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mfem.