Git Product home page Git Product logo

Comments (5)

sshiraiwa avatar sshiraiwa commented on July 19, 2024

@i3s93
In my environment, both work just fine. See below. Actually, I do recall that I encountered this issue before.
Reading mesh.cpp, this table is created from GetElementToFaceTable. And this method is, generally, called
when dim>2 (3D mesh). How are you creating the mesh object? Maybe there is a specific pattern in which the table
is not create.

Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mfem
>>> mfem.__version__
'4.5.0.2rc1'
>>> import mfem.ser as mfem
>>> mesh = mfem.Mesh('beam-tet.mesh')
>>> faces, orientations = mesh.GetElementFaces(2)
>>> faces
[7, 8, 6, 9]
>>> mesh.ElementToFaceTable()
<mfem._ser.table.Table; proxy of <Swig Object of type 'mfem::Table *' at 0x37a88b0> >

from pymfem.

i3s93 avatar i3s93 commented on July 19, 2024

Hi @sshiraiwa, thank you for your response. Actually, the mesh I used in my example is a 2-D Cartesian grid, which I create using mesh = mfem.Mesh(N_x, N_y, elem_type). As a workaround, I manually created this lookup table, which works fine, but I was hoping to just use the existing functionality. By any chance, do you recall what caused this issue before?

from pymfem.

i3s93 avatar i3s93 commented on July 19, 2024

@sshiraiwa Just to follow up, the issue only seems to happen when I use a Cartesian mesh. If I read in the mesh, as you have done, the error goes away. It looks like the table is not being generated for Cartesian meshes.

from pymfem.

v-dobrev avatar v-dobrev commented on July 19, 2024

Mesh::GetElementFaces is a 3D-only method. In 2D you probably want to call Mesh::GetElementEdges.

One has to be cautious -- sometimes mfem uses "faces" to refer to (dim-1)-dimensional mesh entities and sometimes to refer specifically to 2-dimensional mesh entities.

from pymfem.

sshiraiwa avatar sshiraiwa commented on July 19, 2024

@v-dobrev , Thank you for the clarification. @i3s93, closing this for now. Feel free to open if your issue is not resolved.

from pymfem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.