How to start a static analysis with element density data?

User: "Faik Fatih Korkmaz"
Altair Community Member
Updated by Faik Fatih Korkmaz

Hello,

I am working on density-based method topology optimization. The compliance optimization is defined as:

  • find X = [x_1, x_2, ... ]^T
  • min u^T * K(X) * u
  • such that K(X)*u = F and sum of all x_j * dV - V <=0
  • (X: element density, u: displacement vector, K: global stiffness matrix, F: external force vector, V: constraint volume)

I want to start a linear static analysis with X = [x_1, x_2, ... ]^T initial element density as an input. Optistruct can optimize this process itself but I want to try novel filters, penalty algorithms, other optimization algorithms etc. without using optistruct topology optimization. 

To try this, I can modify the optistruct FEM file, for example defining different material and property for every mesh element. But this method takes a long time.

Optistruct has already suitable to optimize like that. How I can do easily what I explained?

Thanks.

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "tinh"
    Altair Community Member
    Accepted Answer
    Updated by tinh

    Hi

    Attached file is a sample script.

    Tested on HM2019:

    image

    proc changeE args { 	set inputX [tk_getOpenFile -title "Select file of input X:"] 	if {[file exists $inputX]} { 		set fpt [open $inputX r] 		set elemId_Ef [read -nonewline $fpt] 		close $fpt 		*setoption mixed_property_warning=0 		*createmarkpanel elems 1 "Select elements to be assigned new E:" 		foreach elemId [hm_getmark elems 1] { 			#get current material infos: 			set elemMatName [hm_getentityvalue elems $elemId material.name 1] 			set elemE [hm_getentityvalue elems $elemId material.\$E 0] 			if {![dict exists $elemId_Ef $elemId]} continue 			set elemEf [dict get $elemId_Ef $elemId] 			set elemNewE [expr {$elemE * $elemEf}] 			#create new material: 			set newMatName [hm_getincrementalname mats NEWMAT_] 			*collectorcreatesameas materials $newMatName $elemMatName "" 11 			#assign new E: 			set newMatId [hm_latestentityid mats] 			*attributeupdatedouble materials $newMatId 1 1 1 0 $elemNewE 			#get current property infos: 			set elemPropName [hm_getentityvalue elems $elemId property.name 1] 			#create new property: 			set newPropName [hm_getincrementalname props NEWPROP_] 			*collectorcreatesameas properties $newPropName $elemPropName "" 11 			#assign new material: 			*createmark props 1 -1 			*materialupdate props 1 $newMatName 			#assign new property: 			*createmark elems 1 $elemId 			*propertyupdate elements 1 $newPropName 		} 		*setoption mixed_property_warning=1 		*setelementcolormode 3 		*EntityPreviewUnused materials 1 		*deletemark mats 1 		*createmark mats 1 all 		*autocolorwithmark mats 1 		*createmark props 1 all 		*autocolorwithmark props 1 	} } changeE