IES VisualAnalysis User's Guide
Example: Refine Mesh

Requires: Advanced Level

Refine Mesh
Copy Code
//Use a loop to refine the mesh of a shear wall

SetUnits("Kips & Inches");
DeleteAll();

//Build the model
var h = 144.0;
var w = 60.0;
var v1 = AddVertex(0, 0);
var v2 = AddVertex(w, 0);
var v3 = AddVertex(w, h);
var v4 = AddVertex(0, h);
var area = AddArea(v1, v2, v3, v4);
var mat = "Concrete (F'c = 4 ksi)";

//Apply a lateral load to the top of the wall
var top = FindSide(w/2, h, 0);
SideForce("D", top, 50.0, 0, 0);

//Fix the bottom of the wall
var bottom = FindSide(w/2, 0, 0);
SupportSide(bottom, true, true, true, true, true, true);

//Try finer and finer meshes until the displacement stops changing
var delta = 100.0;
var elementArea = w*h*0.05;
var disp = 100.0;
int i = 0;
while(delta > 1.0e-4)
{    i++;
    elementArea *= 0.7;
    Mesh("A001", 6, mat, elementArea);
    await Analysis();
    var newDisp = MaxDisplacement("DX");
    delta = Math.Abs(disp - newDisp);
    disp = newDisp;
}

//Print out the final results
$"DZ Converged. Delta = {delta}; Disp = {disp}; Trials = {i}"