Question about how to calculate derivative of stiffness matrix with density

37 views
Skip to first unread message

Lance Zhang

unread,
Sep 17, 2023, 11:32:38 PM9/17/23
to dea...@googlegroups.com
Dear group,

thanks for your time to review this email.

I have queation about the ways to get derivative of stiffness matrix with density.

Currently,I have the stiffness matrix A an density vector v.

If I know the constructing process of cell matrix in code,how should I calculate the derivative of stiffness matrix with density?

A is a 4131*4131 matrix,v is 1024*1 vector. After derivative calculation the result is a 4131*4131*1024 matrix and a Jacobin matrix,if I am wrong ,please provide your suggestions.

Is there any similar examples written in tutorial in dealii?

Could you please provide any hint or suggestions?

This program is based on cook_membrance.cc

Through the program the detail of cell matrix with density can be seen.

Best regards
Lance

Wolfgang Bangerth

unread,
Sep 18, 2023, 7:32:01 PM9/18/23
to dea...@googlegroups.com

> Currently,I have the stiffness matrix A an density vector v.
>
> If I know the constructing process of cell matrix in code,how should I
> calculate the derivative of stiffness matrix with density?
>
> A is a 4131*4131 matrix,v is 1024*1 vector. After derivative calculation
> the result is a 4131*4131*1024 matrix and a Jacobin matrix,if I am wrong
> ,please provide your suggestions.

This is conceptually correct, but it is not how you would store things.
That's because while you could probably store 1024 matrices of size
4131x4131, you definitely can't do that any more if you refine once or
twice more.

But in practice, you also don't have to do that. The density on cell k
only affects the matrix entries (i,j) for degrees of freedom i,j that
are located on cell k. As a consequence, the (i,j,k) entries of the
4131x4131x1024 object is only going to be nonzero if i,j,k all live on
the same cell. In other words, the resulting object is going to be
*very* sparse.

Of course, this only tells you what *not* to do, but you want to know
what to do. This depends on what you need this derivative for. You only
tell us *that* you need the derivative, but not why. Can you outline
what it is you really want to do? In other words, what do you need the
derivative for?

Best
W.

Lance Zhang

unread,
Sep 19, 2023, 11:21:21 AM9/19/23
to dea...@googlegroups.com
Hello Bangerth,

thanks for your reply.

I would like to use adjoint equation to get the gradiant dJ/dΘ.A stands for stiffness matrix and Θ stands for density,J stands for destination function. Finally I will get the value of sensitivity.

Best regards
Lance







--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/d-09gOQBL4A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/8ae56dea-34cf-1eb6-bce5-61e164b10dd9%40colostate.edu.
image (1).png
image.png

Wolfgang Bangerth

unread,
Sep 19, 2023, 11:27:43 AM9/19/23
to dea...@googlegroups.com
On 9/19/23 09:21, Lance Zhang wrote:
>
> I would like to use adjoint equation to get the gradiant dJ/dΘ.A stands for
> stiffness matrix and Θ stands for density,J stands for destination function.
> Finally I will get the value of sensitivity.

Right. But what's the operation you want to do with dJ/dΘ? Do you actually
have to have it element by element, or do you want to do a product with this, etc?

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Lance Zhang

unread,
Sep 19, 2023, 11:33:12 AM9/19/23
to dea...@googlegroups.com
Hello Wolfgang,

I would like to use this method to get the optimization of a original object beam to get a shape of optimized object, for example , the shape of bridge.

Best regards
Lance

Wolfgang Bangerth <bang...@colostate.edu> 于 2023年9月19日周二 23:27写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/d-09gOQBL4A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/ea732ffc-c612-8e18-fe98-c1088bdc0a8c%40colostate.edu.

Wolfgang Bangerth

unread,
Sep 19, 2023, 12:14:08 PM9/19/23
to dea...@googlegroups.com
On 9/19/23 09:32, Lance Zhang wrote:
>
> I would like to use this method to get the optimization of a original object
> beam to get a shape of optimized object, for example , the shape of bridge.

Lance:
As I have mentioned on other occasions before, you need to learn to ask better
questions. I asked

> Right. But what's the operation you want to do with dJ/dΘ? Do you actually
> have to have it element by element, or do you want to do a product with
> this, etc?

but your reply does not actually address this. Instead, your reply was at a
level that is far too high and has nothing to do with the concrete problem of
dJ/dΘ any more. People have written whole books and PhD theses about shape
optimization; the topic is far larger than what can be answered on a mailing list.

There is an art to asking questions. If you ask too specific a question (say,
how do I store dJ/dΘ), then we can give you an answer that does that specific
thing but that does not lead to a practical algorithm because it does not
scale to large problems; but because you do not provide us with the context,
we can not know what it is you want to do that led you to this very specific
question. On the other hand, if questions are too general (say, "I want to do
shape optimization"), then all we can really do is to say "go to the library
and look up specific algorithms". There is a middle ground of questions of the
form "I am working on solving shape optimization problems and in the algorithm
I want to implement, there is a step where I need to multiply dJ/dΘ by a
vector x so that I can get the search direction; how does one efficiently
implement this kind of step? Do I need to store dJ/dΘ somehow, and if so how?"
Oftentimes, this sort of question involves writing half a page of text, but
you will get better answers if you provide context.

My suggestion would be that you work more closely with your adviser where you
can go back and forth between questions and answers more easily than is
possible on a mailing list. Perhaps your adviser can also help you find where
that middle ground of good questions is. That's the role of an adviser, and
that's a role we cannot fill on the mailing list.
Reply all
Reply to author
Forward
0 new messages