From c8f426a8755ddba26a9a796cfb6d707bff93eaca Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 10 Mar 2019 10:36:50 +0100 Subject: [PATCH] use variables from mesh object --- src/material.f90 | 26 +++++++++++--------------- src/mesh_FEM.f90 | 14 +++----------- src/mesh_abaqus.f90 | 9 ++------- src/mesh_grid.f90 | 8 ++++---- src/mesh_marc.f90 | 11 ++--------- 5 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/material.f90 b/src/material.f90 index f1e227b21..3c69c844e 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -298,7 +298,6 @@ subroutine material_init() phase_name, & texture_name use mesh, only: & - mesh_homogenizationAt, & theMesh implicit none @@ -395,13 +394,13 @@ subroutine material_init() allocate(mappingHomogenizationConst( theMesh%elem%nIPs,theMesh%Nelems),source=1_pInt) ! END DEPRECATED - allocate(material_homogenizationAt,source=mesh_homogenizationAt) + allocate(material_homogenizationAt,source=theMesh%homogenizationAt) allocate(CounterPhase (size(config_phase)), source=0_pInt) allocate(CounterHomogenization(size(config_homogenization)),source=0_pInt) ! BEGIN DEPRECATED do e = 1_pInt,theMesh%Nelems - myHomog = mesh_homogenizationAt(e) + myHomog = theMesh%homogenizationAt(e) do i = 1_pInt, theMesh%elem%nIPs CounterHomogenization(myHomog) = CounterHomogenization(myHomog) + 1_pInt mappingHomogenization(1:2,i,e) = [CounterHomogenization(myHomog),myHomog] @@ -435,7 +434,7 @@ subroutine material_parseHomogenization use config, only : & config_homogenization use mesh, only: & - mesh_homogenizationAt + theMesh use IO, only: & IO_error @@ -456,7 +455,7 @@ subroutine material_parseHomogenization allocate(damage_initialPhi(size(config_homogenization)), source=1.0_pReal) forall (h = 1_pInt:size(config_homogenization)) & - homogenization_active(h) = any(mesh_homogenizationAt == h) + homogenization_active(h) = any(theMesh%homogenizationAt == h) do h=1_pInt, size(config_homogenization) @@ -542,7 +541,6 @@ subroutine material_parseMicrostructure config_microstructure, & microstructure_name use mesh, only: & - mesh_microstructureAt, & theMesh implicit none @@ -558,11 +556,11 @@ subroutine material_parseMicrostructure allocate(microstructure_active(size(config_microstructure)), source=.false.) allocate(microstructure_elemhomo(size(config_microstructure)), source=.false.) - if(any(mesh_microstructureAt > size(config_microstructure))) & + if(any(theMesh%microstructureAt > size(config_microstructure))) & call IO_error(155_pInt,ext_msg='More microstructures in geometry than sections in material.config') forall (e = 1_pInt:theMesh%Nelems) & - microstructure_active(mesh_microstructureAt(e)) = .true. ! current microstructure used in model? Elementwise view, maximum N operations for N elements + microstructure_active(theMesh%microstructureAt(e)) = .true. ! current microstructure used in model? Elementwise view, maximum N operations for N elements do m=1_pInt, size(config_microstructure) microstructure_Nconstituents(m) = config_microstructure(m)%countKeys('(constituent)') @@ -1013,8 +1011,6 @@ subroutine material_populateGrains math_sampleFiberOri, & math_symmetricEulers use mesh, only: & - mesh_homogenizationAt, & - mesh_microstructureAt, & theMesh, & mesh_ipVolume use config, only: & @@ -1064,14 +1060,14 @@ subroutine material_populateGrains ! populating homogenization schemes in each !-------------------------------------------------------------------------------------------------- do e = 1_pInt, theMesh%Nelems - material_homog(1_pInt:theMesh%elem%nIPs,e) = mesh_homogenizationAt(e) + material_homog(1_pInt:theMesh%elem%nIPs,e) = theMesh%homogenizationAt(e) enddo !-------------------------------------------------------------------------------------------------- ! precounting of elements for each homog/micro pair do e = 1_pInt, theMesh%Nelems - homog = mesh_homogenizationAt(e) - micro = mesh_microstructureAt(e) + homog = theMesh%homogenizationAt(e) + micro = theMesh%microstructureAt(e) Nelems(homog,micro) = Nelems(homog,micro) + 1_pInt enddo allocate(elemsOfHomogMicro(size(config_homogenization),size(config_microstructure))) @@ -1088,8 +1084,8 @@ subroutine material_populateGrains ! identify maximum grain count per IP (from element) and find grains per homog/micro pair Nelems = 0_pInt ! reuse as counter elementLooping: do e = 1_pInt,theMesh%Nelems - homog = mesh_homogenizationAt(e) - micro = mesh_microstructureAt(e) + homog = theMesh%homogenizationAt(e) + micro = theMesh%microstructureAt(e) if (homog < 1_pInt .or. homog > size(config_homogenization)) & ! out of bounds call IO_error(154_pInt,e,0_pInt,0_pInt) if (micro < 1_pInt .or. micro > size(config_microstructure)) & ! out of bounds diff --git a/src/mesh_FEM.f90 b/src/mesh_FEM.f90 index 4df5840c7..29f0bc682 100644 --- a/src/mesh_FEM.f90 +++ b/src/mesh_FEM.f90 @@ -33,10 +33,6 @@ use PETScis mesh_maxNips !< max number of IPs in any CP element !!!! BEGIN DEPRECATED !!!!! - integer(pInt), dimension(:), allocatable, public, protected :: & - mesh_homogenizationAt, & !< homogenization ID of each element - mesh_microstructureAt !< microstructure ID of each element - integer(pInt), dimension(:,:), allocatable, public, protected :: & mesh_element !DEPRECATED @@ -264,16 +260,12 @@ subroutine mesh_init() allocate(FEsolving_execIP(2_pInt,mesh_NcpElems)); FEsolving_execIP = 1_pInt ! parallel loop bounds set to comprise from first IP... forall (j = 1_pInt:mesh_NcpElems) FEsolving_execIP(2,j) = FE_Nips(FE_geomtype(mesh_element(2,j))) ! ...up to own IP count for each element -!!!! COMPATIBILITY HACK !!!! -! for a homogeneous mesh, all elements have the same number of IPs and and cell nodes. -! hence, xxPerElem instead of maxXX -! better name - mesh_homogenizationAt = mesh_element(3,:) - mesh_microstructureAt = mesh_element(4,:) -!!!!!!!!!!!!!!!!!!!!!!!! allocate(mesh_node0(3,mesh_Nnodes),source=0.0_pReal) call theMesh%init(dimplex,integrationOrder,mesh_node0) call theMesh%setNelems(mesh_NcpElems) + + theMesh%homogenizationAt = mesh_element(3,:) + theMesh%microstructureAt = mesh_element(4,:) end subroutine mesh_init diff --git a/src/mesh_abaqus.f90 b/src/mesh_abaqus.f90 index d871203af..adcaa8513 100644 --- a/src/mesh_abaqus.f90 +++ b/src/mesh_abaqus.f90 @@ -25,10 +25,6 @@ module mesh mesh_maxNcellnodes !< max number of cell nodes in any CP element !!!! BEGIN DEPRECATED !!!!! - integer(pInt), dimension(:), allocatable, public, protected :: & - mesh_homogenizationAt, & !< homogenization ID of each element - mesh_microstructureAt !< microstructure ID of each element - integer(pInt), dimension(:,:), allocatable, public, protected :: & mesh_element, & !DEPRECATED mesh_sharedElem, & !< entryCount and list of elements containing node @@ -520,9 +516,8 @@ subroutine mesh_init(ip,el) ! better name - mesh_homogenizationAt = mesh_element(3,:) - mesh_microstructureAt = mesh_element(4,:) - + theMesh%homogenizationAt = mesh_element(3,:) + theMesh%microstructureAt = mesh_element(4,:) contains diff --git a/src/mesh_grid.f90 b/src/mesh_grid.f90 index 6e9e37834..38abad1aa 100644 --- a/src/mesh_grid.f90 +++ b/src/mesh_grid.f90 @@ -22,9 +22,8 @@ module mesh integer(pInt), dimension(:), allocatable, private :: & microGlobal - integer(pInt), dimension(:), allocatable, public, protected :: & - mesh_homogenizationAt, & !< homogenization ID of each element - mesh_microstructureAt !< microstructure ID of each element + integer(pInt), dimension(:), allocatable, private :: & + mesh_homogenizationAt integer(pInt), dimension(:,:), allocatable, public, protected :: & mesh_element !< entryCount and list of elements containing node @@ -268,7 +267,8 @@ subroutine mesh_init(ip,el) ! for a homogeneous mesh, all elements have the same number of IPs and and cell nodes. ! hence, xxPerElem instead of maxXX ! better name - mesh_microstructureAt = mesh_element(4,:) + theMesh%homogenizationAt = mesh_element(3,:) + theMesh%microstructureAt = mesh_element(4,:) !!!!!!!!!!!!!!!!!!!!!!!! deallocate(mesh_cell) end subroutine mesh_init diff --git a/src/mesh_marc.f90 b/src/mesh_marc.f90 index 0bb54ffb8..c999e32d5 100644 --- a/src/mesh_marc.f90 +++ b/src/mesh_marc.f90 @@ -18,10 +18,6 @@ module mesh mesh_Ncells, & !< total number of cells in mesh mesh_maxNsharedElems !< max number of CP elements sharing a node - integer(pInt), dimension(:), allocatable, public, protected :: & - mesh_homogenizationAt, & !< homogenization ID of each element - mesh_microstructureAt !< microstructure ID of each element - integer(pInt), dimension(:,:), allocatable, public, protected :: & mesh_element, & !DEPRECATED mesh_sharedElem, & !< entryCount and list of elements containing node @@ -408,11 +404,8 @@ subroutine mesh_init(ip,el) calcMode = .false. ! pretend to have collected what first call is asking (F = I) calcMode(ip,mesh_FEasCP('elem',el)) = .true. ! first ip,el needs to be already pingponged to "calc" -!!!! COMPATIBILITY HACK !!!! -! better name - mesh_homogenizationAt = mesh_element(3,:) - mesh_microstructureAt = mesh_element(4,:) -!!!!!!!!!!!!!!!!!!!!!!!! + theMesh%homogenizationAt = mesh_element(3,:) + theMesh%microstructureAt = mesh_element(4,:) end subroutine mesh_init