finite element analysi

hi..I am doing a project on finite element analysis..A framework is provided to me but i have no clue what is going on in this code??Can anyone explain this program??
Pos=Patch->GetTrglFaceList().GetHeadPosition();Pos!=NULL;
Last edited on
@kaffy

This may be a case of "can't see the wood for the trees". What you have posted here is the source code for various library-type functions concerned with just one aspect of your finite-element mesh (cell-face geometry). I doubt very much that you need to know how each function is coded: I suspect that you might simply need to call some of these routines as and when needed. As an analogy, consider the sqrt() function: you don't need to know how it is coded: you just need to know that it returns the square root of a number. Actually, given what they do, you may not call any of them directly.

To see what functions you might call you may do better to look in the individual header files (see the include statements at the top). These probably contain all that you really need to know about the functions, the classes they are part of, and the data in those classes. If available, refer to documentation, or look at an example using these classes.

As a further word of WARNING: you are posting quite a lot of SOMEBODY ELSE's code to public view on the internet. Are you absolutely certain that you have their permission?
Whilst none of the routines here are anything but short and mundane (which is the mark of a good function), how somebody designed their class in terms of data elements and member functions is very important information and probably took a lot of work and development which they may not be happy for you to just give away. A finite-element solver is not a trivial code to write.



For what it's worth, this is a rough outline of the member functions that you have posted (with some guesswork, because I can't see the class declarations). A "member function" is simply "something you can do" to the data in that particular class (here, mainly the triangular faces in the mesh). However, I doubt very much that your project will deal directly with these routines. They are also only a small part of the whole code (which I do NOT advise you to post).

QMeshFace()
- constructs and initialises the data needed by a single triangular face object (appears to initialise to 0/null, then identify tetrahedral and/or hexahedral elements that share that face; calls routines outside of what you have posted here)

~QMeshFace()
- corresponding destructor; doesn't do anything here


GetAttribFlag( const int whichBit )
SetAttribFlag( const int whichBit, const BOOL toBe )
GetIndexNo()
SetIndexNo( const UINT _index )
IsNormalDirection( const UINT whichEdge ) - don't know about this one
SetDirectionFlag( const UINT whichEdge, const BOOL toBe )
GetEdgeRecordPtr( const UINT whichEdge )
SetEdgeRecordPtr( const UINT whichEdge, QMeshEdge * _edge )
GetNodeRecordPtr( const UINT whichNode )
SetMeshSurfacePtr(QMeshPatch* _mesh)
GetMeshSurfacePtr()
GetEdgeNum()
SetEdgeNum(int num)
- simple "getters" and "setters" for the data associated with a cell face

GetNodePos( const UINT whichNode, double &xx, double &yy, double &zz)
- probably gets coordinates of one vertex: maybe the first in a sequence of pointers to successive vertices

CalCenterPos(double &xx, double &yy, double &zz)
- calculates the centroid of the face

CalBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
- finds the maximum and minimum coordinates of the vertices that define the face

GetPlaneEquation(double & A, double & B, double & C, double & D )
- find the equation of the plane Ax+By+Cz=D that the face is in. Most useful will be the normal direction: vector (A,B,C)

GetLeftTetra()
SetLeftTetra( QMeshTetra * _pLeftTetra )
GetRightTetra()
SetRightTetra( QMeshTetra * _pRightTetra )
- Probably gets or sets pointers to the tetrahedral cells on either side of the cell face
Topic archived. No new replies allowed.