No BSD License  

Highlights from
Modular Filter Technique on Automatic Mesh Functions

modularfilter

Contents

%__________________________________________________________________________
%MODULAR FILTER TECHNIQUE ON AUTOMATIC MESH COORDINATES   (A.Ö)27.01.2007 |
%_________________________________________________________________________|
%Mesh coordinates :possible surface           |    (meshx,meshy)          |
%                 :possible volume or solid   | (meshx, meshy, mesz)      |
%_____________________________________________|___________________________|
%FUNCTION                                                                 |
%Modularmap(modularfilterpoints,totala,totalb,totalc,meshx,meshy,mehz)    |
%modularfilterpoints: Locked or non-connecting node's modular values      |
%              meshx:"x" axis direction mesh (value)                      |
%              meshx:"y" axis direction mesh (value)                      |
%              meshx:"z" axis direction mesh (value)                      |
%             totala: "x" axis direction total length  (m)                |
%             totalb: "y" axis direction total width   (m)                |
%             totalc: "z" axis direction total heigth  (m)                |
%_____________________________________________________Matlab ver(all)_____|

clc
clear

%##################### INPUT VALUES ##################
totala  = 1.00;
totalb  = 1.00;
totalc  = 1.00;
meshx   = 4;
meshy   = 3;
meshz   = 2;
%Random Modular Filter (will Lock) nodes
%modular map        [mod(X) mod(Y) mod(Z)]
modularfilterpoints=[0   0   0
                     1   1   1
                     3   2   1
                     1   2   2
                     1   0   2
                     2   2   2] ;
%###################

Describe the automatic mesh surfaces or volumes is grid spaces

gridspacex = totala/meshx;  % along to "x" axis direction mesh space
gridspacey = totalb/meshy;  % along to "y" axis direction mesh space
if meshz ==0
display('DEFINE FLAT SURFACE MESH')
gridspacez=0;
else
display('DEFINE SOLID SURFACE MESH')
gridspacez = totalc/meshz;  % along to "z" axis direction mesh space
end
DEFINE SOLID SURFACE MESH

Definite all nodes modular map [modmap]

dim=1;
for ars=1:meshz+1
    for sut=1:meshy+1
         for sat=1:meshx+1 %Element edge node reference axis

modmap(dim,:)=[mod(sat,meshx+1) ...
               mod(sut,meshy+1) ...
               mod(ars,meshz+1) ];
           dim=dim+1;
         end
    end
end

value=1;
modularfilters(size(modularfilterpoints,1),3)=0;

Selected Random Filter Values Ordering for [Modmap]

for numerator=1:size(modmap,1)
    for i=1:size(modularfilterpoints,1)
%        [modmap(numerator,:) modularfilterpoints(i,:) value]
        if  modmap(numerator,:)==modularfilterpoints(i,1:3)
        modularfilters(value,:)=modularfilterpoints(i,:);
        value=value+1;
        end
    end
end

Locked Selecting Modular Nodes on Automatic Mesh

dim=1;
filternum=1;


for ars=1:meshz+1
    for sut=1:meshy+1
         for sat=1:meshx+1 %Element edge node reference axis

modmap(dim,:)=[mod(sat,meshx+1) ...
               mod(sut,meshy+1) ...
               mod(ars,meshz+1) ];

if    mod(sat,meshx+1)==modularfilters(filternum,1) ...
    && mod(sut,meshy+1)==modularfilters(filternum,2) ...
    && mod(ars,meshz+1)==modularfilters(filternum,3)

          x=inf;
          y=inf;
          z=inf;
Cor(dim,:)=[x y z];
if filternum == size(modularfilters,1)
ars=meshz+1;
filternum=1;
end
dim=dim+1;
filternum=filternum+1;
else
modmap(dim,:)=[mod(sat,meshx+1) ...
               mod(sut,meshy+1) ...
               mod(ars,meshz+1) ];

          x=(sat-1)*gridspacex;
          y=(sut-1)*gridspacey;
          z=(ars-1)*gridspacez;

%Global axis system nodes position
          Cor(dim,:)=[x y z];
         %Cor(dim,1)=x;    %"x" global coordinate value
         %Cor(dim,2)=y;    %"y" global coordinate value
         %Cor(dim,3)=z;
         dim=dim+1;
end

         end
    end
end%___________________________________________|

Modular Filter Technique on Automatic Mesh Coordinates

fprintf(' \n')
display('SELECTED MODULAR FILTER=======[Mod(x)-Mod(y)-Mod(z)]')
modularfilterpoints

display('SATIFY  MODULAR FILTER=======[Mod(x)-Mod(y)-Mod(z)]')
modularfilters

display ('COORDINATES');
display ('==Point(No)==---[ (X)   (Y)    (Z)]---=== Modularmap ===');
fprintf(' \n')
for s=1:size(Cor,1);
%fprintf('        [% .7f]  [% .7f]  [% .7f]  [% .7f]  \n',Cor(s,:);
fprintf('     (%.f)--[%.4f] [%.4f] [%.4f] (%.f %.f %.f)\n',s,Cor(s,:),modmap(s,:) );
if mod(s,3)==0; fprintf(' \n');end;
end%____________________________________|
 
SELECTED MODULAR FILTER=======[Mod(x)-Mod(y)-Mod(z)]

modularfilterpoints =

     0     0     0
     1     1     1
     3     2     1
     1     2     2
     1     0     2
     2     2     2

SATIFY  MODULAR FILTER=======[Mod(x)-Mod(y)-Mod(z)]

modularfilters =

     1     1     1
     3     2     1
     1     2     2
     2     2     2
     1     0     2
     0     0     0

COORDINATES
==Point(No)==---[ (X)   (Y)    (Z)]---=== Modularmap ===
 
     (1)--[Inf] [Inf] [Inf] (1 1 1)
     (2)--[0.2500] [0.0000] [0.0000] (2 1 1)
     (3)--[0.5000] [0.0000] [0.0000] (3 1 1)
 
     (4)--[0.7500] [0.0000] [0.0000] (4 1 1)
     (5)--[1.0000] [0.0000] [0.0000] (0 1 1)
     (6)--[0.0000] [0.3333] [0.0000] (1 2 1)
 
     (7)--[0.2500] [0.3333] [0.0000] (2 2 1)
     (8)--[Inf] [Inf] [Inf] (3 2 1)
     (9)--[0.7500] [0.3333] [0.0000] (4 2 1)
 
     (10)--[1.0000] [0.3333] [0.0000] (0 2 1)
     (11)--[0.0000] [0.6667] [0.0000] (1 3 1)
     (12)--[0.2500] [0.6667] [0.0000] (2 3 1)
 
     (13)--[0.5000] [0.6667] [0.0000] (3 3 1)
     (14)--[0.7500] [0.6667] [0.0000] (4 3 1)
     (15)--[1.0000] [0.6667] [0.0000] (0 3 1)
 
     (16)--[0.0000] [1.0000] [0.0000] (1 0 1)
     (17)--[0.2500] [1.0000] [0.0000] (2 0 1)
     (18)--[0.5000] [1.0000] [0.0000] (3 0 1)
 
     (19)--[0.7500] [1.0000] [0.0000] (4 0 1)
     (20)--[1.0000] [1.0000] [0.0000] (0 0 1)
     (21)--[0.0000] [0.0000] [0.5000] (1 1 2)
 
     (22)--[0.2500] [0.0000] [0.5000] (2 1 2)
     (23)--[0.5000] [0.0000] [0.5000] (3 1 2)
     (24)--[0.7500] [0.0000] [0.5000] (4 1 2)
 
     (25)--[1.0000] [0.0000] [0.5000] (0 1 2)
     (26)--[Inf] [Inf] [Inf] (1 2 2)
     (27)--[Inf] [Inf] [Inf] (2 2 2)
 
     (28)--[0.5000] [0.3333] [0.5000] (3 2 2)
     (29)--[0.7500] [0.3333] [0.5000] (4 2 2)
     (30)--[1.0000] [0.3333] [0.5000] (0 2 2)
 
     (31)--[0.0000] [0.6667] [0.5000] (1 3 2)
     (32)--[0.2500] [0.6667] [0.5000] (2 3 2)
     (33)--[0.5000] [0.6667] [0.5000] (3 3 2)
 
     (34)--[0.7500] [0.6667] [0.5000] (4 3 2)
     (35)--[1.0000] [0.6667] [0.5000] (0 3 2)
     (36)--[Inf] [Inf] [Inf] (1 0 2)
 
     (37)--[0.2500] [1.0000] [0.5000] (2 0 2)
     (38)--[0.5000] [1.0000] [0.5000] (3 0 2)
     (39)--[0.7500] [1.0000] [0.5000] (4 0 2)
 
     (40)--[1.0000] [1.0000] [0.5000] (0 0 2)
     (41)--[0.0000] [0.0000] [1.0000] (1 1 0)
     (42)--[0.2500] [0.0000] [1.0000] (2 1 0)
 
     (43)--[0.5000] [0.0000] [1.0000] (3 1 0)
     (44)--[0.7500] [0.0000] [1.0000] (4 1 0)
     (45)--[1.0000] [0.0000] [1.0000] (0 1 0)
 
     (46)--[0.0000] [0.3333] [1.0000] (1 2 0)
     (47)--[0.2500] [0.3333] [1.0000] (2 2 0)
     (48)--[0.5000] [0.3333] [1.0000] (3 2 0)
 
     (49)--[0.7500] [0.3333] [1.0000] (4 2 0)
     (50)--[1.0000] [0.3333] [1.0000] (0 2 0)
     (51)--[0.0000] [0.6667] [1.0000] (1 3 0)
 
     (52)--[0.2500] [0.6667] [1.0000] (2 3 0)
     (53)--[0.5000] [0.6667] [1.0000] (3 3 0)
     (54)--[0.7500] [0.6667] [1.0000] (4 3 0)
 
     (55)--[1.0000] [0.6667] [1.0000] (0 3 0)
     (56)--[0.0000] [1.0000] [1.0000] (1 0 0)
     (57)--[0.2500] [1.0000] [1.0000] (2 0 0)
 
     (58)--[0.5000] [1.0000] [1.0000] (3 0 0)
     (59)--[0.7500] [1.0000] [1.0000] (4 0 0)
     (60)--[Inf] [Inf] [Inf] (0 0 0)
 

Contact us at files@mathworks.com