SHAPEFUNCTION_TRI Evaluates the basis function on the reference triangle PHI = SHAPEFUNCTION_TRI(Z) Evaluates the basis function phi(x) on the reference (macro) triangle. Z is a 2 x 1 vector containing the x and y coordinates in the reference triangle. PHI contains the evaluated function value. 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 phi=shapefunction_tri(z) 0002 %SHAPEFUNCTION_TRI Evaluates the basis function on the reference triangle 0003 % PHI = SHAPEFUNCTION_TRI(Z) 0004 % Evaluates the basis function phi(x) on the reference (macro) triangle. 0005 % 0006 % Z is a 2 x 1 vector containing the x and y coordinates in the reference 0007 % triangle. 0008 % 0009 % PHI contains the evaluated function value. 0010 % 0011 % 0012 % This function should not be modified. 0013 % 0014 % 0015 % The code is available at http://anmc.epfl.ch/ and described in 0016 % further detail in 0017 % 0018 % A. Abdulle and A. Nonnenmacher 0019 % "A short and versatile finite element multiscale code for 0020 % homogenization problems" 0021 % Computer Methods in Applied Mechanics and Engineering, 0022 % http://dx.doi.org/10.1016/j.cma.2009.03.019 0023 % 0024 % Please cite this article in any publication describing research 0025 % performed using the software. 0026 % 0027 % 0028 % Email : assyr.abdulle@epfl.ch and achim.nonnenmacher@epfl.ch 0029 % Last updated : 04/29/2009 with MATLAB 7.4 0030 % 0031 % FE_HMM2D is Copyright (C) 2009 A. Abdulle and A. Nonnenmacher. 0032 % The software is provided free for non-commercial use unter the terms of 0033 % the GNU General Public License. See "copyright.m" for full details. 0034 0035 % 0036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0037 0038 0039 % x and y coordinates 0040 x=z(:,1); y=z(:,2); 0041 0042 phi(:,1)=1-x-y; 0043 phi(:,2)=x; 0044 phi(:,3)=y; 0045 0046 end