Modelling viscoelasticity

Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle model with blood perfusion" paper would be pretty easy to add, yes. It would involve modifying fibre_function() in sfepy/terms/terms_fibres.py and creating a new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me some key starting points on how to do it? Another quick question, is, regarding the first term in the expression of active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential term should be introduced by modifying the term_fibers?
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and
I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle model with blood perfusion" paper would be pretty easy to add, yes. It would involve modifying fibre_function() in sfepy/terms/terms_fibres.py and creating a new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

On 10/23/2015 12:39 PM, Patricia Garcia Cañadilla wrote:
Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me some key starting points on how to do it?
Sure:
- make a copy of FibresActiveTLTerm (-> FibresActive2TLTerm (better name?))
and fibre_function() (-> fibre_function2() (better name?)) in the same file.
modify the attributes of the new class:
- name (dw_tl_fib_a2?)
- arg_types, arg_shapes - add kappa
add the new material argument also to .get_fargs()
See also [1] but do no worry - here it is just the above.
[1] http://sfepy.org/doc-devel/developer_guide.html#how-to-implement-a-new-term
Then you would need to compute the rate of the fibre deformation eps. The fibre deformation is computed in fibre_function(), line 16. It might be better to compute that directly in .get_fargs(), and store the current eps as self.eps0 in the class, to be able to get the rate as deps = (eps - eps0) / dt.
Then having eps and deps, update the new fibre_function2() to compute the active tension (fmode == 0), as well as its derivative w.r.t. eps (fmode == 1), just like it is done in fibre_function()
Another quick question, is, regarding the first term in the expression of active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential term should be introduced by modifying the term_fibers?
Above I am talking about adding the "exp{k min(0;de/dt}}" to the exponential term. FibresActiveTLTerm in sfepy is exactly the exponential term without the "exp{k min(0;de/dt}}" part. But you can add also "viscosity coefficient*strain rate" in there, so that the new term computes the entire relation (9). If you manage to add there the exponential part, adding this is trivial. :)
Does this help?
r.
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and
I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle model with blood perfusion" paper would be pretty easy to add, yes. It would involve modifying fibre_function() in sfepy/terms/terms_fibres.py and creating a new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

It helps a lot :)!!!
I will do try this!
Thank you very much for you help :D!
El viernes, 23 de octubre de 2015, 13:28:10 (UTC+2), Robert Cimrman escribió:
On 10/23/2015 12:39 PM, Patricia Garcia Cañadilla wrote:
Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me
some
key starting points on how to do it?
Sure:
- make a copy of FibresActiveTLTerm (-> FibresActive2TLTerm (better
name?)) and fibre_function() (-> fibre_function2() (better name?)) in the same file.
modify the attributes of the new class:
- name (dw_tl_fib_a2?)
- arg_types, arg_shapes - add kappa
add the new material argument also to .get_fargs()
See also [1] but do no worry - here it is just the above.
[1] http://sfepy.org/doc-devel/developer_guide.html#how-to-implement-a-new-term
Then you would need to compute the rate of the fibre deformation eps. The fibre deformation is computed in fibre_function(), line 16. It might be better to compute that directly in .get_fargs(), and store the current eps as self.eps0 in the class, to be able to get the rate as deps = (eps - eps0) / dt.
Then having eps and deps, update the new fibre_function2() to compute the active tension (fmode == 0), as well as its derivative w.r.t. eps (fmode == 1), just like it is done in fibre_function()
Another quick question, is, regarding the first term in the expression
of
active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential
term
should be introduced by modifying the term_fibers?
Above I am talking about adding the "exp{k min(0;de/dt}}" to the exponential term. FibresActiveTLTerm in sfepy is exactly the exponential term without the "exp{k min(0;de/dt}}" part. But you can add also "viscosity coefficient*strain rate" in there, so that the new term computes the entire relation (9). If you manage to add there the exponential part, adding this is trivial. :)
Does this help?
r.
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and
I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle
model
with blood perfusion" paper would be pretty easy to add, yes. It would
involve
modifying fibre_function() in sfepy/terms/terms_fibres.py and creating
a
new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

dera Roberts,
Your comments were so helpful, thanks :).
I am doing the changes in both functions, and I have some questions. When you said to compute eps directly in .get_fargs and stored as self.eps0, then the deps is computed in fiber_function and we would need to have ts (time stepper) also as a parameter, not?
I mean, to define our new class as:
:Arguments:
* - ts : :class:TimeStepper
instance*
- material_1 : :math:f_{\rm max}
- material_2 : :math:\varepsilon_{\rm opt}
- material_3 : :math:s
- material_4 : :math:\ul{d}
- material_5 : :math:A
*- material_6 : :math:\nu
*
""" name = 'dw_tl_fib_a2' arg_types = (*'ts'*, 'material_1', 'material_2', 'material_3', 'material_4', 'material_5', '*material_6', *- material_7 : :math:`\kappa`* - virtual : :math:`\ul{v}` - state : :math:`\ul{u}`
arg_shapes = {'ts' :'1, 1', 'material_1' : '1, 1', 'material_2' : '1,'material_7'*, 'virtual', 'state')
1', 'material_3' : '1, 1', 'material_4' : 'D, 1', 'material_5' : '1, 1', '*material_6' : '1, 1',*
family_data_names = ['green_strain']'material_7' : '1, 1',* 'virtual' : ('D', 'state'), 'state' : 'D'}
and then do:
def get_fargs(self, *ts,* mat1, mat2, mat3, mat4, mat5, *mat6, mat7*, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs):
but I am missing how to calculate eps0 here sorry :(
El viernes, 23 de octubre de 2015, 13:51:27 (UTC+2), Patricia Garcia Cañadilla escribió:
It helps a lot :)!!!
I will do try this!
Thank you very much for you help :D!
El viernes, 23 de octubre de 2015, 13:28:10 (UTC+2), Robert Cimrman escribió:
On 10/23/2015 12:39 PM, Patricia Garcia Cañadilla wrote:
Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me
some
key starting points on how to do it?
Sure:
- make a copy of FibresActiveTLTerm (-> FibresActive2TLTerm (better
name?)) and fibre_function() (-> fibre_function2() (better name?)) in the same file.
modify the attributes of the new class:
- name (dw_tl_fib_a2?)
- arg_types, arg_shapes - add kappa
add the new material argument also to .get_fargs()
See also [1] but do no worry - here it is just the above.
[1] http://sfepy.org/doc-devel/developer_guide.html#how-to-implement-a-new-term
Then you would need to compute the rate of the fibre deformation eps. The fibre deformation is computed in fibre_function(), line 16. It might be better to compute that directly in .get_fargs(), and store the current eps as self.eps0 in the class, to be able to get the rate as deps = (eps - eps0) / dt.
Then having eps and deps, update the new fibre_function2() to compute the active tension (fmode == 0), as well as its derivative w.r.t. eps (fmode == 1), just like it is done in fibre_function()
Another quick question, is, regarding the first term in the expression
of
active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential
term
should be introduced by modifying the term_fibers?
Above I am talking about adding the "exp{k min(0;de/dt}}" to the exponential term. FibresActiveTLTerm in sfepy is exactly the exponential term without the "exp{k min(0;de/dt}}" part. But you can add also "viscosity coefficient*strain rate" in there, so that the new term computes the entire relation (9). If you manage to add there the exponential part, adding this is trivial. :)
Does this help?
r.
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and
I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle
model
with blood perfusion" paper would be pretty easy to add, yes. It would
involve
modifying fibre_function() in sfepy/terms/terms_fibres.py and creating
a
new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

Hi Patricia,
On 10/26/2015 04:19 PM, Patricia Garcia Cañadilla wrote:
dera Roberts,
Your comments were so helpful, thanks :).
I am doing the changes in both functions, and I have some questions. When you said to compute eps directly in .get_fargs and stored as self.eps0, then the deps is computed in fiber_function and we would need to have ts (time stepper) also as a parameter, not?
Yes, you will need ts. Or, alternatively, you could multiply the coefficients that multiply the strain rate (e.g. \nu) by 1/dt, but having the ts arguments is better.
I mean, to define our new class as:
:Arguments: * - ts : :class:
TimeStepper
instance* - material_1 : :math:f_{\rm max}
- material_2 : :math:\varepsilon_{\rm opt}
- material_3 : :math:s
- material_4 : :math:\ul{d}
- material_5 : :math:A
*- material_6 : :math:\nu
*
""" name = 'dw_tl_fib_a2' arg_types = (*'ts'*, 'material_1', 'material_2', 'material_3', 'material_4', 'material_5', '*material_6', *- material_7 : :math:`\kappa`* - virtual : :math:`\ul{v}` - state : :math:`\ul{u}`
arg_shapes = {'ts' :'1, 1', 'material_1' : '1, 1', 'material_2' : '1,'material_7'*, 'virtual', 'state')
1', 'material_3' : '1, 1', 'material_4' : 'D, 1', 'material_5' : '1, 1', '*material_6' : '1, 1',*
family_data_names = ['green_strain']'material_7' : '1, 1',* 'virtual' : ('D', 'state'), 'state' : 'D'}
and then do:
def get_fargs(self, *ts,* mat1, mat2, mat3, mat4, mat5, *mat6, mat7*, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs):
but I am missing how to calculate eps0 here sorry :(
Try using something like this (not tested!) in get_fargs():
eps = ...
if ts.step == 0: deps = nm.zeros_like(eps)
else: deps = (eps - self.eps0) / ts.dt
# Store current eps for the next time-step. self.eps0 = eps
Once that works, we can refine it using evaluate_cache, as in terms_th.py.
r.
El viernes, 23 de octubre de 2015, 13:51:27 (UTC+2), Patricia Garcia Cañadilla escribió:
It helps a lot :)!!!
I will do try this!
Thank you very much for you help :D!
El viernes, 23 de octubre de 2015, 13:28:10 (UTC+2), Robert Cimrman escribió:
On 10/23/2015 12:39 PM, Patricia Garcia Cañadilla wrote:
Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me
some
key starting points on how to do it?
Sure:
- make a copy of FibresActiveTLTerm (-> FibresActive2TLTerm (better
name?)) and fibre_function() (-> fibre_function2() (better name?)) in the same file.
modify the attributes of the new class:
- name (dw_tl_fib_a2?)
- arg_types, arg_shapes - add kappa
add the new material argument also to .get_fargs()
See also [1] but do no worry - here it is just the above.
[1] http://sfepy.org/doc-devel/developer_guide.html#how-to-implement-a-new-term
Then you would need to compute the rate of the fibre deformation eps. The fibre deformation is computed in fibre_function(), line 16. It might be better to compute that directly in .get_fargs(), and store the current eps as self.eps0 in the class, to be able to get the rate as deps = (eps - eps0) / dt.
Then having eps and deps, update the new fibre_function2() to compute the active tension (fmode == 0), as well as its derivative w.r.t. eps (fmode == 1), just like it is done in fibre_function()
Another quick question, is, regarding the first term in the expression
of
active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential
term
should be introduced by modifying the term_fibers?
Above I am talking about adding the "exp{k min(0;de/dt}}" to the exponential term. FibresActiveTLTerm in sfepy is exactly the exponential term without the "exp{k min(0;de/dt}}" part. But you can add also "viscosity coefficient*strain rate" in there, so that the new term computes the entire relation (9). If you manage to add there the exponential part, adding this is trivial. :)
Does this help?
r.
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and
I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle
model
with blood perfusion" paper would be pretty easy to add, yes. It would
involve
modifying fibre_function() in sfepy/terms/terms_fibres.py and creating
a
new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.

But for calculating eps inside get_fargs function like in fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[..., ii, 0]
I would need also as a input argument "green_strain"?
And then return both, fargs and deps not?:
"return deps, fargs"
Sorry for the amount of silly questions, I am very new using Python and finite-element modeling :)
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

On 10/27/2015 12:02 PM, Patricia Garcia Cañadilla wrote:
But for calculating eps inside get_fargs function like in fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[..., ii, 0]
I would need also as a input argument "green_strain"?
I guess not - you can pass both eps and eps0 (or deps) as arguments.
And then return both, fargs and deps not?:
"return deps, fargs"
I see the problem - I will check it soon(ish) :)
Sorry for the amount of silly questions, I am very new using Python and finite-element modeling :)
No problem. The above will need some tweaking of other code, to accommodate for user arguments.
Cheers, r.
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

Hello Patricia,
I did some prototyping that might help you, see [1]. A minor tweak to HyperElasticBase class was needed so that the time stepper and fibre deformation data can be passed to the stress/tangent modulus evaluation functions, and hence to fibre_function().
So either work with that, or wait a bit more - I will make some proper commits next week (returning to my workplace).
r. [1] https://github.com/rc/sfepy/tree/active-fibres-2
On 10/28/2015 08:12 AM, Robert Cimrman wrote:
On 10/27/2015 12:02 PM, Patricia Garcia Cañadilla wrote:
But for calculating eps inside get_fargs function like in fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[..., ii, 0]
I would need also as a input argument "green_strain"?
I guess not - you can pass both eps and eps0 (or deps) as arguments.
And then return both, fargs and deps not?:
"return deps, fargs"
I see the problem - I will check it soon(ish) :)
Sorry for the amount of silly questions, I am very new using Python and finite-element modeling :)
No problem. The above will need some tweaking of other code, to accommodate for user arguments.
Cheers, r.
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re... and I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

Hello Robert,
Thank you very much for your help :). I will look at it, but I can also wait a bit more :), it's not a problem!
El domingo, 1 de noviembre de 2015, 9:08:25 (UTC+1), Robert Cimrman escribió:
Hello Patricia,
I did some prototyping that might help you, see [1]. A minor tweak to HyperElasticBase class was needed so that the time stepper and fibre deformation data can be passed to the stress/tangent modulus evaluation functions, and hence to fibre_function().
So either work with that, or wait a bit more - I will make some proper commits next week (returning to my workplace).
r. [1] https://github.com/rc/sfepy/tree/active-fibres-2
On 10/28/2015 08:12 AM, Robert Cimrman wrote:
On 10/27/2015 12:02 PM, Patricia Garcia Cañadilla wrote:
But for calculating eps inside get_fargs function like in
fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[...,
ii, 0]
I would need also as a input argument "green_strain"?
I guess not - you can pass both eps and eps0 (or deps) as arguments.
And then return both, fargs and deps not?:
"return deps, fargs"
I see the problem - I will check it soon(ish) :)
Sorry for the amount of silly questions, I am very new using Python and finite-element modeling :)
No problem. The above will need some tweaking of other code, to
accommodate for
user arguments.
Cheers, r.
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

Hello Patricia,
I did some improvements, so now it should be much easier for you to implement
the term. Again, it is in my development branch [1]. I force-pushed there, so
when getting the code, use git fetch
(not git pull
!) and then reset your
branch to my version.
See also [2] (especially "synchronize your repository with the upstream" part).
r.
[1] https://github.com/rc/sfepy/tree/active-fibres-2 [2] http://sfepy.org/doc-devel/developer_guide.html#contributing-changes
On 11/02/2015 09:10 AM, Patricia Garcia Cañadilla wrote:
Hello Robert,
Thank you very much for your help :). I will look at it, but I can also wait a bit more :), it's not a problem!
El domingo, 1 de noviembre de 2015, 9:08:25 (UTC+1), Robert Cimrman escribió:
Hello Patricia,
I did some prototyping that might help you, see [1]. A minor tweak to HyperElasticBase class was needed so that the time stepper and fibre deformation data can be passed to the stress/tangent modulus evaluation functions, and hence to fibre_function().
So either work with that, or wait a bit more - I will make some proper commits next week (returning to my workplace).
r. [1] https://github.com/rc/sfepy/tree/active-fibres-2
On 10/28/2015 08:12 AM, Robert Cimrman wrote:
On 10/27/2015 12:02 PM, Patricia Garcia Cañadilla wrote:
But for calculating eps inside get_fargs function like in
fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[...,
ii, 0]
I would need also as a input argument "green_strain"?
I guess not - you can pass both eps and eps0 (or deps) as arguments.
And then return both, fargs and deps not?:
"return deps, fargs"
I see the problem - I will check it soon(ish) :)
Sorry for the amount of silly questions, I am very new using Python and finite-element modeling :)
No problem. The above will need some tweaking of other code, to
accommodate for
user arguments.
Cheers, r.
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and I was wondering if is easy to implemented in sfepy and/or if there is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)

Hello Robert!
Thank you very very much for your help :).
I will tell you something when I implemented the new active-fibers model :)
Congratulations again for such a nice and useful tool!!
Patricia
El miércoles, 4 de noviembre de 2015, 10:13:44 (UTC+1), Robert Cimrman escribió:
Hello Patricia,
I did some improvements, so now it should be much easier for you to implement the term. Again, it is in my development branch [1]. I force-pushed there, so when getting the code, use
git fetch
(notgit pull
!) and then reset your branch to my version.See also [2] (especially "synchronize your repository with the upstream" part).
r.
[1] https://github.com/rc/sfepy/tree/active-fibres-2 [2] http://sfepy.org/doc-devel/developer_guide.html#contributing-changes
On 11/02/2015 09:10 AM, Patricia Garcia Cañadilla wrote:
Hello Robert,
Thank you very much for your help :). I will look at it, but I can also wait a bit more :), it's not a problem!
El domingo, 1 de noviembre de 2015, 9:08:25 (UTC+1), Robert Cimrman escribió:
Hello Patricia,
I did some prototyping that might help you, see [1]. A minor tweak to HyperElasticBase class was needed so that the time stepper and fibre deformation data can be passed to the stress/tangent modulus evaluation functions, and hence to fibre_function().
So either work with that, or wait a bit more - I will make some proper commits next week (returning to my workplace).
r. [1] https://github.com/rc/sfepy/tree/active-fibres-2
On 10/28/2015 08:12 AM, Robert Cimrman wrote:
On 10/27/2015 12:02 PM, Patricia Garcia Cañadilla wrote:
But for calculating eps inside get_fargs function like in
fibre_function:
eps = nm.zeros_like(mat1) omega = nm.empty_like(green_strain) for ii, (ir, ic) in enumerate(iter_sym(fdir.shape[2])): omega[..., ii, 0] = fdir[..., ir, 0] * fdir[..., ic, 0] eps[..., 0, 0] += omega[..., ii, 0] * green_strain[...,
ii, 0]
I would need also as a input argument "green_strain"?
I guess not - you can pass both eps and eps0 (or deps) as arguments.
And then return both, fargs and deps not?:
"return deps, fargs"
I see the problem - I will check it soon(ish) :)
Sorry for the amount of silly questions, I am very new using Python
and
finite-element modeling :)
No problem. The above will need some tweaking of other code, to
accommodate for
user arguments.
Cheers, r.
El viernes, 23 de octubre de 2015, 10:39:07 (UTC+2), Patricia Garcia Cañadilla escribió:
Dear Robert,
I would like to the model the viscoelastic behavior of active
fibers,
as
you done in the paper: "Modelling heart tissue using a composite
muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=re...
and I was wondering if is easy to implemented in sfepy and/or if there
is
some
predefined term in Sfepy, since for example the term "dw_tl_fib_a"
doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)
participants (2)
-
Patricia Garcia Cañadilla
-
Robert Cimrman