-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Open
IshaanDesai
wants to merge
5
commits into
develop
Choose a base branch
from
volumetric-coupling
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| ! | ||
| ! 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 | ||
| ! | ||
| subroutine getc3d4elementgausspointcoords(nelem, elem_ids, | ||
| & 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 | ||
| real(8) :: co(3,*) ! Nodal coordinates of all nodes | ||
| integer :: kon(*) | ||
| integer :: ipkon(*) | ||
|
|
||
| real(8) :: elem_gp_coord(*) ! Gauss point coords | ||
|
|
||
| ! Internal variables | ||
| integer(4) :: iel, el_id, indexe, i, j, k, l | ||
| integer(4) :: iflag, idx, konl(4), gp_id | ||
| REAL(8) :: xl(3,4), xi, et, ze, xsj, shp(4,20) | ||
|
|
||
| include "gauss.f" | ||
|
|
||
| data iflag /1/ | ||
|
|
||
| ! Initialize gauss point coordinates to zero | ||
| do l = 1, nelem*3 | ||
| elem_gp_coord(l) = 0.0 | ||
| end do | ||
|
|
||
| do iel = 1, nelem | ||
| el_id = elem_ids(iel) | ||
|
|
||
| indexe=ipkon(el_id) | ||
|
|
||
| ! Local nodal coordinates | ||
| do i = 1, 4 | ||
| konl(i) = kon(indexe+i) | ||
| do j = 1, 3 | ||
| xl(j,i)=co(j,konl(i)) | ||
| end do | ||
| end do | ||
|
|
||
| ! One Gauss point per element | ||
| gp_id = 1 | ||
|
|
||
| ! gauss3d4: tet, 1 integration point | ||
| xi = gauss3d4(1,gp_id) | ||
| et = gauss3d4(2,gp_id) | ||
| ze = gauss3d4(3,gp_id) | ||
|
|
||
| ! Get the shape function | ||
| call shape4tet(xi,et,ze,xl,xsj,shp,iflag) | ||
|
|
||
| ! Calculate the Gauss point coordinates | ||
| do k = 1, 3 | ||
| idx = (iel - 1) * 3 + k | ||
| do l = 1, 4 | ||
| elem_gp_coord(idx)=elem_gp_coord(idx) | ||
| & +xl(k,l)*shp(4,l) | ||
| end do | ||
| end do | ||
|
|
||
| end do | ||
|
|
||
| return | ||
|
|
||
| end subroutine getc3d4elementgausspointcoords |
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,91 @@ | ||
| ! | ||
| ! 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 | ||
| ! | ||
| subroutine getc3d8elementgausspointcoords(nelem, elem_ids, | ||
| & 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 | ||
| 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 | ||
| real(8) :: xl(3,8), xi, et, ze, xsj, shp(4,20) | ||
|
|
||
| include "gauss.f" | ||
|
|
||
| data iflag /1/ | ||
|
|
||
| ! Initialize gauss point coordinates to zero | ||
| do l = 1, nelem*8*3 | ||
| elem_gp_coord(l) = 0.0 | ||
| end do | ||
|
|
||
| do iel = 1, nelem | ||
| el_id = elem_ids(iel) | ||
|
|
||
| indexe=ipkon(el_id) | ||
|
|
||
| ! connectivity | ||
| do i = 1, 8 | ||
| konl(i)=kon(indexe+i) | ||
| end do | ||
|
|
||
| ! Local nodal coordinates | ||
| do i = 1, 8 | ||
| 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, 8 | ||
| ! gauss3d2: hex, 2-point integration (8 integration points) | ||
| xi = gauss3d2(1,gp_id) | ||
| et = gauss3d2(2,gp_id) | ||
| ze = gauss3d2(3,gp_id) | ||
|
|
||
| ! Get the shape function | ||
| call shape8h(xi,et,ze,xl,xsj,shp,iflag) | ||
|
|
||
| ! Calculate the Gauss point coordinates | ||
| do k = 1, 3 | ||
| idx = (el_id - 1)*24 + (gp_id - 1)*3 + k | ||
| do l = 1, 8 | ||
| 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 getc3d8elementgausspointcoords |
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.
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.
I assume that these two files contain changes compared to the original CalculiX files. A comment on the modifications would be very helpful when porting to later versions.
Was the functionality provided by the deleted file never needed, or is it just substituted by the two new files?
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.
Yes, the contents of both the new Fortran files is essentially copied from the CalculiX source code. Additionally I put some of my own code in there. I will add comments in the file.
The functionality in the deleted file was not used. I tried to use it, but the Gauss point coordinates returned by it were not correct. Hence the decision to remove the file and add two separate files for two different elements. it id worth noting that in the future, these two files can be merged.