JuliaTopOpt / TopOpt.jl

A package for binary and continuous, single and multi-material, truss and continuum, 2D and 3D topology optimization on unstructured meshes using automatic differentiation in Julia.
https://juliatopopt.github.io/TopOpt.jl/
Other
181 stars 30 forks source link

Setting up a TopOpt problem from scratch with a given Ferrite mesh and boundary conditions #158

Closed suurj closed 12 months ago

suurj commented 1 year ago

We would like to perform topological optimization (minimizing the compliance) in TopOpt with a given initial mesh (let us say with linear triangle/tetrahedral elements in either 2D or 3D). However, is there a way to construct a TopOpt problem with the mesh without using the INP import feature? Basically, we would want to construct Ferrite grid with the mesh, and then assign the loads and other boundary values in a suitable problem struct in TopOpt. Most likely this is all we need because our meshes and load models are manageably simple.

Additionally, is there a sample INP file available for experimenting with the INP import feature?

suurj commented 12 months ago

I am closing this issue because it is possible to implement a custom problem by manually constructing the InpContent struct by calling (with properly typed arguments) inpcontent = TopOpt.TopOptProblems.InputOutput.INP.Parser.InpContent(node_coords,celltype,cells,nodesets,cellsets,E,ν,density,nodedbcs,cloads,facesets,dloads)

and after that problem = InpStiffness(inpcontent)

mohamed82008 commented 12 months ago

Hey, sorry this issue dropped off my radar. I just saw it. Your solution is indeed the right solution, well done figuring it out from reading the src! Please open an issue and ping me if you have any more questions or join our Slack channel #topopt on the Julia Slack.

suurj commented 12 months ago

Hi,

No problem, and thanks! We are doing topology/shape optimization stuff at the moment and might drop by the Slack channel sometimes (we have joined already).

mohamed82008 commented 12 months ago

Good luck!