Last active
August 24, 2020 07:59
-
-
Save dwatanabee/0b09e3f393a1b5af1aba7e67c004c0a7 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#ifdef _OPENMP | |
#include <omp.h> | |
#endif | |
#include "../headers/function_header.h" | |
extern struct _PROBLEM *problem; | |
extern struct _FLAGS *flags; | |
void density_filter(FEM *actfem) | |
{ | |
int i, j, ID; | |
double H, r, dis; | |
PROBLEM *prob; | |
ELEMENT *actele1, *actele2; | |
NODE *actnode; | |
prob = problem; | |
/*--------------------------------------------------------- cal df / ds */ | |
for (i = 0; i < actfem->nelx; i++) | |
{ | |
actele1 = &(actfem->element[i]); | |
r = actele1->filter->r; | |
/*-----------initialization------------------*/ | |
actele1->filobj = 0.0; | |
/*summation of density filter*/ | |
for (j = 0; j < actele1->filter->numele; j++) | |
{ | |
ID = actele1->filter->ID[j]; | |
dis = actele1->filter->dis[j]; | |
actele2 = &(actfem->element[ID]); | |
H = r - dis; | |
actele1->filobj += actele2->obj * H * actele2->filsensi; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
obj...raw sensitivity of objective (or constraint) function
filobj...filtered sensitivity