-
-
Notifications
You must be signed in to change notification settings - Fork 31
Functionality for volumetric coupling on quadrature points of a mesh #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4d99ec7
Add functionality for handling element meshes, for volumetric coupling
IshaanDesai 02df2f5
Add functionality to detect quadrature points of meshes having either…
IshaanDesai 67916c2
Add the Gauss point extraction functionality files to the Makefile, a…
IshaanDesai d7efaf2
Add definition of numIPTotal
IshaanDesai 3893cb5
Add definition of elementSetID
IshaanDesai 2d52c96
Merge branch 'develop' into volumetric-coupling
MakisH 96b3f0d
Port documentation from the website repository
MakisH 64bed0e
Merge branch 'develop' into volumetric-coupling
IshaanDesai 060a9b4
Merge the functionality to extract Gauss points for C3D4 and C3D8 ele…
IshaanDesai c831b7e
Remove incorrectly added parts of the documentation
IshaanDesai 857d5c8
Add warning for elements mesh support
IshaanDesai 7b331cb
Add CHANGELOG entry
IshaanDesai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| ! | ||
| ! CalculiX - A 3-dimensional finite element program | ||
| ! Copyright (C) 1998-2015 Guido Dhondt | ||
| ! | ||
| ! This program is free software; you can redistribute it and/or | ||
| ! modify it under the terms of the GNU General Public License as | ||
| ! published by the Free Software Foundation(version 2); | ||
| ! | ||
| ! | ||
| ! This program is distributed in the hope that it will be useful, | ||
| ! but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| ! GNU General Public License for more details. | ||
| ! | ||
| ! You should have received a copy of the GNU General Public License | ||
| ! along with this program; if not, write to the Free Software | ||
| ! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| ! | ||
| ! This function is a copy of the function for calculation and printout of the lift and drag forces | ||
| ! | ||
| ! Computes the physical coordinates of the Gauss/integration points | ||
| ! of a set of elements. Supports either C3D4 (tetrahedra, 1 GP) or | ||
| ! C3D8 (hexahedra, 8 GP) elements, selected via the "nope" argument | ||
| ! (number of nodes per element: 4 or 8). | ||
| ! | ||
| subroutine getelementgausspointcoords(nelem, elem_ids, nope, | ||
| & co, kon, ipkon, elem_gp_coord) | ||
|
|
||
| implicit none | ||
|
|
||
| !Input/Output variables | ||
| integer :: nelem ! Number of elements | ||
| integer :: elem_ids(*) ! Element IDs, need to be adjusted for Fortran | ||
| integer :: nope ! Nodes per element: 4 (C3D4) or 8 (C3D8) | ||
| real(8) :: co(3,*) ! Nodal coordinates of all nodes | ||
| integer :: kon(*) | ||
| integer :: ipkon(*) | ||
|
|
||
| real(8) :: elem_gp_coord(*) ! GP coords | ||
|
|
||
| ! Internal variables | ||
| integer(4) :: iel, el_id, indexe, i, j, k, l | ||
| integer(4) :: iflag, idx, konl(8), gp_id, ngp | ||
| real(8) :: xl(3,8), xi, et, ze, xsj, shp(4,20) | ||
|
|
||
| include "gauss.f" | ||
|
|
||
| data iflag /1/ | ||
|
|
||
| ! Number of Gauss points per element: 1 for tetrahedra, 8 for hexahedra | ||
| if (nope .eq. 4) then | ||
| ngp = 1 | ||
| else | ||
| ngp = 8 | ||
| end if | ||
|
|
||
| ! Initialize gauss point coordinates to zero | ||
| do l = 1, nelem*ngp*3 | ||
| elem_gp_coord(l) = 0.0 | ||
| end do | ||
|
|
||
| do iel = 1, nelem | ||
| el_id = elem_ids(iel) | ||
|
|
||
| indexe=ipkon(el_id) | ||
|
|
||
| ! connectivity + local nodal coordinates | ||
| do i = 1, nope | ||
| konl(i)=kon(indexe+i) | ||
| do j = 1, 3 | ||
| xl(j,i)=co(j,konl(i)) | ||
| end do | ||
| end do | ||
|
|
||
| ! Loop through gauss points of each element | ||
| do gp_id = 1, ngp | ||
|
|
||
| if (nope .eq. 4) then | ||
| ! gauss3d4: tet, 1 integration point | ||
| xi = gauss3d4(1,gp_id) | ||
| et = gauss3d4(2,gp_id) | ||
| ze = gauss3d4(3,gp_id) | ||
|
|
||
| call shape4tet(xi,et,ze,xl,xsj,shp,iflag) | ||
| else | ||
| ! gauss3d2: hex, 2-point integration (8 integration points) | ||
| xi = gauss3d2(1,gp_id) | ||
| et = gauss3d2(2,gp_id) | ||
| ze = gauss3d2(3,gp_id) | ||
|
|
||
| call shape8h(xi,et,ze,xl,xsj,shp,iflag) | ||
| end if | ||
|
|
||
| ! Calculate the Gauss point coordinates | ||
| ! Note: indexed by the loop counter (iel), not the element ID | ||
| ! (el_id), since elem_gp_coord is a compact buffer holding only | ||
| ! the "nelem" elements of this interface, in the order given by | ||
| ! elem_ids. | ||
| do k = 1, 3 | ||
| idx = (iel - 1)*ngp*3 + (gp_id - 1)*3 + k | ||
| do l = 1, nope | ||
| elem_gp_coord(idx)=elem_gp_coord(idx) | ||
| & +xl(k,l)*shp(4,l) | ||
| end do | ||
| end do | ||
|
|
||
| end do | ||
|
|
||
| end do | ||
|
|
||
| return | ||
|
|
||
| end subroutine getelementgausspointcoords | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IshaanDesai What function does this refer to? A link to the source code of CalculiX would make it easier to port this function to a newer version of CalculiX.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I have a few other PRs depending on this one, let's add the comment as soon as possible after merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is kind of a patchwork of loops from the CalculiX source code. Previously, it was more of a direct copy, but I later removed unnecessary parts to shorten the file. I think updating this function for newer versions of CalculiX should be fairly straightforward.