HMM_MICROSTIMA_QUAD Computes element stiffness matrix for micro parallelograms. M = HMM_MICROSTIMA_QUAD(VERTICES, MACROQUADNODE, EPSILON) computes the entry to the micro element stiffness matrix for parallelograms. VERTICES has dimension 4 x 2, where the first column gives the x-coordinates of the vertices and the second column their y-coordinates. MACROQUADNODE has dimension 1 x 2 and contains the x and y coordinates of the current quadrature node of the macro element EPSILON is the periodicity of the tensor a M has dimension 4 x 4. The vertices are numbered anti-clockwise. This function should not be modified. The code is available at http://anmc.epfl.ch/ and described in further detail in A. Abdulle and A. Nonnenmacher "A short and versatile finite element multiscale code for homogenization problems" Computer Methods in Applied Mechanics and Engineering, http://dx.doi.org/10.1016/j.cma.2009.03.019 Please cite this article in any publication describing research performed using the software. Email : assyr.abdulle@epfl.ch and achim.nonnenmacher@epfl.ch Last updated : 04/29/2009 with MATLAB 7.4 FE_HMM2D is Copyright (C) 2009 A. Abdulle and A. Nonnenmacher. The software is provided free for non-commercial use unter the terms of the GNU General Public License. See "copyright.m" for full details.
0001 function M = hmm_microstima_quad(vertices,... 0002 MacroQuadNode, epsilon) 0003 %HMM_MICROSTIMA_QUAD Computes element stiffness matrix for micro parallelograms. 0004 % M = HMM_MICROSTIMA_QUAD(VERTICES, MACROQUADNODE, EPSILON) 0005 % computes the entry to the micro element stiffness matrix for parallelograms. 0006 % 0007 % VERTICES has dimension 4 x 2, where the first column gives 0008 % the x-coordinates of the vertices and the second column their 0009 % y-coordinates. 0010 % 0011 % MACROQUADNODE has dimension 1 x 2 and contains the x and y 0012 % coordinates of the current quadrature node of the macro element 0013 % 0014 % EPSILON is the periodicity of the tensor a 0015 % 0016 % M has dimension 4 x 4. The vertices are numbered 0017 % anti-clockwise. 0018 % 0019 % 0020 % This function should not be modified. 0021 % 0022 % 0023 % The code is available at http://anmc.epfl.ch/ and described in 0024 % further detail in 0025 % 0026 % A. Abdulle and A. Nonnenmacher 0027 % "A short and versatile finite element multiscale code for 0028 % homogenization problems" 0029 % Computer Methods in Applied Mechanics and Engineering, 0030 % http://dx.doi.org/10.1016/j.cma.2009.03.019 0031 % 0032 % Please cite this article in any publication describing research 0033 % performed using the software. 0034 % 0035 % 0036 % Email : assyr.abdulle@epfl.ch and achim.nonnenmacher@epfl.ch 0037 % Last updated : 04/29/2009 with MATLAB 7.4 0038 % 0039 % FE_HMM2D is Copyright (C) 2009 A. Abdulle and A. Nonnenmacher. 0040 % The software is provided free for non-commercial use unter the terms of 0041 % the GNU General Public License. See "copyright.m" for full details. 0042 0043 % 0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0045 0046 0047 % map from reference element 0048 Map=[vertices(2,:)-vertices(1,:);vertices(4,:)-vertices(1,:)]'; 0049 0050 % gauss quadrature at the 4 quadrature nodes, reference element and mapped 0051 % element 0052 quadnodes_ref=[.5-sqrt(3)/6, .5+sqrt(3)/6, .5-sqrt(3)/6, .5+sqrt(3)/6;... 0053 .5-sqrt(3)/6, .5-sqrt(3)/6, .5+sqrt(3)/6, .5+sqrt(3)/6]; 0054 quadnodes= Map*quadnodes_ref+repmat(vertices(1,:)',1,4); 0055 0056 M=zeros(4,4); 0057 for node=1:4 0058 quadnode=quadnodes(:,node); 0059 x=quadnodes_ref(1,node); 0060 y=quadnodes_ref(2,node); 0061 0062 phi_prime_hat=[y-1, x-1; 1-y, -x; y, x; -y, 1-x]; 0063 phi_prime_invD=(phi_prime_hat/Map); 0064 0065 % evaluate coefficiency tensor at the specific nodes 0066 a=tensor_a(MacroQuadNode, quadnode/epsilon); 0067 M=M+(det(Map))*phi_prime_invD*a*phi_prime_invD'; 0068 end 0069 M=M/4; 0070 0071 end