Adapt mesh according to gradient

Asked by Andrew E Slaughter

I am working on a heat transfer problem and would like to incorporate adaptive meshing based on the temperature gradient. I have been working with the undocumented demo: /demo/undocumented/auto-adaptive-poisson/demo-auto-adaptive-poisson.py to learn how to do this.

Using this demo, I figured that to adapt according to the temperature gradient I would simply change the M = u*dx to M = grad(u)*dx, but this causes an error.

What am I doing wrong? Do I need to use the magnitude, if so, how do I do that?

Thanks,
Andrew
P.S. I am using version 1.0.0 and Python

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Best Anders Logg (logg) said :
#1

On Fri, Mar 09, 2012 at 06:15:43PM -0000, Andrew E Slaughter wrote:
> New question #190195 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/190195
>
> I am working on a heat transfer problem and would like to incorporate adaptive meshing based on the temperature gradient. I have been working with the undocumented demo: /demo/undocumented/auto-adaptive-poisson/demo-auto-adaptive-poisson.py to learn how to do this.
>
> Using this demo, I figured that to adapt according to the temperature gradient I would simply change the M = u*dx to M = grad(u)*dx, but this causes an error.
>
> What am I doing wrong? Do I need to use the magnitude, if so, how do I do that?
>
> Thanks,
> Andrew
> P.S. I am using version 1.0.0 and Python

M must be a scalar functional. grad(u) is a vector.

--
Anders

Revision history for this message
Andrew E Slaughter (slaughter98) said :
#2

Thanks Anders Logg, that solved my question.

Revision history for this message
Andrew E Slaughter (slaughter98) said :
#3

Thanks for your quick response on such a trivial question.