Comments (11)
Hi, the thing is that periodic meshes rely on discontinuous L2 maps (nodal function), which do the trick. The vertices are wrapped around while the map continues further, so you should not use vertices any longer and retrieve the coordinates only from the nodal function 👍 . You are right this is not mentioned in documentation anyhow, maybe we should fix it 🤔 , but if you look into the code of MakePeriodic
, it is the line periodic_mesh.SetCurvature(nodal_order, true);
which switches to the nodal function.
from mfem.
Ok, I made a PR for it #4302 . Please check if it makes sense to you 😉.
from mfem.
Btw, you may also use Mesh::GetNode()
, which is safe with or without a nodal function 😉
from mfem.
I tried Mesh::GetNode
and I have a different result from
ParGridFunction Answer // this was the answer to the solution of an elasticity problem
ParGridFunction nodes(Answer);
mesh->GetNodes(nodes);
mesh->GetElement(i)->GetVertices(tetra);
for(int j=0;j<4;j++)
{
vertex2[0]=nodes[3*tetra[j]];
vertex2[1]=nodes[3*tetra[j]+1];
vertex2[2]=nodes[3*tetra[j]+2];
}
If you remove MakePeriodic, the results are the same.
It's weird. Why is that? What is the correct result?
from mfem.
This is not right, this would work if you have H1 nodal function, but MakePeriodic()
uses discontinuous L2 function, which does not have DOFs at the vertices. If you prefer to use the nodal grid function directly instead of GetNode
, you should interpolate it as any other grid function through GetValue()
or you may use the method GetNodalValues()
to get values at the vertices 😉.
from mfem.
Thank you, for your answers. Unfortunately, I'm getting confused. I have a simple problem. Suppose I have calculated the solution of the elasticity problem on a periodic grid. I need to take a tetrahedron, get the coordinates of four points and the components of the solution for these four points (displacement vector).
Next I want to interpolate the solution inside the tetrahedron using barycentric coordinates. Seems simple, but because of the periodicity and what you said above, I am confused.
I want to do my own fast procedure. But I can't get the trivial values of the vertices of the tetrahedra and the solution at those vertices, I don't want to use interpolation as it is time consuming for large number of points.
from mfem.
What makes MFEM interpolation that slow? You may interpolate the solution using the builtin methods, which will work even with L2 nodal functions. However, if you insist you want to build it by yourself, I should correct myself, Mesh::SetCurvature()
actually uses L2 elements with GaussLobatto basis, so the DOFs are actually at the vertices. You may access them through GridFunction::GetElementDofValues()
without interpolation.
from mfem.
In general, the interpolation in the MFEM is quite fast. I need to interpolate the solution from a finite element mesh to a uniform mesh. In this case it is possible to take into account this particular feature of the problem and significantly speed up the calculations (about 50 - 100 times).
from mfem.
I see, so does it work with GridFunction::GetElementDofValues()
?
from mfem.
Yes, it works ! Thank you very much for your help.
from mfem.
Perfect! 😉 I am closing this in favor of #4302 (and already merged mfem/web#264 ).
from mfem.
Related Issues (20)
- inconformity of DOF for Nedelec Finite Element Space HOT 4
- 【The use of HypreParVector】 HOT 1
- 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
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.