
From:  Konstantinos Poulios 
Subject:  Re: (E field  current) circulation 
Date:  Wed, 21 Jul 2021 11:01:25 +0200 
Dear Egor and Kostas,
Just to answer to Kostas, I do not remember either why the interface function edges is deprecated. It is useful and ther is no reason to remove it. May be we can "undeprecate" it !
And yes, the simplest way to make an integration on a 1D curve of a 3D domain is to define a 1D mesh (or a 2D one as suggested by Kostas) and to use the interpolate transformation tool (see http://getfem.org/userdoc/gasm_high.html#interpolatetransformations).
Best regards,
Yves
I don't remember either
Le 21/07/2021 à 04:50, Egor Vtorushin a écrit :
Thank you, Kostas. You are very dedicated!It is OK, there are few ways to go. People I think have just got used to the elegant and convenient way of integration in getfem and are becoming lazy to do some work :)Assuming that we have basic_dof_from_cvid and basic_dof_nodes method we have everything we need to implement Newton Cotes(for example) formulas manually for each edge.It just takes some extra code and timeI prefer this way, maybe i will try the projection/ interpolation approach soon.But just for your and Yves notes, even in mechanics(especially in fluids), evaluation of field circulation might be useful. Again it is not a problem or issue just extra sci/tech/eng serviceRegards and thank you for clarifying things, Egor
вт, 20 июл. 2021 г. в 20:24, Konstantinos Poulios <logari81@googlemail.com>:
Dear Egor,
Ok I suspected that you might be in 3D, but referring to "quad" made me assume that you were asking about 2D. In this case, the question is more tricky because GetFEM's architecture does not support 1D integrals in a 3D mesh. As you probably know, mesh regions can only contain convexes and convex faces. Integration methods are also defined only in convexes and convex faces. Hence I am not very positive that a solution exists based on the same 3D mesh.
The only solution that I see is by creating a 2D mesh from your 3D mesh. E.g. you could define a 2D mesh that contains all faces of a 3D simplex, and then integrate on the faces (i.e. edges of this 2D mesh). Or alternatively, you can also directly create a 1D mesh in 3D, based on the edges of your 3D mesh, but these are more difficult to extract.
In any case, working with 2 meshes, one 3D mesh, and one 2D (or 1D) mesh, will require you to transfer information between meshes using the different interpolation functions in GetFEM, e.g. using an identity interpolate transformation:
I hope that this helps you decide about a strategy and please ask again if you need help at lower level with the implementation of such a strategy. I have a vague impression that this question has also been discussed in the past in the mailing list, so you might be able to find some tips in older posts as well.
Not sure why the edges python function is marked as deprecated. @Yves: Do you have a hint on that?
In any case relevant code in C++ can be found in
https://git.savannah.nongnu.org/cgit/getfem.git/tree/interface/src/getfemint_misc.cc (build_edge_list)
But these are quite low level functions.
Best regardsKostas
On Tue, Jul 20, 2021 at 12:20 PM Egor Vtorushin <vtorushin@gmail.com> wrote:
Kostas,thank you for answering thу question and sorry for the delay in communication. I am sorry for missing important point  i am in 3D space
In 2D HHO example it works fine since
managing with 1D faces that are the edges I suppose.# # Boundary selection
flst = m.outer_faces() GAMMAD = 1 m.set_region(GAMMAD, flst)
In 3D all_faces provides access to 2d faces. Consider 4 points simplex that have 4 faces. I can integrate over an area of one of faces or many using regions built with outer_faces output.In my situation I have to make 1D integration over edges with respect to length. The 4 point simplex has 4 faces and 6 1D edges.At first glance outer_faces() method doesn't provide access to 1D edges for 3D meshes and with is my problem, assuming the fact that it returns empty array for dim=1 or dim=2
boxm.outer_faces() Out[: array([[0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5]], dtype=int32) boxm.outer_faces(3) Out: array([[0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5]], dtype=int32) boxm.outer_faces(2) Out: array([], shape=(2, 0), dtype=int32) EMPTY boxm.outer_faces(1) Out: array([], shape=(2, 0), dtype=int32)
EMPTY
Here boxm is 1 convex rectangular
PARALLELEPIPEDRegards, Egor
пн, 19 июл. 2021 г. в 15:31, Konstantinos Poulios <logari81@googlemail.com>:
Dear Egor Vtorushin,
Have a look at the outer_faces method:
if you put only one element in CVIDs you will get what you want, I guess.I am not sure how efficient it is to calculate these integrals for all elements one by one though.
"mesh.all_faces" might also be relevant for your question. You can also have a look at HHO examples like
Best regardsKostas
On Mon, Jul 19, 2021 at 8:59 AM Egor Vtorushin <vtorushin@gmail.com> wrote:
Dear Yves,Do you have any hints how to manage 1D integral over a loop containing simplex' or quad' edges.Let I have an electrical field(or current ) computed in simplex or quad mesh nodes. Then i need to calculate the field circulation over edgeloop for each face according to Stokes' theorem/formulaThere is an obsoleted function
edges
(CVLST=None, *args)Synopsis: [E,C] = Mesh.edges(self [, CVLST][, ‘merge’])
[OBSOLETE FUNCTION! will be removed in a future release]
Return the list of edges of mesh M for the convexes....
Maybe there is a way to utilize the Mesh.edges function or another way?Regards, Egor Vtorushin
 Yves Renard (Yves.Renard@insalyon.fr) tel : (33) 04.72.43.87.08 INSALyon 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univlyon1.fr/~renard 
[Prev in Thread]  Current Thread  [Next in Thread] 