private void SolveSelectedExample() { Results finalResults; Tuple <Dictionary <int, double[]>, Dictionary <int, double> > results; //string selectedExample = ComboBox1.SelectedItem.ToString(); switch (selectedExample) { case "TwoQuadsExample": finalResults = TwoQuadsExample.RunStaticExample(); break; case "LinearTrussExample": finalResults = LinearTrussExample.RunExample(); break; case "TwoBeamsInFrContactQuadsExample": finalResults = TwoBeamsInFrContactQuadsExample.RunDynamicExample(); break; case "ThermalExample": finalResults = ThermalExample.RunStaticExample(); break; case "TwoThermalQuadsInContactExample": finalResults = TwoThermalQuadsInContactExample.RunStaticExample(); break; case "TwoThermalQuadsExample": finalResults = TwoThermalQuadsExample.RunStaticExample(); break; case "TwoQuadsInContactNewExample": finalResults = TwoQuadsInContactNewExample.RunStaticExample(); break; case "CoupledPhysicsExample": finalResults = CoupledPhysicsExample.RunStaticExample(); break; case "CoupledThermalStructural": CoupledThermalStructural.structuralSolution = new StaticSolver(); CoupledThermalStructural.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructural.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructural.diagramData = new ShowToGUI(); CoupledThermalStructural.diagramData.ShowDiagramInGUI += c_ShowDiagramInGUI; finalResults = CoupledThermalStructural.RunStaticExample(); break; case "CoupledThermalStructural2": CoupledThermalStructural2.structuralSolution = new StaticSolver(); CoupledThermalStructural2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); //CoupledThermalStructural2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructural2.diagramData = new ShowToGUI(); CoupledThermalStructural2.diagramData.ShowDiagramInGUI += c_ShowDiagramInGUI; finalResults = CoupledThermalStructural2.RunStaticExample(); break; case "CoupledThermalStructuralCNTs": CoupledThermalStructuralCNTs.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs.RunStaticExample(); break; case "CoupledThermalStructuralCNTs1b": CoupledThermalStructuralCNTs1b.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs1b.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs1b.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs1b.RunStaticExample(); break; case "CoupledThermalStructuralCNTs2": CoupledThermalStructuralCNTs2.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs2.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle": CoupledThermalStructuralCNTsInAngle.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle2": CoupledThermalStructuralCNTsInAngle2.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructuralCNTsInAngle2.thermalSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle2.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle2.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle2.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle3": CoupledThermalStructuralCNTsInAngle3.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle3.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle3.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; //finalResults = CoupledThermalStructuralCNTsInAngle3.RunStaticExample(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution = new StaticSolver(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle3.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle4": CoupledThermalStructuralCNTsInAngle4.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle4.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle4.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle4.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle5": CoupledThermalStructuralCNTsInAngle5.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle5.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle5.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructuralCNTsInAngle5.thermalSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle5.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle5.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle5.RunStaticExample(); break; case "CNTExample": CNTExample.structuralSolution = new StaticSolver(); CNTExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTExample.RunStaticExample(); break; case "CNTsInParallelFinalExample": CNTsInParallelFinalExample.structuralSolution = new StaticSolver(); CNTsInParallelFinalExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTsInParallelFinalExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTsInParallelFinalExample.RunStaticExample(); break; case "CNTsInAngleFinalExample": CNTsInAngleFinalExample.structuralSolution = new StaticSolver(); CNTsInAngleFinalExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTsInAngleFinalExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CNTsInAngleFinalExample.thermalSolution = new StaticSolver(); CNTsInAngleFinalExample.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTsInAngleFinalExample.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTsInAngleFinalExample.RunStaticExample(); break; case "TwoBlocksInContact3D": TwoBlocksInContact3D.newSolu = new StaticSolver(); TwoBlocksInContact3D.newSolu.NonLinearScheme = new LoadControlledNewtonRaphson(); TwoBlocksInContact3D.newSolu.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = TwoBlocksInContact3D.RunStaticExample(); break; case "Hxa8TestExample": Hxa8TestExample.newSolu = new StaticSolver(); Hxa8TestExample.newSolu.NonLinearScheme = new LoadControlledNewtonRaphson(); Hxa8TestExample.newSolu.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = Hxa8TestExample.RunStaticExample(); break; default: finalResults = TwoQuadsExample.RunStaticExample(); break; } //Results.Text = solution[0].ToString(); solverResults = finalResults; }
private void SolveSelectedExample() { Results finalResults; Tuple <Dictionary <int, double[]>, Dictionary <int, double> > results; //string selectedExample = ComboBox1.SelectedItem.ToString(); switch (selectedExample) { case "TwoQuadsExample": finalResults = TwoQuadsExample.RunStaticExample(); break; case "LinearTrussExample": finalResults = LinearTrussExample.RunExample(); break; case "TwoBeamsInFrContactQuadsExample": finalResults = TwoBeamsInFrContactQuadsExample.RunDynamicExample(); break; case "ThermalExample": finalResults = ThermalExample.RunStaticExample(); break; case "TwoThermalQuadsInContactExample": finalResults = TwoThermalQuadsInContactExample.RunStaticExample(); break; case "TwoThermalQuadsExample": finalResults = TwoThermalQuadsExample.RunStaticExample(); break; case "TwoQuadsInContactNewExample": finalResults = TwoQuadsInContactNewExample.RunStaticExample(); break; case "CoupledPhysicsExample": finalResults = CoupledPhysicsExample.RunStaticExample(); break; case "CoupledThermalStructural": CoupledThermalStructural.structuralSolution = new StaticSolver(); CoupledThermalStructural.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructural.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructural.diagramData = new ShowToGUI(); CoupledThermalStructural.diagramData.ShowDiagramInGUI += c_ShowDiagramInGUI; finalResults = CoupledThermalStructural.RunStaticExample(); break; case "CoupledThermalStructural2": CoupledThermalStructural2.structuralSolution = new StaticSolver(); CoupledThermalStructural2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); //CoupledThermalStructural2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructural2.diagramData = new ShowToGUI(); CoupledThermalStructural2.diagramData.ShowDiagramInGUI += c_ShowDiagramInGUI; finalResults = CoupledThermalStructural2.RunStaticExample(); break; case "CoupledThermalStructuralCNTs": CoupledThermalStructuralCNTs.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs.RunStaticExample(); break; case "CoupledThermalStructuralCNTs1b": CoupledThermalStructuralCNTs1b.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs1b.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs1b.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs1b.RunStaticExample(); break; case "CoupledThermalStructuralCNTs2": CoupledThermalStructuralCNTs2.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTs2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTs2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTs2.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle": CoupledThermalStructuralCNTsInAngle.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle2": CoupledThermalStructuralCNTsInAngle2.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle2.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle2.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructuralCNTsInAngle2.thermalSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle2.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle2.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle2.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle3": CoupledThermalStructuralCNTsInAngle3.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle3.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle3.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; //finalResults = CoupledThermalStructuralCNTsInAngle3.RunStaticExample(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution = new StaticSolver(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); //CoupledThermalStructuralCNTsInAngle3.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle3.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle4": CoupledThermalStructuralCNTsInAngle4.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle4.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle4.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle4.RunStaticExample(); break; case "CoupledThermalStructuralCNTsInAngle5": CoupledThermalStructuralCNTsInAngle5.structuralSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle5.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle5.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; CoupledThermalStructuralCNTsInAngle5.thermalSolution = new StaticSolver(); CoupledThermalStructuralCNTsInAngle5.thermalSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CoupledThermalStructuralCNTsInAngle5.thermalSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CoupledThermalStructuralCNTsInAngle5.RunStaticExample(); break; case "CNTExample": CNTExample.structuralSolution = new StaticSolver(); CNTExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTExample.RunStaticExample(); break; case "CNTsInParallelFinalExample": CNTsInParallelFinalExample.structuralSolution = new StaticSolver(); CNTsInParallelFinalExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTsInParallelFinalExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTsInParallelFinalExample.RunStaticExample(); break; case "CNTsInAngleFinalExample": CNTsInAngleFinalExample.structuralSolution = new StaticSolver(); CNTsInAngleFinalExample.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); CNTsInAngleFinalExample.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = CNTsInAngleFinalExample.RunStaticExample(); break; case "ElasticContrainsCNTsInAngleFinal": ElasticContrainsCNTsInAngleFinal.structuralSolution = new StaticSolver(); ElasticContrainsCNTsInAngleFinal.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); ElasticContrainsCNTsInAngleFinal.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = ElasticContrainsCNTsInAngleFinal.RunStaticExample(); break; case "NewExampleContacts": NewExampleContacts.structuralSolution = new StaticSolver(); NewExampleContacts.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); NewExampleContacts.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = NewExampleContacts.RunStaticExample(); break; case "DynamicExample": finalResults = DynamicExample.RunExample(); break; case "ImpactElasticAgainstRigid": finalResults = ImpactElasticAgainstRigid.RunExample(); break; case "NewDynamicExample": finalResults = NewDynamicExample.RunExample(); break; case "ImpactBetweenBars": finalResults = ImpactBetweenBars.RunExample(); break; case "ImpactElasticAgainstRigid2": finalResults = ImpactElasticAgainstRigid2.RunExample(); break; case "ImpactCircle": finalResults = ImpactCircle.RunExample(); break; case "CantileverWithTriangElements": finalResults = CantileverWithTriangElements.RunExample(); break; case "CantileverWithQuad8Elements": finalResults = CantileverWithQuad8Elements.RunExample(); break; case "ImpactCircle2": finalResults = ImpactCircle2.RunExample(); break; case "TwoBlocksInContact3D": TwoBlocksInContact3D.newSolu = new StaticSolver(); TwoBlocksInContact3D.newSolu.NonLinearScheme = new LoadControlledNewtonRaphson(); TwoBlocksInContact3D.newSolu.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = TwoBlocksInContact3D.RunStaticExample(); break; case "Hxa8TestExample": Hxa8TestExample.newSolu = new StaticSolver(); Hxa8TestExample.newSolu.NonLinearScheme = new LoadControlledNewtonRaphson(); Hxa8TestExample.newSolu.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = Hxa8TestExample.RunStaticExample(); break; case "ThreeTrusses": ThreeTrusses.structuralSolution = new StaticSolver(); ThreeTrusses.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); ThreeTrusses.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = ThreeTrusses.RunStaticExample(); break; case "TwoBlocks2DNtN": TwoBlocks2DNtN.structuralSolution = new StaticSolver(); TwoBlocks2DNtN.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); TwoBlocks2DNtN.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = TwoBlocks2DNtN.RunStaticExample(); break; case "TwoBlocks2DNtS": TwoBlocks2DNtS.structuralSolution = new StaticSolver(); TwoBlocks2DNtS.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); TwoBlocks2DNtS.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = TwoBlocks2DNtS.RunStaticExample(); break; case "BendingBeamContact2d": BendingBeamContact2d.structuralSolution = new StaticSolver(); BendingBeamContact2d.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); BendingBeamContact2d.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = BendingBeamContact2d.RunStaticExample(); break; case "BendingOveraRigidCylinder": BendingOveraRigidCylinder.structuralSolution = new StaticSolver(); BendingOveraRigidCylinder.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); BendingOveraRigidCylinder.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = BendingOveraRigidCylinder.RunStaticExample(); break; case "TwoBlocksHigherOrderNTS": TwoBlocksHigherOrderNTS.structuralSolution = new StaticSolver(); TwoBlocksHigherOrderNTS.structuralSolution.NonLinearScheme = new LoadControlledNewtonRaphson(); TwoBlocksHigherOrderNTS.structuralSolution.NonLinearScheme.convergenceResult += NonLinearScheme_convergenceResult; finalResults = TwoBlocksHigherOrderNTS.RunStaticExample(); break; default: finalResults = TwoQuadsExample.RunStaticExample(); break; } //Results.Text = solution[0].ToString(); solverResults = finalResults; }