IES ShapeBuilder User's Guide
Refine Mesh
Refine Mesh
Copy Code
//Try finer and finer meshes until the desired section property stops changing
var property = "J";
var errorTolerance = 0.01; //stop refinement when the change is less than 1%
var step = 1.0; //increase the mesh ratio by this much each iteration

var ratio = 0.0;
var value = -1.0; //initialize to something that certainly won't be correct
var change = 100.0;
while(change > errorTolerance)
{    
    ratio += step;
    SetMesh(ratio);
    await AdvancedAnalysis();
    var newValue = GetSectionProperty(property);
    change = Math.Abs((newValue - value)/value);
    value = newValue;
}

//Print out the final results
$"{property} converged to {value:e3}. Change = {change:p2}"