Ignore:
Timestamp:
07/06/09 11:12:27 (15 years ago)
Author:
Mathieu Morlighem
Message:

use GetNodalFunctionsCoeff and GetArea now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/mesh/meshadaptation.m

    r1214 r1236  
    2222disp(sprintf('      metric computation') )
    2323
    24 %load some variables (it is much faster if the variab;es are loaded from md once for all)
     24%initialization
     25index=md.elements;
     26numberofgrids=md.numberofgrids;
    2527numberofelements=md.numberofelements;
    26 numberofgrids=md.numberofgrids;
    27 index=md.elements;
    28 x=md.x; y=md.y; z=md.z;
    29 
    30 %initialization
    31 alpha=zeros(md.numberofelements,3);
    32 beta=zeros(md.numberofelements,3);
    33 gradx=zeros(md.numberofgrids,1);
    34 grady=zeros(md.numberofgrids,1);
    35 metric=zeros(md.numberofelements,1);
     28gradx=zeros(numberofgrids,1);
     29grady=zeros(numberofgrids,1);
     30metric=zeros(numberofelements,1);
    3631
    3732%build some usefull variables
     
    4035summation=1/3*ones(3,1);
    4136linesize=3*numberofelements;
    42 x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3)); y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
    4337
    44 %compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
    45 invdet=1./(x1.*(y2-y3)-x2.*(y1-y3)+x3.*(y1-y2));
    46 alpha=[invdet.*(y2-y3) invdet.*(y3-y1) invdet.*(y1-y2)];
    47 beta=[invdet.*(x3-x2) invdet.*(x1-x3) invdet.*(x2-x1)];
     38%get areas and  nodal functions coefficients N(x,y)=alpha x + beta y + gamma
     39[alpha beta]=GetNodalFunctionsCoeff(index,md.x,md.y);
     40areas=Getareas(index,md.x,md.y);
    4841
    4942%Compute gradient for each element
    5043grad_elx=sum(field(index).*alpha,2);
    5144grad_ely=sum(field(index).*beta,2);
    52 
    53 %compute the volume of each element
    54 areas=area(md);
    5545
    5646%update weights that holds the volume of all the element holding the grid i
Note: See TracChangeset for help on using the changeset viewer.