Coder Social home page Coder Social logo

Geometry about gridap.jl HOT 9 CLOSED

gridap avatar gridap commented on June 12, 2024
Geometry

from gridap.jl.

Comments (9)

fverdugo avatar fverdugo commented on June 12, 2024

I have created a new API for geometry related objects. For the moment these 3 abstract types are enough:

  1. Grid Represents a FE mesh / grid. That is, list of nodal coordinates, and for each cell, the list of node ids on the boundary of the cell. The cells of the grid can be of any order.

  2. Triangulation. Represents a cloud of patches and provides the geomap. Minimum needed for cell-wise integration.

  3. GridGraph. Represents the connectivity information needed to generate the dof numbers in a FE space.

Usage:

using Numa.Geometry
using Numa.Geometry.Cartesian # defines the struct CartesianGrid
grid = CartesianGrid(partition=(10,20),domain=(0,1,0,1),order=1) # domain, and order are optional
trian = triangulation(grid) # Generates the Triangulation associated with this grid
graph = gridgraph(grid) # Generates the GridGraph associated with this grid.
phi = geomap(trian)
@show celltovefs(graph) # Show vefs for each cell
@show veftocells(graph) # Show cells around each vef

The FE space can already be rewritten in terms of this API. @santiagobadia, do I try to do this (i.e., to substitute Mesh and StructHexMesh for this new API), or do you prefer to do it yourself?

from gridap.jl.

santiagobadia avatar santiagobadia commented on June 12, 2024

Ok, I can do it!

from gridap.jl.

santiagobadia avatar santiagobadia commented on June 12, 2024

I have put some comments in the module. You can take them into consideration if you want.

I have changed the FESpace, but still,

  • FESpace must have a CellValue{RefFE} instead of only one RefFE.

from gridap.jl.

fverdugo avatar fverdugo commented on June 12, 2024

I have answered, the comments in line in the code. You can easily see them with git diff.

  • FESpace must have a CellValue{RefFE} instead of only one RefFE.

Note that this would be type unstable since the template parameter is not a concrete type. The way to go IMHO is to have a tuple of RefFE and then a CellValue{Int} that indexes it.

EDIT
This would also work

struct ConreteFESpace{....,R<:CellValue{<:RefFE}}
...
RefFEs::R
...
end

from gridap.jl.

santiagobadia avatar santiagobadia commented on June 12, 2024

Yes, I wrote it fast but I wanted to templatize FESpace with respect to typeof(reffe_array).
If what you wrote works, perfect.

from gridap.jl.

santiagobadia avatar santiagobadia commented on June 12, 2024

@fverdugo Could you put in the diagonal of connections the obvious identity? I see it is already in vertices but not for higher dimensional objects. It will help me to create a nface_dofs array, in which cells are also included.

By the way, I would stick to the following notation: Given a D dim environment

nface (or nf) : nfaces of dim 0:D
vef: nfaces of dim 0:D-1 (without D-dim nfaces, i.e., cells)

from gridap.jl.

fverdugo avatar fverdugo commented on June 12, 2024

Just do

(Numa) pkg> up UnstructuredGrids

and then remove the if in https://github.com/lssc-team/Numa.jl/blob/659af7b407cee9fe8896338a1edc897f172cf25b/src/Geometry/Unstructured.jl#L76
and the assertion in https://github.com/lssc-team/Numa.jl/blob/659af7b407cee9fe8896338a1edc897f172cf25b/src/Geometry/Geometry.jl#L216

from gridap.jl.

santiagobadia avatar santiagobadia commented on June 12, 2024

Perfect! I have now cells too...

from gridap.jl.

fverdugo avatar fverdugo commented on June 12, 2024

This issue has become obsolete. Closing it.

from gridap.jl.

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.