-
Notifications
You must be signed in to change notification settings - Fork 117
Add Libgmsh support/ flboundadapt #168
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
a934592
490349c
0724018
875dd34
ef94e5e
8cb5b0f
d1e4739
3a42006
8e425e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ module field_options | |
& extract_pressure_mesh, extract_velocity_mesh, & | ||
& postprocess_periodic_mesh, get_diagnostic_coordinate_field, & | ||
& get_nodal_coordinate_field, extract_prognostic_pressure, & | ||
& extract_prognostic_velocity | ||
& extract_prognostic_velocity, get_surface_ids | ||
|
||
integer, parameter, public :: FIELD_EQUATION_UNKNOWN = 0, & | ||
FIELD_EQUATION_ADVECTIONDIFFUSION = 1, & | ||
|
@@ -1337,4 +1337,25 @@ function extract_prognostic_velocity(state, stat) result(vfield) | |
|
||
end function extract_prognostic_velocity | ||
|
||
subroutine get_surface_ids(bc_path, mesh, surface_ids) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a one line comment saying exactly what this routine does (or more if required). |
||
character(len=*), intent(in) :: bc_path | ||
type(mesh_type) :: mesh | ||
integer, dimension(:), allocatable, intent(out) :: surface_ids | ||
integer shape_option(2) | ||
character(len = OPTION_PATH_LEN) :: surface_names | ||
character(len = FIELD_NAME_LEN), dimension(:), allocatable :: name_list | ||
|
||
if (have_option(bc_path//"/surface_ids")) then | ||
shape_option=option_shape(bc_path//"/surface_ids") | ||
allocate(surface_ids(1:shape_option(1))) | ||
call get_option(bc_path//"/surface_ids", surface_ids) | ||
else if (have_option(bc_path//"/surface_names")) then | ||
call get_option(bc_path//"/surface_names", surface_names) | ||
call tokenize(trim(surface_names), name_list, ",") | ||
allocate(surface_ids(size(name_list))) | ||
call get_surface_ids_from_names(mesh, name_list, surface_ids) | ||
end if | ||
|
||
end subroutine get_surface_ids | ||
|
||
end module field_options |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -538,6 +538,11 @@ subroutine deallocate_mesh(mesh) | |
deallocate(mesh%element_halos) | ||
end if | ||
|
||
if (associated(mesh%surface_names)) then | ||
deallocate(mesh%surface_names) | ||
nullify(mesh%surface_names) | ||
end if | ||
|
||
call deallocate_faces(mesh) | ||
|
||
if(associated(mesh%subdomain_mesh)) then | ||
|
@@ -1097,6 +1102,10 @@ function make_mesh (model, shape, continuity, name) & | |
size(mesh%faces%surface_node_list), name='Surface'//trim(mesh%name)) | ||
#endif | ||
end if | ||
if (associated(model%surface_names)) then | ||
allocate(mesh%surface_names(size(model%surface_names))) | ||
mesh%surface_names(:) = model%surface_names(:) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pedantic: spurious |
||
end if | ||
call addref(mesh) | ||
|
||
end function make_mesh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,7 +367,8 @@ module fields_base | |
extract_scalar_field_from_tensor_field, ele_curl_at_quad,& | ||
eval_shape, ele_jacobian_at_quad, ele_div_at_quad_tensor,& | ||
ele_2d_curl_at_quad, getsndgln, local_coords_matrix,& | ||
local_coords_interpolation | ||
local_coords_interpolation, set_surface_names, & | ||
get_surface_ids_from_names | ||
|
||
contains | ||
|
||
|
@@ -4199,4 +4200,39 @@ subroutine write_minmax_tensor(tfield, field_expression) | |
|
||
end subroutine write_minmax_tensor | ||
|
||
subroutine set_surface_names(mesh, names, ids) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: "docstring" please |
||
type(mesh_type), intent(inout) :: mesh | ||
character(len=*), intent(in) :: names(:) | ||
integer, intent(in) :: ids(:) | ||
|
||
integer :: i | ||
|
||
allocate(mesh%surface_names(size(ids))) | ||
|
||
do i=1, size(ids) | ||
mesh%surface_names(i)%id = ids(i) | ||
mesh%surface_names(i)%name = names(i) | ||
end do | ||
end subroutine set_surface_names | ||
|
||
subroutine get_surface_ids_from_names(mesh, names, ids) | ||
type(mesh_type), intent(in) :: mesh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
character(len=*), intent(in) :: names(:) | ||
integer, intent(out) :: ids(:) | ||
|
||
integer :: i, j | ||
|
||
ids = -1 | ||
|
||
do i=1, size(ids) | ||
do j=1, size(mesh%surface_names) | ||
if (trim(mesh%surface_names(j)%name) == trim(names(i))) then | ||
ids(i) = mesh%surface_names(j)%id | ||
exit | ||
end if | ||
end do | ||
end do | ||
|
||
end subroutine get_surface_ids_from_names | ||
|
||
end module fields_base |
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 looks wrong