/// <summary> /// To reproduce the reference solution, run the Abaqus job hexa8_cube.inp and look at /// HEXA8_CUBE_STIFFNESS_MATRICES.mtx /// </summary> //[Fact] private static void TestStiffnessMatrix1() { var factory = new ContinuumElement3DFactory(Material1, DynamicMaterial1); var hexa8 = factory.CreateElement(CellType.Hexa8, AbaqusToMSolveHexa8Nodes(NodeSet1)); var computedK = hexa8.BuildStiffnessMatrix(); //string output = @"C:\Users\Serafeim\Desktop\hexa8.txt"; //var writer = new LinearAlgebra.Output.FullMatrixWriter(); ////writer.ArrayFormat = LinearAlgebra.Output.Formatting.Array2DFormat.CSharpArray; //writer.WriteToFile(computedK, output); var expectedK = AbaqusToMSolveHexa8StructuralMatrix(Matrix.CreateFromArray(new double[24, 24] { { 81704.05983, -26362.17949, -26362.17949, 24866.45299, -560.8974359, -24118.58974, 9909.188034, 10657.05128, 10657.05128, 24866.45299, -24118.58974, -560.8974359, -27857.90598, 560.8974359, 560.8974359, -38327.99145, 26362.17949, -10657.05128, -36832.26496, 24118.58974, 24118.58974, -38327.99145, -10657.05128, 26362.17949 }, { -26362.17949, 81704.05983, 26362.17949, 560.8974359, -27857.90598, -560.8974359, -10657.05128, -38327.99145, -26362.17949, -24118.58974, 24866.45299, 560.8974359, -560.8974359, 24866.45299, 24118.58974, 26362.17949, -38327.99145, 10657.05128, 24118.58974, -36832.26496, -24118.58974, 10657.05128, 9909.188034, -10657.05128 }, { -26362.17949, 26362.17949, 81704.05983, -24118.58974, 560.8974359, 24866.45299, -10657.05128, -26362.17949, -38327.99145, 560.8974359, -560.8974359, -27857.90598, -560.8974359, 24118.58974, 24866.45299, 10657.05128, -10657.05128, 9909.188034, 24118.58974, -24118.58974, -36832.26496, 26362.17949, 10657.05128, -38327.99145 }, { 24866.45299, 560.8974359, -24118.58974, 81704.05983, 26362.17949, -26362.17949, 24866.45299, 24118.58974, -560.8974359, 9909.188034, -10657.05128, 10657.05128, -38327.99145, -26362.17949, -10657.05128, -27857.90598, -560.8974359, 560.8974359, -38327.99145, 10657.05128, 26362.17949, -36832.26496, -24118.58974, 24118.58974 }, { -560.8974359, -27857.90598, 560.8974359, 26362.17949, 81704.05983, -26362.17949, 24118.58974, 24866.45299, -560.8974359, 10657.05128, -38327.99145, 26362.17949, -26362.17949, -38327.99145, -10657.05128, 560.8974359, 24866.45299, -24118.58974, -10657.05128, 9909.188034, 10657.05128, -24118.58974, -36832.26496, 24118.58974 }, { -24118.58974, -560.8974359, 24866.45299, -26362.17949, -26362.17949, 81704.05983, 560.8974359, 560.8974359, -27857.90598, -10657.05128, 26362.17949, -38327.99145, 10657.05128, 10657.05128, 9909.188034, -560.8974359, -24118.58974, 24866.45299, 26362.17949, -10657.05128, -38327.99145, 24118.58974, 24118.58974, -36832.26496 }, { 9909.188034, -10657.05128, -10657.05128, 24866.45299, 24118.58974, 560.8974359, 81704.05983, 26362.17949, 26362.17949, 24866.45299, 560.8974359, 24118.58974, -36832.26496, -24118.58974, -24118.58974, -38327.99145, 10657.05128, -26362.17949, -27857.90598, -560.8974359, -560.8974359, -38327.99145, -26362.17949, 10657.05128 }, { 10657.05128, -38327.99145, -26362.17949, 24118.58974, 24866.45299, 560.8974359, 26362.17949, 81704.05983, 26362.17949, -560.8974359, -27857.90598, -560.8974359, -24118.58974, -36832.26496, -24118.58974, -10657.05128, 9909.188034, -10657.05128, 560.8974359, 24866.45299, 24118.58974, -26362.17949, -38327.99145, 10657.05128 }, { 10657.05128, -26362.17949, -38327.99145, -560.8974359, -560.8974359, -27857.90598, 26362.17949, 26362.17949, 81704.05983, 24118.58974, 560.8974359, 24866.45299, -24118.58974, -24118.58974, -36832.26496, -26362.17949, 10657.05128, -38327.99145, 560.8974359, 24118.58974, 24866.45299, -10657.05128, -10657.05128, 9909.188034 }, { 24866.45299, -24118.58974, 560.8974359, 9909.188034, 10657.05128, -10657.05128, 24866.45299, -560.8974359, 24118.58974, 81704.05983, -26362.17949, 26362.17949, -38327.99145, -10657.05128, -26362.17949, -36832.26496, 24118.58974, -24118.58974, -38327.99145, 26362.17949, 10657.05128, -27857.90598, 560.8974359, -560.8974359 }, { -24118.58974, 24866.45299, -560.8974359, -10657.05128, -38327.99145, 26362.17949, 560.8974359, -27857.90598, 560.8974359, -26362.17949, 81704.05983, -26362.17949, 10657.05128, 9909.188034, 10657.05128, 24118.58974, -36832.26496, 24118.58974, 26362.17949, -38327.99145, -10657.05128, -560.8974359, 24866.45299, -24118.58974 }, { -560.8974359, 560.8974359, -27857.90598, 10657.05128, 26362.17949, -38327.99145, 24118.58974, -560.8974359, 24866.45299, 26362.17949, -26362.17949, 81704.05983, -26362.17949, -10657.05128, -38327.99145, -24118.58974, 24118.58974, -36832.26496, -10657.05128, 10657.05128, 9909.188034, 560.8974359, -24118.58974, 24866.45299 }, { -27857.90598, -560.8974359, -560.8974359, -38327.99145, -26362.17949, 10657.05128, -36832.26496, -24118.58974, -24118.58974, -38327.99145, 10657.05128, -26362.17949, 81704.05983, 26362.17949, 26362.17949, 24866.45299, 560.8974359, 24118.58974, 9909.188034, -10657.05128, -10657.05128, 24866.45299, 24118.58974, 560.8974359 }, { 560.8974359, 24866.45299, 24118.58974, -26362.17949, -38327.99145, 10657.05128, -24118.58974, -36832.26496, -24118.58974, -10657.05128, 9909.188034, -10657.05128, 26362.17949, 81704.05983, 26362.17949, -560.8974359, -27857.90598, -560.8974359, 10657.05128, -38327.99145, -26362.17949, 24118.58974, 24866.45299, 560.8974359 }, { 560.8974359, 24118.58974, 24866.45299, -10657.05128, -10657.05128, 9909.188034, -24118.58974, -24118.58974, -36832.26496, -26362.17949, 10657.05128, -38327.99145, 26362.17949, 26362.17949, 81704.05983, 24118.58974, 560.8974359, 24866.45299, 10657.05128, -26362.17949, -38327.99145, -560.8974359, -560.8974359, -27857.90598 }, { -38327.99145, 26362.17949, 10657.05128, -27857.90598, 560.8974359, -560.8974359, -38327.99145, -10657.05128, -26362.17949, -36832.26496, 24118.58974, -24118.58974, 24866.45299, -560.8974359, 24118.58974, 81704.05983, -26362.17949, 26362.17949, 24866.45299, -24118.58974, 560.8974359, 9909.188034, 10657.05128, -10657.05128 }, { 26362.17949, -38327.99145, -10657.05128, -560.8974359, 24866.45299, -24118.58974, 10657.05128, 9909.188034, 10657.05128, 24118.58974, -36832.26496, 24118.58974, 560.8974359, -27857.90598, 560.8974359, -26362.17949, 81704.05983, -26362.17949, -24118.58974, 24866.45299, -560.8974359, -10657.05128, -38327.99145, 26362.17949 }, { -10657.05128, 10657.05128, 9909.188034, 560.8974359, -24118.58974, 24866.45299, -26362.17949, -10657.05128, -38327.99145, -24118.58974, 24118.58974, -36832.26496, 24118.58974, -560.8974359, 24866.45299, 26362.17949, -26362.17949, 81704.05983, -560.8974359, 560.8974359, -27857.90598, 10657.05128, 26362.17949, -38327.99145 }, { -36832.26496, 24118.58974, 24118.58974, -38327.99145, -10657.05128, 26362.17949, -27857.90598, 560.8974359, 560.8974359, -38327.99145, 26362.17949, -10657.05128, 9909.188034, 10657.05128, 10657.05128, 24866.45299, -24118.58974, -560.8974359, 81704.05983, -26362.17949, -26362.17949, 24866.45299, -560.8974359, -24118.58974 }, { 24118.58974, -36832.26496, -24118.58974, 10657.05128, 9909.188034, -10657.05128, -560.8974359, 24866.45299, 24118.58974, 26362.17949, -38327.99145, 10657.05128, -10657.05128, -38327.99145, -26362.17949, -24118.58974, 24866.45299, 560.8974359, -26362.17949, 81704.05983, 26362.17949, 560.8974359, -27857.90598, -560.8974359 }, { 24118.58974, -24118.58974, -36832.26496, 26362.17949, 10657.05128, -38327.99145, -560.8974359, 24118.58974, 24866.45299, 10657.05128, -10657.05128, 9909.188034, -10657.05128, -26362.17949, -38327.99145, 560.8974359, -560.8974359, -27857.90598, -26362.17949, 26362.17949, 81704.05983, -24118.58974, 560.8974359, 24866.45299 }, { -38327.99145, 10657.05128, 26362.17949, -36832.26496, -24118.58974, 24118.58974, -38327.99145, -26362.17949, -10657.05128, -27857.90598, -560.8974359, 560.8974359, 24866.45299, 24118.58974, -560.8974359, 9909.188034, -10657.05128, 10657.05128, 24866.45299, 560.8974359, -24118.58974, 81704.05983, 26362.17949, -26362.17949 }, { -10657.05128, 9909.188034, 10657.05128, -24118.58974, -36832.26496, 24118.58974, -26362.17949, -38327.99145, -10657.05128, 560.8974359, 24866.45299, -24118.58974, 24118.58974, 24866.45299, -560.8974359, 10657.05128, -38327.99145, 26362.17949, -560.8974359, -27857.90598, 560.8974359, 26362.17949, 81704.05983, -26362.17949 }, { 26362.17949, -10657.05128, -38327.99145, 24118.58974, 24118.58974, -36832.26496, 10657.05128, 10657.05128, 9909.188034, -560.8974359, -24118.58974, 24866.45299, 560.8974359, 560.8974359, -27857.90598, -10657.05128, 26362.17949, -38327.99145, -24118.58974, -560.8974359, 24866.45299, -26362.17949, -26362.17949, 81704.05983 } })); //var element = new Element() { ID = 0, ElementType = new Hexa8(Material1) }; ////var element = new Element() { ID = 0, ElementType = new Hexa8Fixed(Material1) }; //foreach (var node in AbaqusToMSolveHexa8Nodes(NodeSet1)) element.AddNode(node); //writer.WriteToFile(element.ElementType.StiffnessMatrix(element), output, true); Assert.True(computedK.Equals(expectedK, 1e-8)); }
private static void TestStiffnessMatrix0() { var factory = new ContinuumElement3DFactory(Material0, DynamicMaterial0); var tet4 = factory.CreateElement(CellType.Tet4, NodeSet0); IMatrix K = tet4.BuildStiffnessMatrix(); double[,] expectedK = { { 745.0, 540.0, 120.0, -5.0, 30.0, 60.0, -270.0, -240.0, 0.0, -470.0, -330.0, -180.0 }, { 540, 1720, 270, -120, 520, 210, -120, -1080, -60, -300, -1160, -420 }, { 120, 270, 565, 0, 150, 175, 0, -120, -270, -120, -300, -470 }, { -5, -120, 0, 145, -90, -60, -90, 120, 0, -50, 90, 60 }, { 30, 520, 150, -90, 220, 90, 60, -360, -60, 0, -380, -180 }, { 60, 210, 175, -60, 90, 145, 0, -120, -90, 0, -180, -230 }, { -270, -120, 0, -90, 60, 0, 180, 0, 0, 180, 60, 0 }, { -240, -1080, -120, 120, -360, -120, 0, 720, 0, 120, 720, 240 }, { 0, -60, -270, 0, -60, -90, 0, 0, 180, 0, 120, 180 }, { -470, -300, -120, -50, 0, 0, 180, 120, 0, 340, 180, 120 }, { -330, -1160, -300, 90, -380, -180, 60, 720, 120, 180, 820, 360 }, { -180, -420, -470, 60, -180, -230, 0, 240, 180, 120, 360, 520 }, }; Assert.True(K.Equals(Matrix.CreateFromArray(expectedK), 1e-10)); }
//[Fact] private static void TestStiffnessMatrix0() { var factory = new ContinuumElement3DFactory(Material0, DynamicMaterial0); var hexa8 = factory.CreateElement(CellType.Hexa8, AbaqusToMSolveHexa8Nodes(NodeSet0)); var computedK = hexa8.BuildStiffnessMatrix(); var expectedK = AbaqusToMSolveHexa8StructuralMatrix(Matrix.CreateFromArray(new double[24, 24] { { 972.667378917380, -313.835470085470, -313.835470085470, 296.029202279200, -6.67735042735140, -287.126068376070, 296.029202279200, -287.126068376070, -6.67735042735140, 117.966524216520, 126.869658119660, 126.869658119660, -331.641737891740, 6.67735042735140, 6.67735042735140, -456.285612535610, 313.835470085470, -126.869658119660, -456.285612535610, -126.869658119660, 313.835470085470, -438.479344729340, 287.126068376070, 287.126068376070 }, { -313.835470085470, 972.667378917380, 313.835470085470, 6.67735042735140, -331.641737891740, -6.67735042735140, -287.126068376070, 296.029202279200, 6.67735042735140, -126.869658119660, -456.285612535610, -313.835470085470, -6.67735042735140, 296.029202279200, 287.126068376070, 313.835470085470, -456.285612535610, 126.869658119660, 126.869658119660, 117.966524216520, -126.869658119660, 287.126068376070, -438.479344729340, -287.126068376070 }, { -313.835470085470, 313.835470085470, 972.667378917380, -287.126068376070, 6.67735042735140, 296.029202279200, 6.67735042735140, -6.67735042735140, -331.641737891740, -126.869658119660, -313.835470085470, -456.285612535610, -6.67735042735140, 287.126068376070, 296.029202279200, 126.869658119660, -126.869658119660, 117.966524216520, 313.835470085470, 126.869658119660, -456.285612535610, 287.126068376070, -287.126068376070, -438.479344729340 }, { 296.029202279200, 6.67735042735140, -287.126068376070, 972.667378917380, 313.835470085470, -313.835470085470, 117.966524216520, -126.869658119660, 126.869658119660, 296.029202279200, 287.126068376070, -6.67735042735140, -456.285612535610, -313.835470085470, -126.869658119660, -331.641737891740, -6.67735042735140, 6.67735042735140, -438.479344729340, -287.126068376070, 287.126068376070, -456.285612535610, 126.869658119660, 313.835470085470 }, { -6.67735042735140, -331.641737891740, 6.67735042735140, 313.835470085470, 972.667378917380, -313.835470085470, 126.869658119660, -456.285612535610, 313.835470085470, 287.126068376070, 296.029202279200, -6.67735042735140, -313.835470085470, -456.285612535610, -126.869658119660, 6.67735042735130, 296.029202279200, -287.126068376070, -287.126068376070, -438.479344729340, 287.126068376070, -126.869658119660, 117.966524216520, 126.869658119660 }, { -287.126068376070, -6.67735042735140, 296.029202279200, -313.835470085470, -313.835470085470, 972.667378917380, -126.869658119660, 313.835470085470, -456.285612535610, 6.67735042735140, 6.67735042735140, -331.641737891740, 126.869658119660, 126.869658119660, 117.966524216520, -6.67735042735140, -287.126068376070, 296.029202279200, 287.126068376070, 287.126068376070, -438.479344729340, 313.835470085470, -126.869658119660, -456.285612535610 }, { 296.029202279200, -287.126068376070, 6.67735042735140, 117.966524216520, 126.869658119660, -126.869658119660, 972.667378917380, -313.835470085470, 313.835470085470, 296.029202279200, -6.67735042735140, 287.126068376070, -456.285612535610, -126.869658119660, -313.835470085470, -438.479344729340, 287.126068376070, -287.126068376070, -331.641737891740, 6.67735042735140, -6.67735042735140, -456.285612535610, 313.835470085470, 126.869658119660 }, { -287.126068376070, 296.029202279200, -6.67735042735140, -126.869658119660, -456.285612535610, 313.835470085470, -313.835470085470, 972.667378917380, -313.835470085470, 6.67735042735140, -331.641737891740, 6.67735042735130, 126.869658119660, 117.966524216520, 126.869658119660, 287.126068376070, -438.479344729340, 287.126068376070, -6.67735042735140, 296.029202279200, -287.126068376070, 313.835470085470, -456.285612535610, -126.869658119660 }, { -6.67735042735140, 6.67735042735140, -331.641737891740, 126.869658119660, 313.835470085470, -456.285612535610, 313.835470085470, -313.835470085470, 972.667378917380, 287.126068376070, -6.67735042735140, 296.029202279200, -313.835470085470, -126.869658119660, -456.285612535610, -287.126068376070, 287.126068376070, -438.479344729340, 6.67735042735140, -287.126068376070, 296.029202279200, -126.869658119660, 126.869658119660, 117.966524216520 }, { 117.966524216520, -126.869658119660, -126.869658119660, 296.029202279200, 287.126068376070, 6.67735042735140, 296.029202279200, 6.67735042735140, 287.126068376070, 972.667378917380, 313.835470085470, 313.835470085470, -438.479344729340, -287.126068376070, -287.126068376070, -456.285612535610, 126.869658119660, -313.835470085470, -456.285612535610, -313.835470085470, 126.869658119660, -331.641737891740, -6.67735042735140, -6.67735042735140 }, { 126.869658119660, -456.285612535610, -313.835470085470, 287.126068376070, 296.029202279200, 6.67735042735140, -6.67735042735140, -331.641737891740, -6.67735042735140, 313.835470085470, 972.667378917380, 313.835470085470, -287.126068376070, -438.479344729340, -287.126068376070, -126.869658119660, 117.966524216520, -126.869658119660, -313.835470085470, -456.285612535610, 126.869658119660, 6.67735042735140, 296.029202279200, 287.126068376070 }, { 126.869658119660, -313.835470085470, -456.285612535610, -6.67735042735140, -6.67735042735140, -331.641737891740, 287.126068376070, 6.67735042735130, 296.029202279200, 313.835470085470, 313.835470085470, 972.667378917380, -287.126068376070, -287.126068376070, -438.479344729340, -313.835470085470, 126.869658119660, -456.285612535610, -126.869658119660, -126.869658119660, 117.966524216520, 6.67735042735140, 287.126068376070, 296.029202279200 }, { -331.641737891740, -6.67735042735140, -6.67735042735140, -456.285612535610, -313.835470085470, 126.869658119660, -456.285612535610, 126.869658119660, -313.835470085470, -438.479344729340, -287.126068376070, -287.126068376070, 972.667378917380, 313.835470085470, 313.835470085470, 296.029202279200, 6.67735042735130, 287.126068376070, 296.029202279200, 287.126068376070, 6.67735042735140, 117.966524216520, -126.869658119660, -126.869658119660 }, { 6.67735042735140, 296.029202279200, 287.126068376070, -313.835470085470, -456.285612535610, 126.869658119660, -126.869658119660, 117.966524216520, -126.869658119660, -287.126068376070, -438.479344729340, -287.126068376070, 313.835470085470, 972.667378917380, 313.835470085470, -6.67735042735140, -331.641737891740, -6.67735042735140, 287.126068376070, 296.029202279200, 6.67735042735140, 126.869658119660, -456.285612535610, -313.835470085470 }, { 6.67735042735140, 287.126068376070, 296.029202279200, -126.869658119660, -126.869658119660, 117.966524216520, -313.835470085470, 126.869658119660, -456.285612535610, -287.126068376070, -287.126068376070, -438.479344729340, 313.835470085470, 313.835470085470, 972.667378917380, 287.126068376070, 6.67735042735140, 296.029202279200, -6.67735042735140, -6.67735042735140, -331.641737891740, 126.869658119660, -313.835470085470, -456.285612535610 }, { -456.285612535610, 313.835470085470, 126.869658119660, -331.641737891740, 6.67735042735130, -6.67735042735140, -438.479344729340, 287.126068376070, -287.126068376070, -456.285612535610, -126.869658119660, -313.835470085470, 296.029202279200, -6.67735042735140, 287.126068376070, 972.667378917380, -313.835470085470, 313.835470085470, 117.966524216520, 126.869658119660, -126.869658119660, 296.029202279200, -287.126068376070, 6.67735042735140 }, { 313.835470085470, -456.285612535610, -126.869658119660, -6.67735042735140, 296.029202279200, -287.126068376070, 287.126068376070, -438.479344729340, 287.126068376070, 126.869658119660, 117.966524216520, 126.869658119660, 6.67735042735130, -331.641737891740, 6.67735042735140, -313.835470085470, 972.667378917380, -313.835470085470, -126.869658119660, -456.285612535610, 313.835470085470, -287.126068376070, 296.029202279200, -6.67735042735140 }, { -126.869658119660, 126.869658119660, 117.966524216520, 6.67735042735140, -287.126068376070, 296.029202279200, -287.126068376070, 287.126068376070, -438.479344729340, -313.835470085470, -126.869658119660, -456.285612535610, 287.126068376070, -6.67735042735140, 296.029202279200, 313.835470085470, -313.835470085470, 972.667378917380, 126.869658119660, 313.835470085470, -456.285612535610, -6.67735042735130, 6.67735042735140, -331.641737891740 }, { -456.285612535610, 126.869658119660, 313.835470085470, -438.479344729340, -287.126068376070, 287.126068376070, -331.641737891740, -6.67735042735140, 6.67735042735140, -456.285612535610, -313.835470085470, -126.869658119660, 296.029202279200, 287.126068376070, -6.67735042735140, 117.966524216520, -126.869658119660, 126.869658119660, 972.667378917380, 313.835470085470, -313.835470085470, 296.029202279200, 6.67735042735140, -287.126068376070 }, { -126.869658119660, 117.966524216520, 126.869658119660, -287.126068376070, -438.479344729340, 287.126068376070, 6.67735042735140, 296.029202279200, -287.126068376070, -313.835470085470, -456.285612535610, -126.869658119660, 287.126068376070, 296.029202279200, -6.67735042735140, 126.869658119660, -456.285612535610, 313.835470085470, 313.835470085470, 972.667378917380, -313.835470085470, -6.67735042735140, -331.641737891740, 6.67735042735140 }, { 313.835470085470, -126.869658119660, -456.285612535610, 287.126068376070, 287.126068376070, -438.479344729340, -6.67735042735140, -287.126068376070, 296.029202279200, 126.869658119660, 126.869658119660, 117.966524216520, 6.67735042735140, 6.67735042735140, -331.641737891740, -126.869658119660, 313.835470085470, -456.285612535610, -313.835470085470, -313.835470085470, 972.667378917380, -287.126068376070, -6.67735042735140, 296.029202279200 }, { -438.479344729340, 287.126068376070, 287.126068376070, -456.285612535610, -126.869658119660, 313.835470085470, -456.285612535610, 313.835470085470, -126.869658119660, -331.641737891740, 6.67735042735140, 6.67735042735140, 117.966524216520, 126.869658119660, 126.869658119660, 296.029202279200, -287.126068376070, -6.67735042735130, 296.029202279200, -6.67735042735140, -287.126068376070, 972.667378917380, -313.835470085470, -313.835470085470 }, { 287.126068376070, -438.479344729340, -287.126068376070, 126.869658119660, 117.966524216520, -126.869658119660, 313.835470085470, -456.285612535610, 126.869658119660, -6.67735042735140, 296.029202279200, 287.126068376070, -126.869658119660, -456.285612535610, -313.835470085470, -287.126068376070, 296.029202279200, 6.67735042735140, 6.67735042735140, -331.641737891740, -6.67735042735140, -313.835470085470, 972.667378917380, 313.835470085470 }, { 287.126068376070, -287.126068376070, -438.479344729340, 313.835470085470, 126.869658119660, -456.285612535610, 126.869658119660, -126.869658119660, 117.966524216520, -6.67735042735140, 287.126068376070, 296.029202279200, -126.869658119660, -313.835470085470, -456.285612535610, 6.67735042735140, -6.67735042735140, -331.641737891740, -287.126068376070, 6.67735042735140, 296.029202279200, -313.835470085470, 313.835470085470, 972.667378917380 }, })); Assert.True(computedK.Equals(expectedK, 1e-8)); }
private static void BuildCantileverModel(Model model, double load_value) { //xrhsimopoiithike to ParadeigmataElegxwnBuilder.HexaCantileverBuilder(Model model, double load_value) // allagh tou element kai tou material //ElasticMaterial3DTemp material1 = new ElasticMaterial3DTemp() //{ // YoungModulus = 1353000, // PoissonRatio = 0.3, //}; //VonMisesMaterial3D material1 = new VonMisesMaterial3D(1353000, 0.30, 1353000, 0.15); var material1 = new ElasticMaterial3D() { PoissonRatio = 0.3, YoungModulus = 1353000 }; double[,] nodeData = new double[, ] { { -0.250000, -0.250000, -1.000000 }, { 0.250000, -0.250000, -1.000000 }, { -0.250000, 0.250000, -1.000000 }, { 0.250000, 0.250000, -1.000000 }, { -0.250000, -0.250000, -0.500000 }, { 0.250000, -0.250000, -0.500000 }, { -0.250000, 0.250000, -0.500000 }, { 0.250000, 0.250000, -0.500000 }, { -0.250000, -0.250000, 0.000000 }, { 0.250000, -0.250000, 0.000000 }, { -0.250000, 0.250000, 0.000000 }, { 0.250000, 0.250000, 0.000000 }, { -0.250000, -0.250000, 0.500000 }, { 0.250000, -0.250000, 0.500000 }, { -0.250000, 0.250000, 0.500000 }, { 0.250000, 0.250000, 0.500000 }, { -0.250000, -0.250000, 1.000000 }, { 0.250000, -0.250000, 1.000000 }, { -0.250000, 0.250000, 1.000000 }, { 0.250000, 0.250000, 1.000000 } }; int[,] elementData = new int[, ] { { 1, 8, 7, 5, 6, 4, 3, 1, 2 }, { 2, 12, 11, 9, 10, 8, 7, 5, 6 }, { 3, 16, 15, 13, 14, 12, 11, 9, 10 }, { 4, 20, 19, 17, 18, 16, 15, 13, 14 }, }; // orismos shmeiwn double correction = 10;// +20; for (int nNode = 0; nNode < nodeData.GetLength(0); nNode++) { model.NodesDictionary.Add(nNode + 1, new Node(nNode + 1, nodeData[nNode, 0] + correction, nodeData[nNode, 1] + correction, nodeData[nNode, 2] + correction)); } // orismos elements Element e1; int subdomainID = Hexa8Continuum3DLinearCantilever.subdomainID; int[] ContinuumHexa8NodesNumbering = new int[8] { 7, 8, 5, 6, 3, 4, 1, 2 }; // { 2, 3, 7, 6, 1, 4, 8, 5 }; for (int nElement = 0; nElement < elementData.GetLength(0); nElement++) { DynamicMaterial DynamicMaterial = new DynamicMaterial(1, 0, 0); //Dictionary<int,Node3D > List <Node> nodeSet = new List <Node>(8); for (int j = 0; j < 8; j++) { int nodeID = elementData[nElement, j + 1]; nodeSet.Add((Node)model.NodesDictionary[nodeID]); } var factory = new ContinuumElement3DFactory(material1, DynamicMaterial); //e1 = factory.CreateElement(CellType3D.Hexa8, nodeSet); e1 = new Element() { ID = nElement + 1, ElementType = factory.CreateElement(CellType.Hexa8, nodeSet) // dixws to e. exoume sfalma enw sto beambuilding oxi//edw kaleitai me ena orisma to Hexa8 }; for (int j = 0; j < 8; j++) { int nodeID = elementData[nElement, j + 1]; e1.NodesDictionary.Add(nodeID, model.NodesDictionary[nodeID]); } model.ElementsDictionary.Add(e1.ID, e1); model.SubdomainsDictionary[subdomainID].Elements.Add(e1); } // constraint vashh opou z=-1 for (int k = 1; k < 5; k++) { model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); } // fortish korufhs Load load1; for (int k = 17; k < 21; k++) { load1 = new Load() { Node = model.NodesDictionary[k], DOF = StructuralDof.TranslationX, Amount = 1 * load_value }; model.Loads.Add(load1); } }
private static void BuildCantileverModel(Model model, double load_value) { //xrhsimopoiithike to ParadeigmataElegxwnBuilder.HexaCantileverBuilder(Model model, double load_value) // allagh tou element kai tou material //IContinuumMaterial3DTemp material1 = new IContinuumMaterial3DTemp() //{ // YoungModulus = 1353000, // PoissonRatio = 0.3, //}; //VonMisesMaterial3D material1 = new VonMisesMaterial3D(1353000, 0.30, 1353000, 0.15); var material1 = new ElasticMaterial3D() { PoissonRatio = 0.3, YoungModulus = 1353000 }; double[,] nodeData = new double[, ] { { -0.250000, -0.250000, -1.000000 }, { 0.250000, -0.250000, -1.000000 }, { -0.250000, 0.250000, -1.000000 }, { 0.250000, 0.250000, -1.000000 }, { -0.250000, -0.250000, -0.500000 }, { 0.250000, -0.250000, -0.500000 }, { -0.250000, 0.250000, -0.500000 }, { 0.250000, 0.250000, -0.500000 }, { -0.250000, -0.250000, 0.000000 }, { 0.250000, -0.250000, 0.000000 }, { -0.250000, 0.250000, 0.000000 }, { 0.250000, 0.250000, 0.000000 }, { -0.250000, -0.250000, 0.500000 }, { 0.250000, -0.250000, 0.500000 }, { -0.250000, 0.250000, 0.500000 }, { 0.250000, 0.250000, 0.500000 }, { -0.250000, -0.250000, 1.000000 }, { 0.250000, -0.250000, 1.000000 }, { -0.250000, 0.250000, 1.000000 }, { 0.250000, 0.250000, 1.000000 } }; int[,] elementData = new int[, ] { { 1, 8, 7, 5, 6, 4, 3, 1, 2 }, { 2, 12, 11, 9, 10, 8, 7, 5, 6 }, { 3, 16, 15, 13, 14, 12, 11, 9, 10 }, { 4, 20, 19, 17, 18, 16, 15, 13, 14 }, }; // orismos shmeiwn for (int nNode = 0; nNode < nodeData.GetLength(0); nNode++) { model.NodesDictionary.Add(nNode + 1, new Node(id: nNode + 1, x: nodeData[nNode, 0], y: nodeData[nNode, 1], z: nodeData[nNode, 2])); } // orismos elements Element e1; DynamicMaterial DynamicMaterial = new DynamicMaterial(1, 0, 0); var factory = new ContinuumElement3DFactory(material1, DynamicMaterial); int subdomainID = Hexa8NonLinearCantilever.subdomainID; for (int nElement = 0; nElement < elementData.GetLength(0); nElement++) { List <Node> nodeSet = new List <Node>(8); for (int j = 0; j < 8; j++) { int nodeID = elementData[nElement, j + 1]; nodeSet.Add((Node)model.NodesDictionary[nodeID]); } e1 = new Element() { ID = nElement + 1, ElementType //= factory.CreateNonLinearElement(CellType.Hexa8, nodeSet, material1, DynamicMaterial) //nnew Hexa8NonLinear(material1, GaussLegendre3D.GetQuadratureWithOrder(3, 3, 3)) // dixws to e. exoume sfalma enw sto beambuilding oxi//edw kaleitai me ena orisma to Hexa8 = new ContinuumElement3DNonLinear(nodeSet, material1, GaussLegendre3D.GetQuadratureWithOrder(3, 3, 3), InterpolationHexa8.UniqueInstance), }; for (int j = 0; j < 8; j++) { e1.NodesDictionary.Add(elementData[nElement, j + 1], model.NodesDictionary[elementData[nElement, j + 1]]); } model.ElementsDictionary.Add(e1.ID, e1); model.SubdomainsDictionary[subdomainID].Elements.Add(e1); } // constraint vashh opou z=-1 for (int k = 1; k < 5; k++) { model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); } // fortish korufhs Load load1; for (int k = 17; k < 21; k++) { load1 = new Load() { Node = model.NodesDictionary[k], DOF = StructuralDof.TranslationX, Amount = 1 * load_value }; model.Loads.Add(load1); } }
public static void HostElementsBuilder(Model model) { // Nodes Geometry model.NodesDictionary.Add(1, new Node(id: 1, x: 10.00, y: 2.50, z: 2.50)); model.NodesDictionary.Add(2, new Node(id: 2, x: 0.00, y: 2.50, z: 2.50)); model.NodesDictionary.Add(3, new Node(id: 3, x: 0.00, y: -2.50, z: 2.50)); model.NodesDictionary.Add(4, new Node(id: 4, x: 10.00, y: -2.50, z: 2.50)); model.NodesDictionary.Add(5, new Node(id: 5, x: 10.00, y: 2.50, z: -2.50)); model.NodesDictionary.Add(6, new Node(id: 6, x: 0.00, y: 2.50, z: -2.50)); model.NodesDictionary.Add(7, new Node(id: 7, x: 0.00, y: -2.50, z: -2.50)); model.NodesDictionary.Add(8, new Node(id: 8, x: 10.00, y: -2.50, z: -2.50)); // Boundary Conditions model.NodesDictionary[2].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[2].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[2].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); model.NodesDictionary[3].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[3].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[3].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); model.NodesDictionary[6].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[6].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[6].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); model.NodesDictionary[7].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[7].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[7].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); // Create Material var solidMaterial = new ElasticMaterial3D() { YoungModulus = 3.76, PoissonRatio = 0.3779, }; DynamicMaterial DynamicMaterial = new DynamicMaterial(1, 0, 0); var factory = new ContinuumElement3DFactory(solidMaterial, DynamicMaterial); // Hexa8NL element definition List <Node> nodeSet = new List <Node>(8); for (int j = 1; j < 9; j++) { nodeSet.Add((Node)model.NodesDictionary[j]); } var hexa8NLelement = new Element() { ID = 1, ElementType = // factory.CreateNonLinearElement(CellType.Hexa8, nodeSet, solidMaterial, DynamicMaterial) new Hexa8NonLinear(solidMaterial, GaussLegendre3D.GetQuadratureWithOrder(3, 3, 3)) // = new ContinummElement3DNonLinear(nodeSet, solidMaterial, GaussLegendre3D.GetQuadratureWithOrder(3, 3, 3), ISAAR.MSolve.FEM.Interpolation.InterpolationHexa8.UniqueInstance) }; // Add nodes to the created element hexa8NLelement.AddNode(model.NodesDictionary[1]); hexa8NLelement.AddNode(model.NodesDictionary[2]); hexa8NLelement.AddNode(model.NodesDictionary[3]); hexa8NLelement.AddNode(model.NodesDictionary[4]); hexa8NLelement.AddNode(model.NodesDictionary[5]); hexa8NLelement.AddNode(model.NodesDictionary[6]); hexa8NLelement.AddNode(model.NodesDictionary[7]); hexa8NLelement.AddNode(model.NodesDictionary[8]); // Add Hexa element to the element and subdomains dictionary of the model model.ElementsDictionary.Add(hexa8NLelement.ID, hexa8NLelement); model.SubdomainsDictionary[1].Elements.Add(hexa8NLelement); // Add nodal load values at the top nodes of the model model.Loads.Add(new Load() { Amount = 25, Node = model.NodesDictionary[1], DOF = StructuralDof.TranslationZ }); model.Loads.Add(new Load() { Amount = 25, Node = model.NodesDictionary[4], DOF = StructuralDof.TranslationZ }); model.Loads.Add(new Load() { Amount = 25, Node = model.NodesDictionary[5], DOF = StructuralDof.TranslationZ }); model.Loads.Add(new Load() { Amount = 25, Node = model.NodesDictionary[8], DOF = StructuralDof.TranslationZ }); }
public static void WriteStiffnessOfContinuum3DStructure() { // _____ ____ // / / /| // /____/____/ | // | | | | // |____|____|/| // | | | / // |____|____|/ // // Model with 1 subdomain var model = new Model(); model.SubdomainsDictionary.Add(subdomainID, new Subdomain(subdomainID)); // Material var material = new ElasticMaterial3D() { YoungModulus = 2.1E7, PoissonRatio = 0.3 }; var dynamicProperties = new DynamicMaterial(1.0, 0.0, 0.0, true); // Generate mesh double lengthX = 2.0; double lengthY = 2.4; double lengthZ = 2.2; var meshGenerator = new UniformMeshGenerator3D <Node>(0.0, 0.0, 0.0, lengthX, lengthY, lengthZ, 10, 10, 10); (IReadOnlyList <Node> vertices, IReadOnlyList <CellConnectivity <Node> > cells) = meshGenerator.CreateMesh((id, x, y, z) => new Node(id: id, x: x, y: y, z: z)); // Add nodes to the model for (int n = 0; n < vertices.Count; ++n) { model.NodesDictionary.Add(n, vertices[n]); } // Add Quad4 elements to the model var factory = new ContinuumElement3DFactory(material, dynamicProperties); for (int e = 0; e < cells.Count; ++e) { ContinuumElement3D element = factory.CreateElement(cells[e].CellType, cells[e].Vertices); var elementWrapper = new Element() { ID = e, ElementType = element }; foreach (Node node in element.Nodes) { elementWrapper.AddNode(node); } model.ElementsDictionary.Add(e, elementWrapper); model.SubdomainsDictionary[subdomainID].Elements.Add(elementWrapper); } // Solver var solverBuilder = new SkylineSolver.Builder(); SkylineSolver solver = solverBuilder.BuildSolver(model); // Structural problem provider var provider = new ProblemStructural(model, solver); // Linear static analysis var childAnalyzer = new LinearAnalyzer(model, solver, provider); var parentAnalyzer = new StaticAnalyzer(model, solver, provider, childAnalyzer); // Run the analysis to build the stiffness matrix parentAnalyzer.Initialize(); parentAnalyzer.BuildMatrices(); // Print the stiffness matrix //var writer = new MatlabWriter(); var writer = new RawArraysWriter(); writer.WriteToMultipleFiles((SkylineMatrix)solver.LinearSystems[subdomainID].Matrix, outputDirectory + @"\hexa8_10x10x10_stiffness.txt"); }
// DEFINE ELEMENTS AND BOUNDARY CONDITIONS internal static int DefineContinuumElement3DLinear(Model model, IIsotropicContinuumMaterial3D material3D, IDynamicMaterial dynamicMaterial) { // Node creation var node1 = new Node(id: 1, x: 0.0, y: 0.0, z: 0.0); var node2 = new Node(id: 2, x: 100.0, y: 0.0, z: 0.0); var node3 = new Node(id: 3, x: 0.0, y: 100.0, z: 0.0); var node4 = new Node(id: 4, x: 100.0, y: 100.0, z: 0.0); var node5 = new Node(id: 5, x: 0.0, y: 0.0, z: 100.0); var node6 = new Node(id: 6, x: 100.0, y: 0.0, z: 100.0); var node7 = new Node(id: 7, x: 0.0, y: 100.0, z: 100.0); var node8 = new Node(id: 8, x: 100.0, y: 100.0, z: 100.0); // Create List of nodes IList <Node> nodes = new List <Node>(); nodes.Add(node1); nodes.Add(node2); nodes.Add(node3); nodes.Add(node4); nodes.Add(node5); nodes.Add(node6); nodes.Add(node7); nodes.Add(node8); numberOfNodes = nodes.Count; // Add nodes to the nodes dictonary of the model for (int i = 0; i < numberOfNodes; ++i) { model.NodesDictionary.Add(i, nodes[i]); } int[][] connectivityMatrix = new int[8][]; connectivityMatrix[0] = new int[] { 1, 1, 2, 4, 3, 5, 6, 8, 7 }; var factory = new ContinuumElement3DFactory(material3D, dynamicMaterial); for (int i = 0; i < 1; i++) { List <Node> elementNodeSet = new List <Node>(8); for (int j = 1; j < 9; j++) { elementNodeSet.Add((Node)model.NodesDictionary[connectivityMatrix[i][j] - 1]); } var hexa8element = new Element() { ID = connectivityMatrix[i][0], ElementType = factory.CreateElement(CellType.Hexa8, elementNodeSet), }; for (int j = 1; j < 9; j++) { hexa8element.AddNode(model.NodesDictionary[connectivityMatrix[i][j] - 1]); } model.ElementsDictionary.Add(hexa8element.ID, hexa8element); model.SubdomainsDictionary[0].Elements.Add(hexa8element); } return(numberOfNodes); }
private static void BuildCantileverModel(Model model, double load_value) { //xrhsimopoiithike to ParadeigmataElegxwnBuilder.HexaCantileverBuilder(Model model, double load_value) // allagh tou element kai tou material //ElasticMaterial3DTemp material1 = new ElasticMaterial3DTemp() //{ // YoungModulus = 1353000, // PoissonRatio = 0.3, //}; //VonMisesMaterial3D material1 = new VonMisesMaterial3D(1353000, 0.30, 1353000, 0.15); var material1 = new ElasticMaterial3D() { PoissonRatio = 0.3, YoungModulus = 1353000 }; double[,] nodeData = new double[, ] { { -0.2500000000000000, 0.2500000000000000, -1.0000000000000000 }, { 0.2500000000000000, 0.2500000000000000, -1.0000000000000000 }, { 0.2500000000000000, -0.2500000000000000, -1.0000000000000000 }, { -0.2500000000000000, -0.2500000000000000, -1.0000000000000000 }, { -0.2500000000000000, 0.2500000000000000, 1.0000000000000000 }, { 0.2500000000000000, 0.2500000000000000, 1.0000000000000000 }, { 0.2500000000000000, -0.2500000000000000, 1.0000000000000000 }, { -0.2500000000000000, -0.2500000000000000, 1.0000000000000000 }, { -0.2500000000000000, 0.2500000000000000, 0.0000000000000000 }, { 0.2500000000000000, 0.2500000000000000, 0.0000000000000000 }, { 0.2500000000000000, -0.2500000000000000, 0.0000000000000000 }, { -0.2500000000000000, -0.2500000000000000, 0.0000000000000000 }, { 0.0000000000000000, 0.2500000000000000, -1.0000000000000000 }, { 0.2500000000000000, 0.0000000000000000, -1.0000000000000000 }, { 0.0000000000000000, -0.2500000000000000, -1.0000000000000000 }, { -0.2500000000000000, 0.0000000000000000, -1.0000000000000000 }, { 0.0000000000000000, 0.2500000000000000, 1.0000000000000000 }, { 0.2500000000000000, 0.0000000000000000, 1.0000000000000000 }, { 0.0000000000000000, -0.2500000000000000, 1.0000000000000000 }, { -0.2500000000000000, 0.0000000000000000, 1.0000000000000000 }, { 0.0000000000000000, 0.2500000000000000, 0.0000000000000000 }, { 0.2500000000000000, 0.0000000000000000, 0.0000000000000000 }, { 0.0000000000000000, -0.2500000000000000, 0.0000000000000000 }, { -0.2500000000000000, 0.0000000000000000, 0.0000000000000000 }, { -0.2500000000000000, 0.2500000000000000, -0.5000000000000000 }, { 0.2500000000000000, 0.2500000000000000, -0.5000000000000000 }, { 0.2500000000000000, -0.2500000000000000, -0.5000000000000000 }, { -0.2500000000000000, -0.2500000000000000, -0.5000000000000000 }, { -0.2500000000000000, 0.2500000000000000, 0.5000000000000000 }, { 0.2500000000000000, 0.2500000000000000, 0.5000000000000000 }, { 0.2500000000000000, -0.2500000000000000, 0.5000000000000000 }, { -0.2500000000000000, -0.2500000000000000, 0.5000000000000000 }, { 0.0000000000000000, 0.0000000000000000, -1.0000000000000000 }, { -0.1250000000000000, 0.1250000000000000, -1.0000000000000000 }, { 0.1250000000000000, 0.1250000000000000, -1.0000000000000000 }, { 0.1250000000000000, -0.1250000000000000, -1.0000000000000000 }, { -0.1250000000000000, -0.1250000000000000, -1.0000000000000000 }, { 0.0000000000000000, 0.0000000000000000, 1.0000000000000000 }, { -0.1250000000000000, 0.1250000000000000, 1.0000000000000000 }, { 0.1250000000000000, 0.1250000000000000, 1.0000000000000000 }, { 0.1250000000000000, -0.1250000000000000, 1.0000000000000000 }, { -0.1250000000000000, -0.1250000000000000, 1.0000000000000000 }, { 0.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, { -0.1250000000000000, 0.1250000000000000, 0.0000000000000000 }, { 0.1250000000000000, 0.1250000000000000, 0.0000000000000000 }, { 0.1250000000000000, -0.1250000000000000, 0.0000000000000000 }, { -0.1250000000000000, -0.1250000000000000, 0.0000000000000000 }, { 0.0000000000000000, 0.2500000000000000, -0.5000000000000000 }, { 0.1250000000000000, 0.2500000000000000, -0.7500000000000000 }, { -0.1250000000000000, 0.2500000000000000, -0.7500000000000000 }, { -0.1250000000000000, 0.2500000000000000, -0.2500000000000000 }, { 0.1250000000000000, 0.2500000000000000, -0.2500000000000000 }, { 0.2500000000000000, 0.0000000000000000, -0.5000000000000000 }, { 0.2500000000000000, -0.1250000000000000, -0.7500000000000000 }, { 0.2500000000000000, 0.1250000000000000, -0.7500000000000000 }, { 0.2500000000000000, 0.1250000000000000, -0.2500000000000000 }, { 0.2500000000000000, -0.1250000000000000, -0.2500000000000000 }, { 0.0000000000000000, -0.2500000000000000, -0.5000000000000000 }, { -0.1250000000000000, -0.2500000000000000, -0.7500000000000000 }, { 0.1250000000000000, -0.2500000000000000, -0.7500000000000000 }, { 0.1250000000000000, -0.2500000000000000, -0.2500000000000000 }, { -0.1250000000000000, -0.2500000000000000, -0.2500000000000000 }, { -0.2500000000000000, 0.0000000000000000, -0.5000000000000000 }, { -0.2500000000000000, 0.1250000000000000, -0.7500000000000000 }, { -0.2500000000000000, -0.1250000000000000, -0.7500000000000000 }, { -0.2500000000000000, -0.1250000000000000, -0.2500000000000000 }, { -0.2500000000000000, 0.1250000000000000, -0.2500000000000000 }, { 0.0000000000000000, 0.2500000000000000, 0.5000000000000000 }, { 0.1250000000000000, 0.2500000000000000, 0.2500000000000000 }, { -0.1250000000000000, 0.2500000000000000, 0.2500000000000000 }, { -0.1250000000000000, 0.2500000000000000, 0.7500000000000000 }, { 0.1250000000000000, 0.2500000000000000, 0.7500000000000000 }, { 0.2500000000000000, 0.0000000000000000, 0.5000000000000000 }, { 0.2500000000000000, -0.1250000000000000, 0.2500000000000000 }, { 0.2500000000000000, 0.1250000000000000, 0.2500000000000000 }, { 0.2500000000000000, 0.1250000000000000, 0.7500000000000000 }, { 0.2500000000000000, -0.1250000000000000, 0.7500000000000000 }, { 0.0000000000000000, -0.2500000000000000, 0.5000000000000000 }, { -0.1250000000000000, -0.2500000000000000, 0.2500000000000000 }, { 0.1250000000000000, -0.2500000000000000, 0.2500000000000000 }, { 0.1250000000000000, -0.2500000000000000, 0.7500000000000000 }, { -0.1250000000000000, -0.2500000000000000, 0.7500000000000000 }, { -0.2500000000000000, 0.0000000000000000, 0.5000000000000000 }, { -0.2500000000000000, 0.1250000000000000, 0.2500000000000000 }, { -0.2500000000000000, -0.1250000000000000, 0.2500000000000000 }, { -0.2500000000000000, -0.1250000000000000, 0.7500000000000000 }, { -0.2500000000000000, 0.1250000000000000, 0.7500000000000000 }, { 0.0000000000000000, 0.0000000000000000, -0.5000000000000000 }, { -0.1250000000000000, 0.1250000000000000, -0.7500000000000000 }, { 0.1250000000000000, 0.1250000000000000, -0.7500000000000000 }, { 0.1250000000000000, -0.1250000000000000, -0.7500000000000000 }, { -0.1250000000000000, -0.1250000000000000, -0.7500000000000000 }, { -0.1250000000000000, 0.1250000000000000, -0.2500000000000000 }, { 0.1250000000000000, 0.1250000000000000, -0.2500000000000000 }, { 0.1250000000000000, -0.1250000000000000, -0.2500000000000000 }, { -0.1250000000000000, -0.1250000000000000, -0.2500000000000000 }, { 0.0000000000000000, 0.0000000000000000, -0.7500000000000000 }, { 0.0000000000000000, 0.1250000000000000, -0.5000000000000000 }, { 0.1250000000000000, 0.0000000000000000, -0.5000000000000000 }, { 0.0000000000000000, -0.1250000000000000, -0.5000000000000000 }, { -0.1250000000000000, 0.0000000000000000, -0.5000000000000000 }, { 0.0000000000000000, 0.0000000000000000, -0.2500000000000000 }, { 0.0000000000000000, 0.0000000000000000, 0.5000000000000000 }, { -0.1250000000000000, 0.1250000000000000, 0.2500000000000000 }, { 0.1250000000000000, 0.1250000000000000, 0.2500000000000000 }, { 0.1250000000000000, -0.1250000000000000, 0.2500000000000000 }, { -0.1250000000000000, -0.1250000000000000, 0.2500000000000000 }, { -0.1250000000000000, 0.1250000000000000, 0.7500000000000000 }, { 0.1250000000000000, 0.1250000000000000, 0.7500000000000000 }, { 0.1250000000000000, -0.1250000000000000, 0.7500000000000000 }, { -0.1250000000000000, -0.1250000000000000, 0.7500000000000000 }, { 0.0000000000000000, 0.0000000000000000, 0.2500000000000000 }, { 0.0000000000000000, 0.1250000000000000, 0.5000000000000000 }, { 0.1250000000000000, 0.0000000000000000, 0.5000000000000000 }, { 0.0000000000000000, -0.1250000000000000, 0.5000000000000000 }, { -0.1250000000000000, 0.0000000000000000, 0.5000000000000000 }, { 0.0000000000000000, 0.0000000000000000, 0.7500000000000000 }, }; //int[] take_msolve_nodes_from_adina_tade_nodes = new int[] { 2, 1, 3, 0, 5, 7, 8, 6, 9, 4 }; int[,] elementData = new int[, ] { { 33, 2, 1, 88, 35, 13, 34, 90, 89, 97 }, { 33, 3, 2, 88, 36, 14, 35, 91, 90, 97 }, { 33, 4, 3, 88, 37, 15, 36, 92, 91, 97 }, { 33, 1, 4, 88, 34, 16, 37, 89, 92, 97 }, { 48, 1, 2, 88, 50, 13, 49, 89, 90, 98 }, { 48, 2, 10, 88, 49, 26, 52, 90, 94, 98 }, { 48, 10, 9, 88, 52, 21, 51, 94, 93, 98 }, { 48, 9, 1, 88, 51, 25, 50, 93, 89, 98 }, { 53, 2, 3, 88, 55, 14, 54, 90, 91, 99 }, { 53, 3, 11, 88, 54, 27, 57, 91, 95, 99 }, { 53, 11, 10, 88, 57, 22, 56, 95, 94, 99 }, { 53, 10, 2, 88, 56, 26, 55, 94, 90, 99 }, { 58, 3, 4, 88, 60, 15, 59, 91, 92, 100 }, { 58, 11, 3, 88, 61, 27, 60, 95, 91, 100 }, { 58, 12, 11, 88, 62, 23, 61, 96, 95, 100 }, { 58, 4, 12, 88, 59, 28, 62, 92, 96, 100 }, { 63, 4, 1, 88, 65, 16, 64, 92, 89, 101 }, { 63, 12, 4, 88, 66, 28, 65, 96, 92, 101 }, { 63, 9, 12, 88, 67, 24, 66, 93, 96, 101 }, { 63, 1, 9, 88, 64, 25, 67, 89, 93, 101 }, { 43, 9, 10, 88, 44, 21, 45, 93, 94, 102 }, { 43, 10, 11, 88, 45, 22, 46, 94, 95, 102 }, { 43, 11, 12, 88, 46, 23, 47, 95, 96, 102 }, { 43, 12, 9, 88, 47, 24, 44, 96, 93, 102 }, { 43, 10, 9, 103, 45, 21, 44, 105, 104, 112 }, { 43, 11, 10, 103, 46, 22, 45, 106, 105, 112 }, { 43, 12, 11, 103, 47, 23, 46, 107, 106, 112 }, { 43, 9, 12, 103, 44, 24, 47, 104, 107, 112 }, { 68, 9, 10, 103, 70, 21, 69, 104, 105, 113 }, { 68, 10, 6, 103, 69, 30, 72, 105, 109, 113 }, { 68, 6, 5, 103, 72, 17, 71, 109, 108, 113 }, { 68, 5, 9, 103, 71, 29, 70, 108, 104, 113 }, { 73, 10, 11, 103, 75, 22, 74, 105, 106, 114 }, { 73, 11, 7, 103, 74, 31, 77, 106, 110, 114 }, { 73, 7, 6, 103, 77, 18, 76, 110, 109, 114 }, { 73, 6, 10, 103, 76, 30, 75, 109, 105, 114 }, { 78, 11, 12, 103, 80, 23, 79, 106, 107, 115 }, { 78, 7, 11, 103, 81, 31, 80, 110, 106, 115 }, { 78, 8, 7, 103, 82, 19, 81, 111, 110, 115 }, { 78, 12, 8, 103, 79, 32, 82, 107, 111, 115 }, { 83, 12, 9, 103, 85, 24, 84, 107, 104, 116 }, { 83, 8, 12, 103, 86, 32, 85, 111, 107, 116 }, { 83, 5, 8, 103, 87, 20, 86, 108, 111, 116 }, { 83, 9, 5, 103, 84, 29, 87, 104, 108, 116 }, { 38, 5, 6, 103, 39, 17, 40, 108, 109, 117 }, { 38, 6, 7, 103, 40, 18, 41, 109, 110, 117 }, { 38, 7, 8, 103, 41, 19, 42, 110, 111, 117 }, { 38, 8, 5, 103, 42, 20, 39, 111, 108, 117 }, }; // orismos shmeiwn for (int nNode = 0; nNode < nodeData.GetLength(0); nNode++) { model.NodesDictionary.Add(nNode + 1, new Node(id: nNode + 1, x: nodeData[nNode, 0], y: nodeData[nNode, 1], z: nodeData[nNode, 2])); } // orismos elements Element e1; var adinaOrder = new AdinaElementLocalNodeOrdering(); int subdomainID = Tet10ContinuumNonLinearCantilever.subdomainID; for (int nElement = 0; nElement < elementData.GetLength(0); nElement++) { DynamicMaterial DynamicMaterial = new DynamicMaterial(1, 0, 0); //Dictionary<int,Node3D > List <Node> nodeSet = new List <Node>(10); for (int j = 0; j < 10; j++) { int nodeID = elementData[nElement, j]; nodeSet.Add((Node)model.NodesDictionary[nodeID]); } var factory = new ContinuumElement3DFactory(material1, DynamicMaterial); var nodeSet1 = adinaOrder.ReorderNodes(nodeSet, CellType.Tet10); e1 = new Element() { ID = nElement + 1, ElementType = factory.CreateNonLinearElement(CellType.Tet10, nodeSet1, material1, DynamicMaterial) }; for (int j = 0; j < 10; j++) { int LocalNode = adinaOrder.GetNodeForLocalMsolveNode(j, CellType.Tet10); e1.NodesDictionary.Add(elementData[nElement, LocalNode], model.NodesDictionary[elementData[nElement, LocalNode]]); } model.ElementsDictionary.Add(e1.ID, e1); model.SubdomainsDictionary[subdomainID].Elements.Add(e1); } int[] constrainedIds = new int[] { 1, 2, 3, 4, 13, 14, 15, 16, 33, 34, 35, 36, 37 }; for (int k1 = 0; k1 < constrainedIds.Length; k1++) { int k = constrainedIds[k1]; model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationX }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationY }); model.NodesDictionary[k].Constraints.Add(new Constraint { DOF = StructuralDof.TranslationZ }); } // fortish korufhs Load load1; for (int k = 5; k < 9; k++) { load1 = new Load() { Node = model.NodesDictionary[k], DOF = StructuralDof.TranslationX, Amount = 1 * load_value }; model.Loads.Add(load1); } }