Dear,

I’m working with topological optimization and would like to analyze situations involving dynamics problems.

To begin with, analyzing a problem of: Free Vibration and eigenvalue problem.

According to Topology Optimization | SpringerLink, to maximize eigenvalue we have:

\max_{\rho } \ \beta

s.t.:\ \lambda_{i} \geq \beta ,\ i=1,...,N_{dof,}

\left( K-\lambda_{i} M\right) \Phi_{i} =0,\ i=1,...,N_{dof},

\sum^{N}_{e=1} v_{e}\rho_{e} \leq V,\ \ \ \ 0<\rho_{min} \leq \rho_{e} \leq 1,\ \ e=1,...,N

And the sensitivities of a single modal eigenvalue are simple found as:

\frac{\partial \lambda_{i} }{\partial \rho_{e} } =\Phi^{T}_{i} \left[ \frac{\partial K}{\partial \rho_{e} } -\lambda_{i} \frac{\partial M}{\partial \rho_{e} } \right] \Phi_{i}

So, considering the optimization approach made using the dolfin-adjoint, I need to solve the “forward” function using modal analysis, solving the eigenvalues and eigenvectors and “assemble” the J = “eigenvalues” and deliver to the Jhat = ReducedFunctional( J, m).

But my problem is that I tried the possible “conversions” and I can’t “send” r(eingenvalue) to J.

And I would still like to understand how to insert the sensitivity equation into fenics. The fact that considering the optimization method, the sensitivity equation would be the compliance itself to be calculated in the adjoint method.

I recently read a work, however, I believe that the approach mixed modal analysis with forced analysis and I was even more doubtful.

Could someone help me with this “conversion” that is generated by petsc(r - eigenvalue) to send to the dolfin adjoint?

I’m using the code summarized below for reasons I haven’t published it yet.

https://comet-fenics.readthedocs.io/en/latest/demo/modal_analysis_dynamics/cantilever_modal.html

My optimization code is based on the following example:

http://www.dolfin-adjoint.org/en/latest/documentation/poisson-topology/poisson-topology.html

Obs.:

if I consider the following situation:

```
N_eig = 1 # number of eigenvalues
eigensolver.solve(N_eig)
# Extraction
r, c, rx, cx = eigensolver.get_eigenpair(0)
# r = eigenvalue
# rx = eigenvector
# Initialize function and assign eigenvector
eigenvector = Function(V, name = "Eigenvector")
eigenvector.vector()[:] = rx
eigenvalue = Function(V, name = "Eigenvalue")
eigenvalue.vector()[:] = r
...
J = eigenvalue
m = Control(rho_n)
Jhat = ReducedFunctional(J, m)
...
```

generates the error:

```
Traceback (most recent call last):
File "OTE_modal_Dynamic_cantilever_3D_versao00_1_noload.py", line 207, in <module>
rho_opt = solver.solve()
File "/Users/rafaelferr0/anaconda3/envs/fenics2/lib/python3.8/site-packages/pyadjoint/optimization/ipopt_solver.py", line 199, in solve
results = self.ipopt_problem.solve(guess)
File "src/cyipopt.pyx", line 581, in cyipopt.problem.solve
File "src/cyipopt.pyx", line 617, in cyipopt.objective_cb
File "/Users/rafaelferr0/anaconda3/envs/fenics2/lib/python3.8/site-packages/pyadjoint/reduced_functional_numpy.py", line 36, in __call__
return self.rf.__call__(self.set_local(m_copies, m_array))
File "/Users/rafaelferr0/anaconda3/envs/fenics2/lib/python3.8/site-packages/pyadjoint/tape.py", line 46, in wrapper
return function(*args, **kwargs)
File "/Users/rafaelferr0/anaconda3/envs/fenics2/lib/python3.8/site-packages/pyadjoint/reduced_functional.py", line 137, in __call__
func_value = self.scale * self.functional.block_variable.checkpoint
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
```