Hi,
I have been familiarizing myself with sfepy for the last week or so. So far, I like what I see! :)
My question is regarding the time stepping solver. I would like to step through the frequency domain instead of in time. My naive understanding is to convert time derivatives to iomega by assuming the solution has the form exp(iomega*t). I believe this is what is done in input/piezo.py, where the mass term is multiplied by omega_squared.
So based off that assumption, I added the time stepping solver to input/piezo.py as shown in input/time_poisson.py. Then I tried a couple ways to get the omega_squared value to depend on ts.time. The current way I'm trying is to multiply the 'density' parameter by ts.time**2 (assuming ts.time actually represents the frequency) in the get_inclusion_pars function, and removed completely the omega_squared string substitution in the equation definition (please see the attached file). This seems to work ok, but I'm not sure this is the best way to include the frequency in the equation definition. I.e., it's not very explicit. Is there a better way to do this? Also, is using the time stepping solver in this manner okay, or is there something I'm ignoring like the result becoming incorrect because it depends on the previously "frequency"?
Thanks very much!
Best regards, Logan
Hi Logan,
thanks for trying sfepy and sorry for the delayed response, I was on holidays (no net in mountains).
Logan Sorenson wrote:
Hi,
I have been familiarizing myself with sfepy for the last week or so. So far, I like what I see! :)
Glad to hear that!
My question is regarding the time stepping solver. I would like to step through the frequency domain instead of in time. My naive understanding is to convert time derivatives to iomega by assuming the solution has the form exp(iomega*t). I believe this is what is done in input/piezo.py, where the mass term is multiplied by omega_squared.
Yes, the solution in input/piezo.py is supposed to be a stationary wave in the form u(x,t) = u exp(iomegat) and phi(x,t) = phi exp(iomegat), so the resulting u, phi are the amplitudes of the wave.
So based off that assumption, I added the time stepping solver to input/piezo.py as shown in input/time_poisson.py. Then I tried a couple ways to get the omega_squared value to depend on ts.time. The current way I'm trying is to multiply the 'density' parameter by ts.time**2 (assuming ts.time actually represents the frequency) in the get_inclusion_pars function, and removed completely the omega_squared string substitution in the equation definition (please see the attached file). This seems to work ok, but I'm not sure this is the best way to include the frequency in the equation definition. I.e., it's not very explicit. Is there a better way to do this? Also, is using the time stepping solver in this manner okay, or is there something I'm ignoring like the result becoming incorrect because it depends on the previously "frequency"?
There are a couple of ways how make this parametric study with varying the frequency. The first one is the one you have used - adding a pseudo-time stepping, with time representing the frequency.
The other way is to use the parametric hook function, as done in input/poisson_parametric_study.py example. Basically, you need to define a function, that after each computation modifies some parameters of the problem. As that function gets a ProblemDefinition instance, it can change really anything (even return completely other problem). In the example mentioned, there is a function called vary_omega1_size() that changes a size of a subdomain. The example is commented, so it should get you started.
The latter way is completely general, but is probably an overkill for you. Anyway, I am back, so ask at will. :-)
best regards, r.
Hi Robert,
On Mon, Aug 10, 2009 at 3:10 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote: >
Hi Logan,
thanks for trying sfepy and sorry for the delayed response, I was on holidays (no net in mountains).
No problem! Glad you had a chance to escape to nature. Hope you caught some good scenery up there. :)
>
Logan Sorenson wrote:
Hi,
I have been familiarizing myself with sfepy for the last week or so. So far, I like what I see! :)
Glad to hear that!
My question is regarding the time stepping solver. I would like to step through the frequency domain instead of in time. My naive understanding is to convert time derivatives to iomega by assuming the solution has the form exp(iomega*t). I believe this is what is done in input/piezo.py, where the mass term is multiplied by omega_squared.
Yes, the solution in input/piezo.py is supposed to be a stationary wave in the form u(x,t) = u exp(iomegat) and phi(x,t) = phi exp(iomegat), so the resulting u, phi are the amplitudes of the wave.
So based off that assumption, I added the time stepping solver to input/piezo.py as shown in input/time_poisson.py. Then I tried a couple ways to get the omega_squared value to depend on ts.time. The current way I'm trying is to multiply the 'density' parameter by ts.time**2 (assuming ts.time actually represents the frequency) in the get_inclusion_pars function, and removed completely the omega_squared string substitution in the equation definition (please see the attached file). This seems to work ok, but I'm not sure this is the best way to include the frequency in the equation definition. I.e., it's not very explicit. Is there a better way to do this? Also, is using the time stepping solver in this manner okay, or is there something I'm ignoring like the result becoming incorrect because it depends on the previously "frequency"?
There are a couple of ways how make this parametric study with varying the frequency. The first one is the one you have used - adding a pseudo-time stepping, with time representing the frequency.
The other way is to use the parametric hook function, as done in input/poisson_parametric_study.py example. Basically, you need to define a function, that after each computation modifies some parameters of the problem. As that function gets a ProblemDefinition instance, it can change really anything (even return completely other problem). In the example mentioned, there is a function called vary_omega1_size() that changes a size of a subdomain. The example is commented, so it should get you started.
The latter way is completely general, but is probably an overkill for you. Anyway, I am back, so ask at will. :-)
Ok, the parametric hook sounds interesting. I'll look into it and post back with any questions.
By the way, is it possible to reuse sfepy results as the input to a second sfepy run? I would like to run a static linear elastic analysis and then use that as a prestress condition for the frequency sweep (i.e., modified stiffness). If this isn't possible yet, I would be happy to try to develop this.
>
best regards, r.
Thanks, and best regards! Logan
Hi Logan,
Logan Sorenson wrote:
No problem! Glad you had a chance to escape to nature. Hope you caught some good scenery up there. :)
Yep, it was really cool :) [1]
[1] http://en.wikipedia.org/wiki/Aigüestortes_i_Estany_de_Sant_Maurici_National_...
There are a couple of ways how make this parametric study with varying the frequency. The first one is the one you have used - adding a pseudo-time stepping, with time representing the frequency.
The other way is to use the parametric hook function, as done in input/poisson_parametric_study.py example. Basically, you need to define a function, that after each computation modifies some parameters of the problem. As that function gets a ProblemDefinition instance, it can change really anything (even return completely other problem). In the example mentioned, there is a function called vary_omega1_size() that changes a size of a subdomain. The example is commented, so it should get you started.
The latter way is completely general, but is probably an overkill for you. Anyway, I am back, so ask at will. :-)
Ok, the parametric hook sounds interesting. I'll look into it and post back with any questions.
By the way, is it possible to reuse sfepy results as the input to a second sfepy run? I would like to run a static linear elastic analysis and then use that as a prestress condition for the frequency sweep (i.e., modified stiffness). If this isn't possible yet, I would be happy to try to develop this.
You are lucky, I have just implemented this today, see the git repository.
Two things are needed (replace <> with what you need):
a function that reads the results:
def get_data(ts, coor, region):
filename_results = <something.vtk>
io = MeshIO.any_from_filename(filename_results)
all_data = io.read_data(0)
return all_data[<variable_name>].data
declare a parameter variable with a setter function ('T' in this case):
variables = {
'u' : ('unknown field', '3_displacement', 0),
'v' : ('test field', '3_displacement', 'u'),
'T' : ('parameter field', 'temperature',
{'setter' : 'get_data'}),
}
example equations (thermoelasticity, 'T' is known from a previous computation):
equations = {
'balance_of_forces' :
"""dw_lin_elastic_iso.ivol.Omega( solid.lame, v, u )
+ dw_biot.ivol.Omega( solid.alpha, v, T ) = 0""",
}
You can try to debug it :-)
cheers, r.
On Tue, Aug 11, 2009 at 11:29 AM, Robert Cimrmancimr...@ntc.zcu.cz wrote: >
Hi Logan,
Logan Sorenson wrote:
No problem! Glad you had a chance to escape to nature. Hope you caught some good scenery up there. :)
Yep, it was really cool :) [1]
[1] http://en.wikipedia.org/wiki/Aigüestortes_i_Estany_de_Sant_Maurici_National_...
There are a couple of ways how make this parametric study with varying the frequency. The first one is the one you have used - adding a pseudo-time stepping, with time representing the frequency.
The other way is to use the parametric hook function, as done in input/poisson_parametric_study.py example. Basically, you need to define a function, that after each computation modifies some parameters of the problem. As that function gets a ProblemDefinition instance, it can change really anything (even return completely other problem). In the example mentioned, there is a function called vary_omega1_size() that changes a size of a subdomain. The example is commented, so it should get you started.
The latter way is completely general, but is probably an overkill for you. Anyway, I am back, so ask at will. :-)
Ok, the parametric hook sounds interesting. I'll look into it and post back with any questions.
By the way, is it possible to reuse sfepy results as the input to a second sfepy run? I would like to run a static linear elastic analysis and then use that as a prestress condition for the frequency sweep (i.e., modified stiffness). If this isn't possible yet, I would be happy to try to develop this.
You are lucky, I have just implemented this today, see the git repository.
Two things are needed (replace <> with what you need):
def get_data(ts, coor, region): filename_results = <something.vtk>
io = MeshIO.any_from_filename(filename_results) all_data = io.read_data(0)
return all_data[<variable_name>].data
variables = { 'u' : ('unknown field', '3_displacement', 0), 'v' : ('test field', '3_displacement', 'u'), 'T' : ('parameter field', 'temperature', {'setter' : 'get_data'}), }
equations = { 'balance_of_forces' : """dw_lin_elastic_iso.ivol.Omega( solid.lame, v, u ) + dw_biot.ivol.Omega( solid.alpha, v, T ) = 0""", }
You can try to debug it :-)
Wow, sure, will do!
cheers, r.
>
Logan