I am trying to generalize the block command for bilinear quads to be able to make a mesh of varying geometry. Unfortunately when I pass in variables as arguments to the block command I get the following error:
WARNING block2D numX? numY? startNode? startEle? eleType? eleArgs?: invalid node coordinate for node: 1
expected floating-point number but got "$blockwidth"
I am not sure what is wrong here? I am able to pass in variables for other OpenSees commands like fix so why not the block2D command? The problematic portion of my code is shown below.
#geometric parameters
set nx 4
set ny 2
set elwidth 1.0
set elheight 1.0
set blockwidth [expr $nx*$elwidth]
set blockheight [expr $ny*$elheight]
puts $blockwidth
puts $blockheight
#nDMaterial ElasticIsotropic $matTag $E $v <$rho>
nDMaterial ElasticIsotropic 1 1000 0.0
#block2d $nx $ny $e1 $n1 element elementArgs
block2D $nx $ny 1 1 quad "1 PlaneStrain2D 1" {
1 0 0
2 $blockwidth 0
3 $blockwidth $blockheight
4 0 $blockheight
}
Setting variables to opensees block command
Moderators: silvia, selimgunay, Moderators
-
- Posts: 916
- Joined: Mon Sep 09, 2013 8:50 pm
- Location: University of California, Berkeley
Re: Setting variables to opensees block command
It looks like there is something wrong with the number of dofs. Did you set the ndf to 2 in the modelbuilder command?
-
- Posts: 916
- Joined: Mon Sep 09, 2013 8:50 pm
- Location: University of California, Berkeley
Re: Setting variables to opensees block command
Sorry I meant setting the ndm to 2.