Dear Elmer group
Hello
How can I figure out that a node is an internal node or belongs for example to target boundary 1?
I opted the following algorithm that can successfully decide whether a node is an internal or boundary node, but first I don’t know is this algorithm optimum or not, and more importantly I can’t determine the boundary nodes associated to a particular ‘target boundary’ say for example target boundary 1.
BoundaryNode = .False.
DO i = 1,Solver % Mesh % NumberOfBulkElements
Element => Solver % Mesh % Elements(i)
NodeIndexes => Element % NodeIndexes
Model % CurrentElement => Element
CALL GetElementNodes( ElementNodes )
n = GetElementNOFNodes()
DO j = 1 , n ! Number of Element nodes
DO k = Solver % Mesh % NumberOfBulkElements + 1, &
Solver % Mesh % NumberOfBulkElements + &
Solver % Mesh % NumberOfBoundaryElements
BoundaryElement => Solver % Mesh % Elements(k)
nnn = BoundaryElement % TYPE % NumberOfNodes
Indexes => Elementb % NodeIndexes
Do m=1 , nn ! Number of Boundary Element nodes
IF (NodeIndexes(j)==Indexes(m)) THEN
BoundaryNode(Perm(NodeIndexes1(j)))=.True.
END IF
END DO ! m
END DO ! k
END DO ! j
END DO ! i
Best wishes,
KimSongOik
Internal or boundary node
-
- Site Admin
- Posts: 4843
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Internal or boundary node
Hi Kim
Your algorithm has a n^2 scaling which tends to ruin the performance on large meshes. You could use a subroutine called "MakePermUsingMask" to make a permutation vector that is only nonzero only at the BC where your chosen keyword is active (Or you can copy the the stuff directly from there to your loop).
Once you have the list of the boundary nodes you could loop over all boundary elements. If all element nodes are have a nonzero permutation then apply mapping to that element. It is usuful to know that the corner nodes come first. For example, boundary element of type 102 (quadratic line) has three nodes, two end nodes and the mid node. This is of course the simplest case. For more complicated elementtypes you should check the ordering before writing the mapping.
-Peter
Your algorithm has a n^2 scaling which tends to ruin the performance on large meshes. You could use a subroutine called "MakePermUsingMask" to make a permutation vector that is only nonzero only at the BC where your chosen keyword is active (Or you can copy the the stuff directly from there to your loop).
Once you have the list of the boundary nodes you could loop over all boundary elements. If all element nodes are have a nonzero permutation then apply mapping to that element. It is usuful to know that the corner nodes come first. For example, boundary element of type 102 (quadratic line) has three nodes, two end nodes and the mid node. This is of course the simplest case. For more complicated elementtypes you should check the ordering before writing the mapping.
-Peter