public AnaliticalResultRectangleWithOneSideFixed(Model model) { _model = model; double alfa1 = model.Material.GetAlfa1(); _rectangle = _model.Shape as Rectangle; double h = 0; double l = 0; if (_rectangle != null) { h = _rectangle.Height; l = _rectangle.Width; } double E = model.Material.E[0]; double v = model.Material.v[0, 0]; D = E * h * h * h * (1 + alfa1) / (12 * (1 - v * v)); Lambda = 14 * E * h / (30 * (1 + v)); p = -model.BoundaryConditions[_rectangle.Edges[1]].Value[2]; l2 = l * l; l3 = l * l * l; l4 = l * l * l * l; l5 = l * l * l * l * l; l6 = l * l * l * l * l * l; l7 = l * l * l * l * l * l * l; wK1 = p / (2 * Lambda); wK2 = p / (6 * D); }
// //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //{ //} // //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //{ //} // //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ //} // //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ //} // #endregion internal virtual Mesh CreateMesh() { // TODO: Instantiate an appropriate concrete class. Rectangle body = new Rectangle(1, 2, 4, 6); Mesh mesh = new RectangularMesh(body, 3, 3); return mesh; }
public void Copy(Rectangle rectangle) { if (rectangle != null) { Height = rectangle.Height; Width = rectangle.Width; base.Copy(rectangle); } }
public void SaveTest() { Shape shape = new Rectangle(10, 20); // TODO: Initialize to an appropriate value SolidMechanicsModel target = new SolidMechanicsModel(shape); // TODO: Initialize to an appropriate value string filename = "temp.dat"; // TODO: Initialize to an appropriate value target.Save(filename); //Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public RectangularMesh(Rectangle rectangle, int countHeightElements, int countWidthElements) : base(rectangle) { _rectangle = rectangle; _countHeightElements = countHeightElements; _countWidthElements = countWidthElements; MiddleNodes = new List<FiniteElementNode>(); }
public void SolveTest() { double error = 0.001; Rectangle rectangle = new Rectangle(0.1, 1); Model model = new Model(Material.Aluminium(), rectangle); // TODO: Initialize to an appropriate value model.PointConditions[rectangle.Points[2]].Type = BoundaryConditionsType.Static; model.PointConditions[rectangle.Points[3]].Type = BoundaryConditionsType.Static; Mesh mesh = new RectangularMesh(rectangle, 10, 4); // TODO: Initialize to an appropriate value FreeVibrationsLinearSolver solver = new FreeVibrationsLinearSolver(model, mesh, error); // TODO: Initialize to an appropriate value IResult expected = null; // TODO: Initialize to an appropriate value IResult actual = null; actual = solver.Solve(1).FirstOrDefault(); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public AnaliticalResultRectangleWithTwoFixedSides(Model model, double sigma) { alfa1 = model.Material.GetAlfa1(); _rectangle = _model.Shape as Rectangle; double h = 0; double l = 0; if (_rectangle != null) { h = _rectangle.Height; l = _rectangle.Width; } E = model.Material.E[0]; v = model.Material.v[0, 0]; D = E*h*h*h*(1 + alfa1)/(12*(1 - v*v)); Lambda = 14*E*h/(30*(1 + v)); B = E*h*(1 + alfa1)/(1 - v*v); N0 = sigma*h; lambda_2 = N0/D; k_2 = Lambda/(Lambda + N0); lambda1_2 = lambda_2*k_2; lambda1 = Math.Sqrt(lambda1_2); ch = Math.Cosh(lambda1*l/2); sh = Math.Sinh(lambda1*l/2); _b = l*(1/(Lambda + N0) - 1/(D*lambda_2))/(2*lambda1*sh); p = (-1)*CountLoad(); }
public void SolveSimpleTest() { double error = 0.001; Rectangle rectangle = new Rectangle(1, 1); Model model = new Model(Material.Aluminium(), rectangle); model.PointConditions[rectangle.Points[2]].Type = BoundaryConditionsType.Static; model.PointConditions[rectangle.Points[3]].Type = BoundaryConditionsType.Static; //model.BoundaryConditions[rectangle.Edges[0]].Type = BoundaryConditionsType.Static; //model.BoundaryConditions[rectangle.Edges[2]].Type = BoundaryConditionsType.Static; Mesh mesh = new RectangularMesh(rectangle, 2, 2); FreeVibrationsLinearSolver solver = new FreeVibrationsLinearSolver(model, mesh, error); IResult expected = null; // TODO: Initialize to an appropriate value IResult actual = solver.Solve(1).FirstOrDefault(); IEnumerable<Point> points = mesh.GetPointsForResult(); ResultHelper.IsResultsEqual(points, expected, actual, 0, error); Assert.AreEqual(true, false); }
public ShapeStepViewModel(SolidMechanicsModel model):base("Shape", model) { rectangle = solidMechanicsModel.Model.Shape as Rectangle; isValid = rectangle != null; }
private Shape ConvertFiniteElementToShape(FiniteElementRectangle fe) { Rectangle rectangle = new Rectangle(fe.Node1.Point.X, fe.Node1.Point.Y, fe.Node3.Point.Y - fe.Node1.Point.Y, fe.Node3.Point.X - fe.Node1.Point.X); return rectangle; }