Last active
August 24, 2020 08:03
-
-
Save dwatanabee/286b91f9e8ffef4fe7ee6fd0f35d1999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------density filter*/ | |
void opt_filter_density(FEM *actfem, int iter) | |
{ | |
int i,j,ID; | |
double r,dis; | |
double H; | |
double SUM[10]; | |
ELEMENT *actele1,*actele2; | |
for(i=0;i<actfem->nelx;i++) | |
{ | |
actele1 = &(actfem->element[i]); | |
r = actele1->filter->r; | |
for(j=0;j<10;j++) SUM[j] = 0.0; | |
for(j=0;j<actele1->filter->numele;j++) | |
{ | |
ID = actele1->filter->ID[j]; | |
dis = actele1->filter->dis[j]; | |
actele2 = &(actfem->element[ID]); | |
if(dis <= r) | |
{ | |
H = r - dis; | |
SUM[0] += H; | |
SUM[1] += H * actele2->xi; | |
} | |
} | |
actele1->filxi = SUM[1] / SUM[0];//filtered design variable | |
actele1->filsensi= 1.0 / SUM[0];//use to calculate sensitivity | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xi...design variable
filxi...filtered design variable
filsensi...sum of weight coefficient
H...weight coefficient
about structure "filter"
r...radius of filter
dis...distance between the center each of the element
numele...The number of surrounding elements (actele2) involved in an element (actele1)