Changeset 17774


Ignore:
Timestamp:
04/18/14 13:22:29 (11 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing split of prismatic mesh into tets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/model.m

    r17757 r17774  
    12101210                                        error('Case not supported'); %not supposed to happen!
    12111211                                end
     1212                                %Reorder elements to make sure they are direct
     1213                                for j=1:3
     1214                                        element = elements(3*(i-1)+j,:);
     1215                                        matrix = [md.mesh.x(element), md.mesh.y(element), md.mesh.z(element), ones(4,1)];
     1216                                        if det(matrix)>0,
     1217                                                elements(3*(i-1)+j,1)=element(2);
     1218                                                elements(3*(i-1)+j,2)=element(1);
     1219                                        end
     1220                                end
    12121221                        end
    12131222                        %%Split in 3 tetras
     
    12161225                        %subelement3 = [5 6 3 1];
    12171226                        %elements=[md.mesh.elements(:,subelement1);md.mesh.elements(:,subelement2);md.mesh.elements(:,subelement3)];
    1218                         disp([num2str(steiner) ' Steiner points had to be included'])
     1227                        if steiner==0,
     1228                                disp('No Steiner point required to split prismatic mesh into tets');
     1229                        else
     1230                                disp([num2str(steiner) ' Steiner points had to be included'])
     1231                                error('Steiner point not supported yet');
     1232                        end
    12191233
    12201234                        pos_elements = repmat([1:md.mesh.numberofelements]',3,1);
     
    12241238
    12251239                        %p and q (same deal, except for element that are on the bedrock: )
    1226                         md.friction.p=md.friction.p(pos_elements);
    1227                         md.friction.q=md.friction.q(pos_elements);
     1240                        if ~isnan(md.friction.p),
     1241                                md.friction.p=md.friction.p(pos_elements);
     1242                                md.friction.q=md.friction.q(pos_elements);
     1243                        end
    12281244
    12291245                        %elementstype
     
    12371253
    12381254                        %materials
    1239                         md.materials.rheology_n=md.materials.rheology_n(pos_elements);
     1255                        if ~isnan(md.materials.rheology_n),
     1256                                md.materials.rheology_n=md.materials.rheology_n(pos_elements);
     1257                        end
    12401258
    12411259                        %increase connectivity if less than 25:
Note: See TracChangeset for help on using the changeset viewer.