Commit 975f47f5 authored by amandaghassaei's avatar amandaghassaei

isotropic shear behavior

parent 11068092
......@@ -11,19 +11,22 @@ Material Properties:<br/><br/>
<span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Conductive</label>
Density (kg/m^3): &nbsp;&nbsp;<input data-property="density" value="<%= properties.density %>" placeholder="Density" class="form-control floatInput materialProperties" type="text"><br/><br/>
Material Stiffness (XYZ):<br/><br/>
Material Stiffness (XYZ unless noted):<br/><br/>
Axial K: &nbsp;&nbsp;<input data-property="longitudalK" data-key="x" value="<%= properties.longitudalK.x %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="longitudalK" data-key="y" value="<%= properties.longitudalK.y %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="longitudalK" data-key="z" value="<%= properties.longitudalK.z %>" placeholder="X" class="form-control floatInput materialProperties" type="text"><br/><br/>
Shear K: &nbsp;&nbsp;<input data-property="shearK" data-key="x" value="<%= properties.shearK.x %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="shearK" data-key="y" value="<%= properties.shearK.y %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="shearK" data-key="z" value="<%= properties.shearK.z %>" placeholder="X" class="form-control floatInput materialProperties" type="text"><br/><br/>
<input data-property="longitudalK" data-key="y" value="<%= properties.longitudalK.y %>" placeholder="Y" class="form-control floatInput materialProperties" type="text">
<input data-property="longitudalK" data-key="z" value="<%= properties.longitudalK.z %>" placeholder="Z" class="form-control floatInput materialProperties" type="text"><br/><br/>
Shear K (XY XZ): &nbsp;&nbsp;<input data-property="shearK" data-key="xy" value="<%= properties.shearK.xy %>" placeholder="XY" class="form-control floatInput materialProperties" type="text">
<input data-property="shearK" data-key="xz" value="<%= properties.shearK.xz %>" placeholder="XZ" class="form-control floatInput materialProperties" type="text"><br/><br/>
Shear K (YX YZ): &nbsp;&nbsp;<input data-property="shearK" data-key="yx" value="<%= properties.shearK.yx %>" placeholder="YX" class="form-control floatInput materialProperties" type="text">
<input data-property="shearK" data-key="yz" value="<%= properties.shearK.yz %>" placeholder="YZ" class="form-control floatInput materialProperties" type="text"><br/><br/>
Shear K (ZX ZY): &nbsp;&nbsp;<input data-property="shearK" data-key="zx" value="<%= properties.shearK.zx %>" placeholder="ZX" class="form-control floatInput materialProperties" type="text">
<input data-property="shearK" data-key="zy" value="<%= properties.shearK.zy %>" placeholder="ZY" class="form-control floatInput materialProperties" type="text"><br/><br/>
Bending K: &nbsp;&nbsp;<input data-property="bendingK" data-key="x" value="<%= properties.bendingK.x %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="bendingK" data-key="y" value="<%= properties.bendingK.y %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="bendingK" data-key="z" value="<%= properties.bendingK.z %>" placeholder="X" class="form-control floatInput materialProperties" type="text"><br/><br/>
<input data-property="bendingK" data-key="y" value="<%= properties.bendingK.y %>" placeholder="Y" class="form-control floatInput materialProperties" type="text">
<input data-property="bendingK" data-key="z" value="<%= properties.bendingK.z %>" placeholder="Z" class="form-control floatInput materialProperties" type="text"><br/><br/>
Torsional K: &nbsp;&nbsp;<input data-property="torsionK" data-key="x" value="<%= properties.torsionK.x %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="torsionK" data-key="y" value="<%= properties.torsionK.y %>" placeholder="X" class="form-control floatInput materialProperties" type="text">
<input data-property="torsionK" data-key="z" value="<%= properties.torsionK.z %>" placeholder="X" class="form-control floatInput materialProperties" type="text"><br/><br/>
<input data-property="torsionK" data-key="y" value="<%= properties.torsionK.y %>" placeholder="Y" class="form-control floatInput materialProperties" type="text">
<input data-property="torsionK" data-key="z" value="<%= properties.torsionK.z %>" placeholder="Z" class="form-control floatInput materialProperties" type="text"><br/><br/>
</div>
<br/>
<a id="saveExitMenu" href="#" class="btn btn-block btn-lg btn-success">Save Material</a><br/>
......
......@@ -32,7 +32,7 @@ define([], function(){
conductive: false,
density: 3500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -47,7 +47,7 @@ define([], function(){
conductive: false,
density: 3500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:30},
torsionK:{x:500,y:500,z:500}
}
......@@ -62,7 +62,7 @@ define([], function(){
conductive: false,
density: 3500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:30,z:30},
torsionK:{x:500,y:500,z:500}
}
......@@ -77,7 +77,7 @@ define([], function(){
conductive: false,
density: 3500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:30}
}
......@@ -91,7 +91,7 @@ define([], function(){
conductive: false,
density: 3500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:30,y:500,z:500},
shearK:{xy:10,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -105,7 +105,7 @@ define([], function(){
conductive: false,
density: 8500,//kg/m^3
longitudalK:{x:10,y:10,z:10},
shearK:{x:10,y:10,z:10},
shearK:{xy:10,xz:10,yx:10,yz:10,zx:10,zy:10},
bendingK:{x:10,y:10,z:10},
torsionK:{x:10,y:10,z:10}
}
......@@ -119,7 +119,7 @@ define([], function(){
conductive: true,
density: 8500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -133,7 +133,7 @@ define([], function(){
conductive: true,
density: 8500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -148,7 +148,7 @@ define([], function(){
conductive: true,
density: 3500,//kg/m^3
longitudalK:{x:30,y:30,z:30},
shearK:{x:30,y:30,z:30},
shearK:{xy:30,xz:30,yx:30,yz:30,zx:30,zy:30},
bendingK:{x:30,y:30,z:30},
torsionK:{x:30,y:30,z:30}
}
......@@ -163,7 +163,7 @@ define([], function(){
conductive: true,
density: 3500,//kg/m^3
longitudalK:{x:30,y:30,z:30},
shearK:{x:30,y:30,z:30},
shearK:{xy:30,xz:30,yx:30,yz:30,zx:30,zy:30},
bendingK:{x:30,y:30,z:30},
torsionK:{x:30,y:30,z:30}
}
......@@ -177,7 +177,7 @@ define([], function(){
conductive: false,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -191,7 +191,7 @@ define([], function(){
conductive: false,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -205,7 +205,7 @@ define([], function(){
conductive: false,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -218,7 +218,7 @@ define([], function(){
conductive: false,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -232,7 +232,7 @@ define([], function(){
conductive: true,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......@@ -246,7 +246,7 @@ define([], function(){
conductive: true,
density: 6500,//kg/m^3
longitudalK:{x:500,y:500,z:500},
shearK:{x:500,y:500,z:500},
shearK:{xy:500,xz:500,yx:500,yz:500,zx:500,zy:500},
bendingK:{x:500,y:500,z:500},
torsionK:{x:500,y:500,z:500}
}
......
......@@ -63,8 +63,8 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
this.neighborsXMapping = new Float32Array(textureSize*8);//-1 equals no neighb
this.neighborsYMapping = new Float32Array(textureSize*8);//would have done int16, but no int types have > 8 bits
this.compositeKs = new Float32Array(textureSize*8*12);
this.compositeDs = new Float32Array(textureSize*8*12);
this.compositeKs = new Float32Array(textureSize*8*15);
this.compositeDs = new Float32Array(textureSize*8*15);
//todo int array
this.wires = new Float32Array(textureSize*4);//also stores actuator mask as -1
......@@ -133,14 +133,24 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
self.neighborsYMapping[compositeIndex + neighborIndex%3] = parseInt(neighborMappingIndex1D/textureDim);
//todo apply rotation here
_.each(["longitudal", "shear", "bending", "torsion"], function(dof, dofIndex){
_.each(["longitudal", "bending", "torsion"], function(dof, dofIndex){
var cellK = self._getCellK(cell, dof);
var neighborK = self._getCellK(neighbor, dof);
_.each(["x", "y", "z"], function(axis, axisIndex){
var compositeK = self._calcCompositeParam(self._getCellK(cell, dof)[axis], self._getCellK(neighbor, dof)[axis]);
var compositeK = self._calcCompositeParam(cellK[axis], neighborK[axis]);
var offset = (dofIndex*3+axisIndex)*textureSize*8;
self.compositeKs[compositeIndex + neighborIndex%3 + offset] = compositeK;
self.compositeDs[compositeIndex + neighborIndex%3 + offset] = compositeK/1000;//this is arbitrary for now
});
});
var cellK = self._getCellK(cell,"shear");//shear last bc it has six elements instead of 3
var neighborK = self._getCellK(neighbor, "shear");
_.each(["xy", "xz", "yx", "yz", "zx", "zy"], function(axis, axisIndex){
var compositeK = self._calcCompositeParam(cellK[axis], neighborK[axis]);
var offset = (3*3+axisIndex)*textureSize*8;
self.compositeKs[compositeIndex + neighborIndex%3 + offset] = compositeK;
self.compositeDs[compositeIndex + neighborIndex%3 + offset] = compositeK/1000;//this is arbitrary for now
});
......@@ -618,13 +628,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
var d = 10/1000;
//todo don't need all these at once
var longitudalK = [this.compositeKs[neighborsIndex + j%3], this.compositeKs[neighborsIndex + j%3 + textureSize*8], this.compositeKs[neighborsIndex + j%3 + 2*textureSize*8]];
var shearK = [this.compositeKs[neighborsIndex + j%3 + 3*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 4*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 5*textureSize*8]];
var bendingK = [this.compositeKs[neighborsIndex + j%3 + 6*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 7*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 8*textureSize*8]];
var torsionK = [this.compositeKs[neighborsIndex + j%3 + 9*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 10*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 11*textureSize*8]];
var bendingK = [this.compositeKs[neighborsIndex + j%3 + 3*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 4*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 5*textureSize*8]];
var torsionK = [this.compositeKs[neighborsIndex + j%3 + 6*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 7*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 8*textureSize*8]];
var shearK = [this.compositeKs[neighborsIndex + j%3 + 9*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 10*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 11*textureSize*8],
this.compositeKs[neighborsIndex + j%3 + 12*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 13*textureSize*8], this.compositeKs[neighborsIndex + j%3 + 14*textureSize*8]];
var longitudalD = [this.compositeDs[neighborsIndex + j%3], this.compositeDs[neighborsIndex + j%3 + textureSize*8], this.compositeDs[neighborsIndex + j%3 + 2*textureSize*8]];
var shearD = [this.compositeDs[neighborsIndex + j%3 + 3*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 4*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 5*textureSize*8]];
var bendingD = [this.compositeDs[neighborsIndex + j%3 + 6*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 7*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 8*textureSize*8]];
var torsionD = [this.compositeDs[neighborsIndex + j%3 + 9*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 10*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 11*textureSize*8]];
var bendingD = [this.compositeDs[neighborsIndex + j%3 + 3*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 4*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 5*textureSize*8]];
var torsionD = [this.compositeDs[neighborsIndex + j%3 + 6*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 7*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 8*textureSize*8]];
var shearD = [this.compositeDs[neighborsIndex + j%3 + 9*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 10*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 11*textureSize*8],
this.compositeDs[neighborsIndex + j%3 + 12*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 13*textureSize*8], this.compositeDs[neighborsIndex + j%3 + 14*textureSize*8]];
var D = [neighborTranslation[0]-translation[0] + nominalD[0],
neighborTranslation[1]-translation[1] + nominalD[1],
......@@ -637,6 +649,10 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
if (axis == neighborAxis){
_k = longitudalK[axis];
_d = longitudalD[axis];
} else {
var shearIndex = this._shearIndex(neighborAxis, axis);
_k = shearK[shearIndex];
_d = shearD[shearIndex];
}
force[axis] += _k*(D[axis] - rotatedNominalD[axis]) + _d*(neighborVelocity[axis]-velocity[axis]);
}
......@@ -748,6 +764,12 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
this._swapArrays("rotation", "lastRotation");
},
_shearIndex: function(neighborAxis, axis){
var index = neighborAxis*3+axis-1;
if (index<3) return index;
return index-1;
},
_torqueAxis: function(neighbAxis, axis){
if (0 != neighbAxis && 0 != axis) return 0;
if (1 != neighbAxis && 1 != axis) return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment