From 8cb9787ea2691df860f94d306ecfde747eaef9c9 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Wed, 20 May 2020 11:07:21 -0400 Subject: [PATCH] Added functionality so you can refine elements prior to operating on the group --- src/opt_group.f90 | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/opt_group.f90 b/src/opt_group.f90 index 45029f2..c3edc8a 100644 --- a/src/opt_group.f90 +++ b/src/opt_group.f90 @@ -37,16 +37,27 @@ module opt_group call parse_group(arg_pos) - call get_group !Now call the transformation functions for the group - if(displace) call displace_group + if(refine) then + call get_group + call refine_group + end if - if(remesh_size > 0) call remesh_group + if(displace)then + call get_group + call displace_group + end if - if(delete) call delete_group + if(delete)then + call get_group + call delete_group + end if - if(refine) call refine_group + if(remesh_size > 0)then + call get_group + call remesh_group + end if end subroutine group @@ -360,7 +371,11 @@ module opt_group return end select - !Allocate variables to arbitrary size + !Reset group if needed + if(allocated(element_index)) deallocate(element_index,atom_index) + + group_ele_num = 0 + group_atom_num = 0 allocate(element_index(1024), atom_index(1024)) !Check the type to see whether we need to find the elements within the group select case(trim(adjustl(type)))