The code checks that certain keywords are not missing. Try using ebcs = {} in the input file.
r.
----- Reply message ----- From: "steve" <st...@spvi.com> To: <sfepy...@googlegroups.com> Subject: Cylindrical coordinates Date: Wed, Jun 6, 2012 23:33 Velocity potential is pretty well defined here: <http://en.wikipedia.org/wiki/Potential_flow#Description_and_characteristics> When I try to run with no boundary conditions I'm getting the error below. Does it lead to a singular matrix or something with no essential boundary conditions? thanks!-steve Traceback (most recent call last): File "acoustics.py", line 113, in <module> main() File "acoustics.py", line 104, in main conf = ProblemConf.from_file_and_options(filename_in, options, required, other) File "/Users/steve/Development/sfepy/sfepy/base/conf.py", line 311, in from_file_and_options override=override) File "/Users/steve/Development/sfepy/sfepy/base/conf.py", line 290, in from_file required, other, verbose, override) File "/Users/steve/Development/sfepy/sfepy/base/conf.py", line 359, in __init__ required=required, other=other) File "/Users/steve/Development/sfepy/sfepy/base/conf.py", line 369, in setup other_missing = self.validate( required = required, other = other ) File "/Users/steve/Development/sfepy/sfepy/base/conf.py", line 421, in validate raise ValueError('required missing: %s' % required_missing)ValueError: required missing: ['ebc_[0-9]+|ebcs']
On Wednesday, June 6, 2012 3:10:58 PM UTC-6, Robert Cimrman wrote:On 06/06/2012 09:40 PM, steve wrote:
OK.. on to the eigenvalue problem.
I started with the quantum program... and stripped out all the quantum
stuff. ;-)
Basically the acoustics problem is exactly the square well potential (V=0
everywhere) BUT with different boundary conditions.
In quantum_common.py we've got:
ebc_1 = {
'name' : 'ZeroSurface',
'region' : 'Surface',
'dofs' : {'Psi.0' : 0.0},
}
Which forces psi to be zero on the surface of Omega. Basically Dirichlet
conditions. For acoustics the velocity potential needs to have no normal
gradient at the surfaces.. more or less Neumann conditions. Is there an
easy way to implement that?
What is the exact definition of the velocity potential? If it's really a
Neumann-like boundary integral, having it zero = omitting the term in
equations + no Dirichlet boundary conditions (ebcs) at all.
r.
-- You received this message because you are subscribed to the Google Groups "sfepy-devel" group. To view this discussion on the web visit https://groups.google.com/d/msg/sfepy-devel/-/e9Qjtk3ai88J. To post to this group, send email to sfepy...@googlegroups.com. To unsubscribe from this group, send email to sfepy-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
OK.. so I got it sort of blinking it's eyes a bit with a simple square enclosure in cartesian coordinates.
The trick was:
ebc_1 = {'name':'dummy', 'region':'Surface', 'dofs':{}}
Without name, region and dofs, it failed. But dofs could be an empty dictionary ;-)
I've attached the first 12 modes it found which had frequencies of:
acoustics: [ 5.16299658e-15 9.87028804e-04 9.87030371e-04
1.97418121e-03
3.94889296e-03 3.94891183e-03 4.93646164e-03 4.93648482e-03
7.89997828e-03 8.88811411e-03 8.88821885e-03 9.87626416e-03]
Compared with the theoretical values of
n m f 0 0 0.0 0 1 0.000986960440109 0 2 0.00394784176044 0 3 0.00888264396098 1 0 0.000986960440109 1 1 0.00197392088022 1 2 0.00493480220054 1 3 0.00986960440109 2 0 0.00394784176044 2 1 0.00493480220054 2 2 0.00789568352087 2 3 0.0128304857214 3 0 0.00888264396098 3 1 0.00986960440109 3 2 0.0128304857214 3 3 0.017765287922
I think they looks pretty good!
There is one mystery... what is that mode with 0.009876, it doesn't *look* like a 3-1 mode... but who knows!
Anyway.. thanks for the tips... now I'll try to work out the cylindrical case.
-steve
On Wednesday, June 6, 2012 4:17:47 PM UTC-6, Robert Cimrman wrote:
The code checks that certain keywords are not missing. Try using ebcs = {} in the input file.
r.
On 06/07/2012 07:09 AM, steve wrote:
OK.. so I got it sort of blinking it's eyes a bit with a simple square enclosure in cartesian coordinates.
The trick was:
ebc_1 = {'name':'dummy', 'region':'Surface', 'dofs':{}}
or, literally, just:
ebcs = {}
- the short syntax form... :)
Without name, region and dofs, it failed. But dofs could be an empty dictionary ;-)
I've attached the first 12 modes it found which had frequencies of:
acoustics: [ 5.16299658e-15 9.87028804e-04 9.87030371e-04 1.97418121e-03 3.94889296e-03 3.94891183e-03 4.93646164e-03 4.93648482e-03 7.89997828e-03 8.88811411e-03 8.88821885e-03 9.87626416e-03]
Compared with the theoretical values of
n m f 0 0 0.0 0 1 0.000986960440109 0 2 0.00394784176044 0 3 0.00888264396098 1 0 0.000986960440109 1 1 0.00197392088022 1 2 0.00493480220054 1 3 0.00986960440109 2 0 0.00394784176044 2 1 0.00493480220054 2 2 0.00789568352087 2 3 0.0128304857214 3 0 0.00888264396098 3 1 0.00986960440109 3 2 0.0128304857214 3 3 0.017765287922
I think they looks pretty good!
There is one mystery... what is that mode with 0.009876, it doesn't *look* like a 3-1 mode... but who knows!
There might be some spurios effects due to mesh. What happens if you refine?
Cheers, r.
Anyway.. thanks for the tips... now I'll try to work out the cylindrical case.
-steve
On Wednesday, June 6, 2012 4:17:47 PM UTC-6, Robert Cimrman wrote:
The code checks that certain keywords are not missing. Try using ebcs = {} in the input file.
r.
Hi Robert,
On Thursday, June 7, 2012 4:39:02 AM UTC-6, Robert Cimrman wrote:
On 06/07/2012 07:09 AM, steve wrote:
The trick was:
ebc_1 = {'name':'dummy', 'region':'Surface', 'dofs':{}}
or, literally, just:
ebcs = {}
Dang.. you're right. I thought *sure* I tried that and failed.
- the short syntax form... :)
There might be some spurios effects due to mesh. What happens if you refine?
Demonstrates my ignorance... not sure what that means.... I'll look it up.
-steve
OK! Good luck with this... see output for a few modes. Thanks for all the help!
Now.. I have Yet Another Problem... gah. Back to the electrostatic problem with Dirichlet BCs.
This is what I'd love:
Build a .geo file with various points, lines and surfaces.
In the geo file specify that certain lines are tagged with a specific ID.
In the problem description set up boundary conditions by specifying the value of the potential on all the nodes that are located on those lines.
Is there any way to do that? Everything I've tried so far as failed. I'm trying something like:
... // many lines skipped...
Line(17) = {9, 8}; Line(18) = {10, 11}; Line(19) = {11, 12}; Line(20) = {12, 9}; Line(21) = {12, 8}; Line(22) = {12, 13};
Line Loop(1) = {1, 2, 3, 4}; Line Loop(2) = {5,6,7,-3}; Line Loop(3) = {14,-6,-9}; Line Loop(5) = {11,12,13,-8}; Line Loop(6) = {-13, -21, 22, -14}; Line Loop(8) = {-17, -20, 21}; Line Loop(9) = {18, 19, 20, -16};
Plane Surface(1) = {1}; Plane Surface(2) = {2}; Plane Surface(3) = {3}; Plane Surface(5) = {5}; Plane Surface(6) = {6}; Plane Surface(8) = {8}; Plane Surface(9) = {9};
Physical Surface(7) = {1,2,3,5,6,8,9};
Physical Line(1) = {7,4}; Physical Line(2) = {5,9,8}; Physical Line(3) = {12,17,16}; Physical Line(4) = {19}; Physical Line(5) = {1};
I'm thinking that by making "Physical Lines" I can refer to them in the problem description by id. Is that right?
Anyway.. when I include these in the .geo file I get:
dfr-slusher:sfepy steve$ python simple.py es-test.py sfepy: left over: ['verbose', '__builtins__', 'get_r_dependence', '__doc__', '__name__', 'Newregions', 'data_dir', 'nm', '__package__', '_filename', '__file__'] sfepy: reading mesh (/Users/steve/Development/sfepy/tmp/es-lens.vtk)... sfepy: ...done in 0.04 s Traceback (most recent call last): File "simple.py", line 129, in <module> main() File "simple.py", line 122, in main app = PDESolverApp(conf, options, output_prefix) File "/Users/steve/Development/sfepy/sfepy/applications/pde_solver_app.py", line 304, in __init__ **kwargs) File "/Users/steve/Development/sfepy/sfepy/fem/problemDef.py", line 82, in from_conf domain = Domain(mesh.name, mesh) File "/Users/steve/Development/sfepy/sfepy/fem/domain.py", line 194, in __init__ gel = GeometryElement(desc) File "/Users/steve/Development/sfepy/sfepy/fem/geometry_element.py", line 132, in __init__ gd = geometry_data[name] KeyError: '2_2'
I tried a post-mortem debug.. and indeed 'desc' is '2_2', but there is no matching key in geometry_data. ;-(
If this is documented, I missed it somehow. Any hints?
thanks! -steve
On Thursday, June 7, 2012 8:01:52 AM UTC-6, steve wrote:
Hi Robert,
On Thursday, June 7, 2012 4:39:02 AM UTC-6, Robert Cimrman wrote:
On 06/07/2012 07:09 AM, steve wrote:
The trick was:
ebc_1 = {'name':'dummy', 'region':'Surface', 'dofs':{}}
or, literally, just:
ebcs = {}
Dang.. you're right. I thought *sure* I tried that and failed.
- the short syntax form... :)
There might be some spurios effects due to mesh. What happens if you refine?
Demonstrates my ignorance... not sure what that means.... I'll look it up.
-steve
I've simplified this to a case the works a little better (no crash) but still not there.
I've started with the gmsh tutorial file 1: t1.geo and modified it a bit
lc = 0.009;
Point(1) = {0, 0, 0, lc}; Point(2) = {.1, 0, 0, lc} ; Point(3) = {.1, .3, 0, lc} ; Point(4) = {0, .3, 0, lc} ;
Line(1) = {1,2} ; Line(2) = {3,2} ; Line(3) = {3,4} ; Line(4) = {4,1} ;
Line Loop(5) = {4,1,-2,3} ;
Plane Surface(6) = {5} ;
Physical Point(1) = {1,2} ; Physical Point(2) = {3,4} ;
Physical Surface(7) = {6};
I'd like to set the voltage along line 1 to 0V, and along line 3 to 150V say. I tried 'Physical Line', but that added '2_2' elements to the vtk file that sfepy didn't like. So.. I tried 'Physical Point' and that seemed to allow my code to run, but its still not setting up the region correctly. I used:
regions = { 'Omega' : ('all', {}), 'Omega_Source' : ('nodes of group 1', {}), 'Omega_Target' : ('nodes of group 2', {}), }
which ran "OK", but didn't set the voltages with:
ebcs = { 'u1' : ('Omega_Source', {'u.0' : 0.0}), 'u2' : ('Omega_Target', {'u.0' : 150.0}), }
I'll keep looking. Thanks for any insight.
-steve
participants (2)
-
Robert Cimrman
-
steve