Skip to content

Commit

Permalink
Add new capabilities
Browse files Browse the repository at this point in the history
- Switch "active" and "passive" for orientation convention and updated mesh
  parser for compatibility with Neper version 4.10.
- Made various other fixes.
- Fixed "simple simulation" tutorial.
  • Loading branch information
rquey committed Oct 1, 2024
1 parent 89d404b commit c90d51b
Show file tree
Hide file tree
Showing 922 changed files with 13,727 additions and 12,796 deletions.
5 changes: 4 additions & 1 deletion VERSIONS
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
New in 2.0.2-1 (16 Sep 2024):
New in 2.1.0 (01 Oct 2024):
- Switch "active" and "passive" for orientation convention and updated mesh
parser for compatibility with Neper version 4.10.
- Made various other fixes.
- Fixed "simple simulation" tutorial.

New in 2.0.1 (03 Sep 2024):
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import sphinx_rtd_theme

project = u'FEPX'
version = u'2.0.2-1'
release = u'2.0.2-1'
version = u'2.1.0'
release = u'2.1.0'
author = u'DPLab, ACME Lab, CNRS'
copyright = u'DPLab, ACME Lab, CNRS'
language = 'en'
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Top-level CMakeLists.txt for building FEPX
cmake_minimum_required(VERSION 3.0)
project(fepx Fortran)
set(FEPX_VERSION \"2.0.2-1\")
set(FEPX_VERSION \"2.1.0\")

# Prepare CMake for Fortran and locate MPI package
enable_language(Fortran)
Expand Down
1 change: 0 additions & 1 deletion src/fepx.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ program FEPX
use driver_triaxcsr_mod
use driver_triaxclr_mod
use driver_uniaxial_control_mod
use write_res_mod
use units_mod
use parallel_mod
use gather_scatter_mod
Expand Down
4 changes: 0 additions & 4 deletions src/fepx2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ subroutine fepx_print_partinfo(printing, mesh, num_procs, myid)

mesh%global_info(:, :) = global_info(:, :)

if (myid .eq. 0) then
call write_dot_sim_file_header(printing, mesh)
end if

deallocate (part_info)
deallocate (global_info)

Expand Down
11 changes: 3 additions & 8 deletions src/general/orientation_conversion_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ module orientation_conversion_mod

! Module containing orientation conversions for input and printing.

! Note: The conversions here assume no convention ("active" or "passive"). The
! default assumption in FEPX is a "passive" convention. If an "active"
! convention is chosen by the user, the internal rotation matrix is transposed
! when converted from its original orientation convention, and again before
! output to files. FEPX assumes "active" to mean "sample-to-crystal"
! transformation, and "passive" to mean "crystal-to-sample" transformation.

! All conversions are summarized in a paper by Rowenhorst et. al.:
! Note: The conversions here assume no convention ("active" or "passive").
! The conversions are summarized in a paper by Rowenhorst et. al.:
! doi:10.1088/0965-0393/23/8/083501, 2015.
! Or adapted from Neper (https://neper.info)

! Note: The following subroutines rely on other conversions:
! rodrigues_to_rotmat: First converts to axis-angle, then to rotation matrix.
Expand Down
5 changes: 4 additions & 1 deletion src/general/types_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ module types_mod
& rotrate_slip_u = 52, &
& force_u = 60

character(len=16), allocatable :: node_results(:)
character(len=16), allocatable :: elt_results(:)

end type printing_type

type trace
Expand Down Expand Up @@ -206,7 +209,7 @@ module types_mod
character(len=256) :: bc_type(1024)
character(len=256) :: bc_var(1024)
character(len=256) :: bc_nset(1024)
character(len=2) :: bc_dir(1024)
character(len=50) :: bc_dir(1024)
real(rk) :: bc_vel(1024)

! should be merged with strain_rate (or velocity) somehow
Expand Down
58 changes: 58 additions & 0 deletions src/general/utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,62 @@ function ut_file_exists (filename) result(file_exists)

end function ut_file_exists

!> This writes the file names of the user-defined output files from the
! simulation.cfg.
subroutine ut_string_addtoarray(input_string, string_array)

!---------------------------------------------------------------------------

! Arguments:
! input_string: Character array denoting file name to print.

character(len=*), intent(in) :: input_string
character(len=16), intent(inout), allocatable :: string_array(:)

character(len=16), allocatable :: temp_array(:)
integer :: arraysize, i

!---------------------------------------------------------------------------

! Append the input_string to the present array and reallocate.
if (allocated(string_array)) then
arraysize = size(string_array)
allocate (temp_array(arraysize + 1))

do i = 1, arraysize
temp_array(i) = string_array(i)
end do

temp_array(arraysize + 1) = input_string
deallocate (string_array)
call move_alloc(temp_array, string_array)
else
allocate (string_array(1))
string_array(1) = input_string
end if

end subroutine ut_string_addtoarray

subroutine ut_string_version(version, major, minor, patch)

!---------------------------------------------------------------------------

character(len=10), intent(in) :: version
integer, intent(out) :: major, minor, patch

character(len=10) :: temp

minor = 0
patch = 0

read(version, '(I1, A)') major, temp
if (scan(temp, ".") /= 0) then
read(temp(2:), '(I1, A)') minor, temp
if (scan(temp, ".") /= 0) then
read(temp(2:), '(I1)') patch
end if
end if

end subroutine ut_string_version

end module utils_mod
4 changes: 0 additions & 4 deletions src/libfepx/driver_uniaxial_control_mod1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,16 @@ subroutine driver_uniaxial_control(mesh, crys, loading, exec, results, printing)
if (loading_checklimit(exec, time, incr)) then
loading%step_complete = .true.
loading%all_steps_complete = .true.
if (myid .eq. 0 ) call write_dot_sim_file_complete_steps(printing, loading)
call par_quit('Error : > Maximum time or maximum increments exceeded.', exec%clock_start)
end if

! optionally, checking for necking
if (exec%check_necking .and. loading_isnecking(loading)) then
if (myid .eq. 0 ) call write_dot_sim_file_complete_steps(printing, loading)
call par_quit('Error : > Specimen is necking.', exec%clock_start)
end if
end if

if (loading%all_steps_complete) then
if (myid .eq. 0 ) call write_dot_sim_file_complete_steps(printing, loading)

call par_quit('Info : Final step terminated. Simulation completed successfully.', exec%clock_start)
end if

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subroutine solve_evp_vpstress(mesh, crys, exec, qpt, results, vp_log)

call scale_down_defr(d_vec_lat, results%defrate_eq(:, qpt))
call compute_work(mesh, crys, plwork, d_vec_lat)

call compute_avg_crss(mesh, crys, results%crss(:, :, qpt), crss_avg)
converged = .false.

! This loop used to be from 1 to n_edge, in order to try all vertices as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,5 +378,43 @@ subroutine solve_newton_vp(mesh, crys, exec, sig, d_vec, crss, irc, eps, converg
irc = -2

end subroutine solve_newton_vp
!> Computes the average strength of the crystal slip systems
subroutine compute_avg_crss(mesh, crys, crss, crss_avg)

type(mesh_type) :: mesh
type(crys_type) :: crys (:)
real(rk), intent(in) :: crss(mesh%maxnumslip, elt_sub:elt_sup)
real(rk), intent(inout) :: crss_avg(elt_sub:elt_sup)

integer, pointer :: indices(:) => null()
integer :: islip
integer :: n_slip
integer :: iphase
integer :: num_ind

!---------------------------------------------------------------------------

crss_avg = 0.0d0

! Goes through the total number of phases in the material
do iphase = 1, mesh%num_phases
n_slip = crys(iphase)%numslip

! Finds the indices corresponding to the current phase the loop is on

call find_indices(mesh%elt_phase(elt_sub:elt_sup), iphase, indices, num_ind, elt_sub - 1)

! Sums up the crystal slip strengths corresponding to the given indices
!DEBUG::
! do islip = 1, n_slip
crss_avg(indices) = crss_avg(indices) + crss(1, indices)
! end do

! Calculates the average of these slip systems

! crss_avg(indices) = crss_avg(indices)/n_slip
deallocate (indices)
end do
end subroutine compute_avg_crss

end module solve_evp_vpstress_mod2
10 changes: 5 additions & 5 deletions src/libfepx/solveit_evp/solveit_evp_mod1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ subroutine solveit_evp(mesh, crys, loading, exec, printing, &

! sig_vec_n_qpt: inout (enters=0 at the first increment, only grain=0 is
! updated)

call elt_stif_evp(mesh, crys, exec, results_prev, results, ecoos, evel, &
& estiff, etanstiff, eforce, incr, dtime)

Expand Down Expand Up @@ -193,17 +193,17 @@ subroutine solveit_evp(mesh, crys, loading, exec, printing, &

call assemble_diagonals("general", loading, mesh, exec, stiff, gdiag)
cg_iter_out = cg_solver_ebe("general", "dv", gdiag, stiff, delta_vel, resid, loading, exec, mesh)

! If multi-point constraints, solve the reduced linear system only on primary dofs
else if ((loading%mpc_status .eqv. .true.) .and. (mesh%num_periodicity .eq. 0)) then
! Form the diagonal part of the primary stiffness matrix (Jacobi's preconditioning)
call assemble_diagonals("MPC", loading, mesh, exec, stiff, gdiag)
! Solve the linear system using the congujate gradient method
cg_iter_out = cg_solver_ebe("MPC", "dv", gdiag, stiff, delta_vel, resid, loading, exec, mesh)

! If PBC
else if ((loading%mpc_status .eqv. .false.) .and. (mesh%num_periodicity .gt. 0)) then

call assemble_diagonals("PBC", loading, mesh, exec, stiff, gdiag)
cg_iter_out = cg_solver_ebe("PBC", "dv", gdiag, stiff, delta_vel, resid, loading, exec, mesh)

Expand Down Expand Up @@ -393,7 +393,7 @@ subroutine solveit_evp(mesh, crys, loading, exec, printing, &
end if

if (status .ne. 0) then
call par_quit('Error : > Failure to converge.')
call par_quit('Error : > Failure to converge.',clock_start=exec%clock_start)
end if

! Update state (at center of each element), geometry,
Expand Down
Loading

0 comments on commit c90d51b

Please sign in to comment.