IES VisualFoundation User's Guide
Example: Refine Mesh
Refine Mesh
Copy Code
//Use a loop to refine the mesh of a spread footing

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

//Build the model
AddRectangleSlab(0, 0, 48, 48);
var pier = AddPier(0, 0);
var columnSize = 12.0;
SquarePierSize(pier, columnSize);

//Load the pier
LoadPier("D", pier, 0.0, 0.0, -20.0, 0.0, 0.0);

//set a coarse mesh for most of the footing 
SetMeshCustom(100);

//Try finer and finer around the pier until 
//the moment at the face of the pier stops changing

var elementSize = 5.0; //start with a 5 inch element around the pier
var delta = 100.0;  //initialize to a big value
var moment = 100.0; //initialize to a big value
int i = 0; //keep track of the number of iterations needed to find the converged value
while(delta > 0.05)
{    
    i++;
    elementSize *= 0.7;
    RefinePier(pier, columnSize + 3.0, elementSize, elementSize * 5.0);
    await Analysis();
    var newMoment = MomentX("1. 1.4D", columnSize / 2.0, 0.0);
    delta = Math.Abs(moment - newMoment);
    moment = newMoment;
}

//Print out the final results
$"Mux = {moment}; Final Delta = {delta}; Trials = {i}"