Tariq, 

I personally use Table<2, YourFavoriteSacadoTypeHere>. In order to maintain 
differentiability, you have to make sure that the entire chain of operations 
that go from 

x

to 

F(x)

is done through Sacado Types. If this is true, then you can get dF/dx_i. Step 
33 explains this very well, but untill you try getting your hands dirty, it all 
looks like "black magic" (at least it did for me).

The easiest way to achieve this is by templatizing all your functions on the 
type, and then instantiating for sacado types. I can send you some code 
snippets taken from my work, if you want to see how this works. 

L.

--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone:  +39 040 3787 449, Office: 255
--
There are no answers, only cross references.






On 16/mag/2010, at 18.51, Markus Bürg wrote:

> Hello Tariq,
> 
> thanks for the clarification. Which rank has the tensor-value of your 
> function, 1 or 2?
> 
> Best Regards,
> Markus
> 
> 
> 
> Am 16.05.10 16:17, schrieb tarbaig:
>> Hi Markus,
>> 
>> I took my time to think about what I want to do so here is my problem
>> and my Idea.
>> 
>> Of course you are right to say that a tensor in dealii as object living
>> at a point. The term tensor-field would be better. In deal I think the
>> most common tensor field is that constituted by the "Gradient" of a
>> Vectorvalued Function.
>> If I want to solve an PDE depending on a tensor-field using e.g. newton
>> iterations and do not want to compute the linearization by hand , but
>> rather using sacado, I will have to do something similar to stepp 33 but
>> with tensors. This gets ugly very fast, so I thought it would be nice to
>> have something like a class derivable_tensor that can be used for this
>> purpose.
>> 
>> Does anyone have an idea how to implement something like that ?
>> The sacado documentation is a little bit sparse and I am not sure how to
>> implement methods that do not destroy the property of being derivable.
>> The ugly C way to generate something that does the trick would be
>> preprocessor magic by macros but of course this is undesirable.
>> 
>> Greetings tariq
>> 
>>   
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to