Beispiel #1
0
 public ContinuumElement2DFactory(double commonThickness, IContinuumMaterial2D commonMaterial,
                                  IDynamicMaterial commonDynamicProperties)
 {
     this.commonThickness         = commonThickness;
     this.commonMaterial          = commonMaterial;
     this.commonDynamicProperties = commonDynamicProperties;
 }
Beispiel #2
0
        public ContinuumElement3DNonLinear(IReadOnlyList <Node> nodes, IIsoparametricInterpolation3D interpolation,
                                           IQuadrature3D quadratureForStiffness, IQuadrature3D quadratureForMass,
                                           IGaussPointExtrapolation3D gaussPointExtrapolation,
                                           IContinuumMaterial3D material, IDynamicMaterial dynamicProperties)
        {
            this.dynamicProperties           = dynamicProperties;
            this.Interpolation               = interpolation;
            this.QuadratureForConsistentMass = quadratureForMass;
            this.nGaussPoints           = quadratureForStiffness.IntegrationPoints.Count;
            this.QuadratureForStiffness = quadratureForStiffness;
            this.Nodes = nodes;

            materialsAtGaussPoints = new IContinuumMaterial3D[nGaussPoints];
            for (int i = 0; i < nGaussPoints; i++)
            {
                materialsAtGaussPoints[i] = (IContinuumMaterial3D)material.Clone();
            }

            dofTypes = new IDofType[nodes.Count][];
            for (int i = 0; i < nodes.Count; i++)
            {
                dofTypes[i] = new IDofType[]
                {
                    StructuralDof.TranslationX, StructuralDof.TranslationY, StructuralDof.TranslationZ
                };
            }
        }
Beispiel #3
0
 public ContinuumElement3DNonLinearDefGradFactory(IContinuumMaterial3DDefGrad commonMaterial, IDynamicMaterial commonDynamicProperties,
                                                  double lambdag)
 {
     this.commonDynamicProperties = commonDynamicProperties;
     this.commonMaterial          = commonMaterial;
     this.lambdag = lambdag;
 }
Beispiel #4
0
        public ContinuumElement3D(IReadOnlyList <Node> nodes, IIsoparametricInterpolation3D interpolation,
                                  IQuadrature3D quadratureForStiffness, IQuadrature3D quadratureForMass,
                                  IGaussPointExtrapolation3D gaussPointExtrapolation,
                                  IReadOnlyList <IContinuumMaterial3D> materialsAtGaussPoints, IDynamicMaterial dynamicProperties)
        {
            this.dynamicProperties       = dynamicProperties;
            this.materialsAtGaussPoints  = materialsAtGaussPoints;
            this.GaussPointExtrapolation = gaussPointExtrapolation;
            this.Nodes         = nodes;
            this.Interpolation = interpolation;
            this.QuadratureForConsistentMass = quadratureForMass;
            //this.nGaussPoints = quadratureForStiffness.IntegrationPoints.Count;
            this.QuadratureForStiffness = quadratureForStiffness;

            //materialsAtGaussPoints = new IContinuumMaterial3D[nGaussPoints];
            //for (int i = 0; i < nGaussPoints; i++)
            //	materialsAtGaussPoints[i] = (IContinuumMaterial3D)material.Clone();

            dofTypes = new IDofType[nodes.Count][];
            for (int i = 0; i < nodes.Count; i++)
            {
                dofTypes[i] = new IDofType[]
                {
                    StructuralDof.TranslationX, StructuralDof.TranslationY, StructuralDof.TranslationZ
                };
            }

            strainsVec = new double[materialsAtGaussPoints.Count][];
            strainsVecLastConverged = new double[materialsAtGaussPoints.Count][];
            for (int gpoint = 0; gpoint < materialsAtGaussPoints.Count; gpoint++)
            {
                strainsVec[gpoint] = new double[6];
                strainsVecLastConverged[gpoint] = new double[6];
            }
        }
 public ComsolMeshReader1(string filename, double C1, double C2, IDynamicMaterial commonDynamicProperties, double lambdag)
 {
     Filename = filename;
     this.C1  = C1;
     this.C2  = C2;
     CommonDynamicProperties = commonDynamicProperties;
     this.lambdag            = lambdag;
 }
 public ComsolMeshReader1(string filename, double C1, double C2, double k_cons, IDynamicMaterial commonDynamicProperties)
 {
     Filename                = filename;
     this.C1                 = C1;
     this.C2                 = C2;
     this.k_cons             = k_cons;
     CommonDynamicProperties = commonDynamicProperties;
 }
Beispiel #7
0
        public ContinuumElement2D CreateElement(CellType cellType, IReadOnlyList <Node> nodes, double thickness,
                                                IContinuumMaterial2D material, IDynamicMaterial dynamicProperties)
        {
            int numGPs = integrationsForStiffness[cellType].IntegrationPoints.Count;
            var materialsAtGaussPoints = new IContinuumMaterial2D[numGPs];

            for (int gp = 0; gp < numGPs; ++gp)
            {
                materialsAtGaussPoints[gp] = (IContinuumMaterial2D)material.Clone();
            }
            return(CreateElement(cellType, nodes, thickness, materialsAtGaussPoints, dynamicProperties));
        }
Beispiel #8
0
        public ContinuumElement2D(double thickness, IReadOnlyList <Node> nodes, IIsoparametricInterpolation2D interpolation,
                                  IQuadrature2D quadratureForStiffness, IQuadrature2D quadratureForConsistentMass,
                                  IGaussPointExtrapolation2D gaussPointExtrapolation,
                                  IReadOnlyList <IContinuumMaterial2D> materialsAtGaussPoints, IDynamicMaterial dynamicProperties)
        {
            this.dynamicProperties       = dynamicProperties;
            this.materialsAtGaussPoints  = materialsAtGaussPoints;
            this.GaussPointExtrapolation = gaussPointExtrapolation;
            this.Nodes         = nodes;
            this.Interpolation = interpolation;
            this.QuadratureForConsistentMass = quadratureForConsistentMass;
            this.QuadratureForStiffness      = quadratureForStiffness;
            this.Thickness = thickness;

            dofTypes = new IDofType[nodes.Count][];
            for (int i = 0; i < nodes.Count; ++i)
            {
                dofTypes[i] = new IDofType[] { StructuralDof.TranslationX, StructuralDof.TranslationY };
            }
        }
Beispiel #9
0
        private static Tuple <Model, IModelReader> CreateModel3(double C1, double C2, IDynamicMaterial commonDynamicMaterialProperties, double b, double[] l, double lambdag)
        {
            double poissonV    = 0.2;
            double muLame      = 2 * C1;
            double bulkModulus = 2 * muLame * (1 + poissonV) / (3 * (1 - 2 * poissonV));
            string filename    = Path.Combine(Directory.GetCurrentDirectory(), "InputFiles", "TumorGrowthModel", "9hexa.mphtxt");
            var    modelReader = new ComsolMeshReader1(filename, C1, C2, 1, commonDynamicMaterialProperties, lambdag);
            Model  model       = modelReader.CreateModelFromFile();
            //Boundary Conditions
            var lx = l[0];
            var ly = l[1];
            var lz = l[2];
            var distributedLoad = new DistributedLoad(lx, ly, lz);
            //var flux2 = new FluxLoad(f2);
            //var dir1 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b1);
            //});
            //var dir2 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b2);
            //});
            //var weakDirichlet1 = new WeakDirichlet(dir1, k);
            //var weakDirichlet2 = new WeakDirichlet(dir2, k);

            //var dirichletFactory1 = new SurfaceLoadElementFactory(weakDirichlet1);
            //var dirichletFactory2 = new SurfaceLoadElementFactory(weakDirichlet2);
            var distributedLoadFactory = new SurfaceLoadElementFactory(distributedLoad);

            //var fluxFactory2 = new SurfaceLoadElementFactory(flux2);
            //var boundaryFactory3D = new SurfaceBoundaryFactory3D(0,
            //    new ConvectionDiffusionMaterial(k, new double[] { 0, 0, 0 }, 0));


            int[] boundaryIDs = new int[] { 0, 5 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationX
                        });
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationY
                        });
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationZ
                        });
                    }
                }
            }
            return(new Tuple <Model, IModelReader>(model, modelReader));
        }
Beispiel #10
0
        private static Tuple <Model, IModelReader> CreateModel1(double C1, double C2, IDynamicMaterial commonDynamicMaterialProperties, double b, double[] l, double lambdag)
        {
            double poissonV    = 0.45;
            double muLame      = 2 * C1;
            double bulkModulus = 2 * muLame * (1 + poissonV) / (3 * (1 - 2 * poissonV));
            string filename    = Path.Combine(Directory.GetCurrentDirectory(), "InputFiles", "TumorGrowthModel", "125HexaHyperelasticCube.mphtxt");
            var    modelReader = new ComsolMeshReader1(filename, C1, C2, 1, commonDynamicMaterialProperties, lambdag);
            Model  model       = modelReader.CreateModelFromFile();
            //Boundary Conditions
            var lx = l[0];
            var ly = l[1];
            var lz = l[2];
            var distributedLoad = new DistributedLoad(lx, ly, lz);
            //var flux2 = new FluxLoad(f2);
            //var dir1 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b1);
            //});
            //var dir2 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b2);
            //});
            //var weakDirichlet1 = new WeakDirichlet(dir1, k);
            //var weakDirichlet2 = new WeakDirichlet(dir2, k);

            //var dirichletFactory1 = new SurfaceLoadElementFactory(weakDirichlet1);
            //var dirichletFactory2 = new SurfaceLoadElementFactory(weakDirichlet2);
            var distributedLoadFactory = new SurfaceLoadElementFactory(distributedLoad);

            //var fluxFactory2 = new SurfaceLoadElementFactory(flux2);
            //var boundaryFactory3D = new SurfaceBoundaryFactory3D(0,
            //    new ConvectionDiffusionMaterial(k, new double[] { 0, 0, 0 }, 0));


            int[] boundaryIDs = new int[] { 0 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationX
                        });
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationY
                        //});
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationZ
                        //});
                    }
                }
            }
            boundaryIDs = new int[] { 1 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationX
                        //});
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationY
                        });
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationZ
                        //});
                    }
                }
            }
            boundaryIDs = new int[] { 2 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationX
                        //});
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationY
                        //});
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationZ
                        });
                    }
                }
            }
            boundaryIDs = new int[] { 3 };
            int QuadID = model.ElementsDictionary.Count + 1;

            //foreach (int boundaryID in boundaryIDs)
            //{
            //    foreach (IReadOnlyList<Node> nodes in modelReader.quadBoundaries[boundaryID])
            //    {
            //        //var distributedLoadElement = distributedLoadFactory.CreateElement(CellType.Quad4, nodes);
            //        //model.SurfaceLoads.Add(distributedLoadElement);
            //        //var dirichletElement2 = dirichletFactory2.CreateElement(CellType.Quad4, nodes);
            //        //model.SurfaceLoads.Add(dirichletElement2);
            //        //var SurfaceBoundaryElement = boundaryFactory3D.CreateElement(CellType.Quad4, nodes);
            //        //var element = new Element();
            //        //element.ID = QuadID;
            //        //element.ElementType = SurfaceBoundaryElement;
            //        //model.SubdomainsDictionary[0].Elements.Add(element);
            //        //model.ElementsDictionary.Add(QuadID, element);
            //        //foreach (Node node in nodes)
            //        //{
            //        //    element.AddNode(node);
            //        //}
            //        //QuadID += 1;
            //        foreach (Node node in nodes)
            //        {
            //            model.Loads.Add(new Load() { Node = node, DOF = StructuralDof.TranslationZ, Amount = +100.0 });
            //        }
            //    }
            //}
            int[] nodeIDs = new int[] { 0, 5, 10, 40 };
            foreach (int nodeID in nodeIDs)
            {
                model.Loads.Add(new Load()
                {
                    Node = model.NodesDictionary[nodeID], DOF = StructuralDof.TranslationZ, Amount = +250.0
                });
            }
            return(new Tuple <Model, IModelReader>(model, modelReader));
        }
        private static Tuple <Model, IModelReader> CreateStructuralModel(double C1, double C2, IDynamicMaterial commonDynamicMaterialProperties, double b, double[] l)
        {
            string filename    = Path.Combine(Directory.GetCurrentDirectory(), "InputFiles", "TumorGrowthModel", "9hexa.mphtxt");
            var    modelReader = new ComsolMeshReader1(filename, C1, C2, 1, commonDynamicMaterialProperties);
            Model  model       = modelReader.CreateModelFromFile();
            //Boundary Conditions
            var lx = l[0];
            var ly = l[1];
            var lz = l[2];
            var distributedLoad = new DistributedLoad(lx, ly, lz);
            //var flux2 = new FluxLoad(f2);
            //var dir1 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b1);
            //});
            //var dir2 = new DirichletDistribution(list => {
            //    return Vector.CreateWithValue(list.Count, b2);
            //});
            //var weakDirichlet1 = new WeakDirichlet(dir1, k);
            //var weakDirichlet2 = new WeakDirichlet(dir2, k);

            //var dirichletFactory1 = new SurfaceLoadElementFactory(weakDirichlet1);
            //var dirichletFactory2 = new SurfaceLoadElementFactory(weakDirichlet2);
            var distributedLoadFactory = new SurfaceLoadElementFactory(distributedLoad);

            //var fluxFactory2 = new SurfaceLoadElementFactory(flux2);
            //var boundaryFactory3D = new SurfaceBoundaryFactory3D(0,
            //    new ConvectionDiffusionMaterial(k, new double[] { 0, 0, 0 }, 0));


            int[] boundaryIDs = new int[] { 0, };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationX
                        });
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationY
                        });
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationZ
                        });
                    }
                }
            }
            boundaryIDs = new int[] { 5 };
            int QuadID = model.ElementsDictionary.Count + 1;

            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    var distributedLoadElement = distributedLoadFactory.CreateElement(CellType.Quad4, nodes);
                    model.SurfaceLoads.Add(distributedLoadElement);
                    //var dirichletElement2 = dirichletFactory2.CreateElement(CellType.Quad4, nodes);
                    //model.SurfaceLoads.Add(dirichletElement2);
                    //var SurfaceBoundaryElement = boundaryFactory3D.CreateElement(CellType.Quad4, nodes);
                    //var element = new Element();
                    //element.ID = QuadID;
                    //element.ElementType = SurfaceBoundaryElement;
                    //model.SubdomainsDictionary[0].Elements.Add(element);
                    //model.ElementsDictionary.Add(QuadID, element);
                    //foreach (Node node in nodes)
                    //{
                    //    element.AddNode(node);
                    //}
                    //QuadID += 1;
                }
            }
            return(new Tuple <Model, IModelReader>(model, modelReader));
        }
Beispiel #12
0
        internal static int DefineContinuumElement3DNonLinearDefGrad(Model model, IContinuumMaterial3DDefGrad 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 ContinuumElement3DNonLinearDefGradFactory(material3D, dynamicMaterial, lambdag);

            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 ContinuumElement3D CreateElement(CellType cellType, IReadOnlyList <Node> nodes,
                                                 IContinuumMaterial3D commonMaterial, IDynamicMaterial commonDynamicProperties)
        {
            int numGPs = integrationsForStiffness[cellType].IntegrationPoints.Count;
            var materialsAtGaussPoints = new IContinuumMaterial3D[numGPs];

            for (int gp = 0; gp < numGPs; ++gp)
            {
                materialsAtGaussPoints[gp] = (IContinuumMaterial3D)commonMaterial.Clone();
            }
            return(CreateElement(cellType, nodes, materialsAtGaussPoints, commonDynamicProperties));
        }
 public ContinuumElement3DFactory(IContinuumMaterial3D commonMaterial, IDynamicMaterial commonDynamicProperties)
 {
     this.commonDynamicProperties = commonDynamicProperties;
     this.commonMaterial          = commonMaterial;
 }
Beispiel #15
0
        private ContinuumElement3DNonLinearDefGrad CreateElement(CellType cellType, IReadOnlyList <Node> nodes,
                                                                 IContinuumMaterial3DDefGrad material, IDynamicMaterial commonDynamicProperties)
        {
            int numGPs = integrationsForStiffness[cellType].IntegrationPoints.Count;
            var materialsAtGaussPoints = new IContinuumMaterial3DDefGrad[numGPs];

            for (int gp = 0; gp < numGPs; ++gp)
            {
                materialsAtGaussPoints[gp] = (IContinuumMaterial3DDefGrad)commonMaterial.Clone();
            }
            return(new ContinuumElement3DNonLinearDefGrad(nodes, interpolations[cellType],
                                                          integrationsForStiffness[cellType], integrationsForMass[cellType], extrapolations[cellType],
                                                          material, commonDynamicProperties, lambdag));
        }
        private static Tuple <Model, IModelReader> CreateStructuralModel(double C1, double C2, IDynamicMaterial commonDynamicMaterialProperties, double b, double[] l, double lg)
        {
            string filename    = Path.Combine(Directory.GetCurrentDirectory(), "InputFiles", "TumorGrowthModel", "9hexa.mphtxt");
            double poisonRatio = .45;
            double bulkModulus = 4 * C1 * (1 + poisonRatio) / 3 / (1 - 2 * poisonRatio);
            var    modelReader = new ComsolMeshReader1(filename, C1, C2, bulkModulus, commonDynamicMaterialProperties, lg);
            Model  model       = modelReader.CreateModelFromFile();
            //Boundary Conditions
            var lx = l[0];
            var ly = l[1];
            var lz = l[2];
            var distributedLoad        = new DistributedLoad(lx, ly, lz);
            var distributedLoadFactory = new SurfaceLoadElementFactory(distributedLoad);


            int[] boundaryIDs = new int[] { 0 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationX
                        });
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationY
                        //});
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationZ
                        //});
                    }
                }
            }
            boundaryIDs = new int[] { 1 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationX
                        //});
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationY
                        });
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationZ
                        //});
                    }
                }
            }
            boundaryIDs = new int[] { 2 };
            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationX
                        //});
                        //node.Constraints.Add(new Constraint()
                        //{
                        //    Amount = b,
                        //    DOF = StructuralDof.TranslationY
                        //});
                        node.Constraints.Add(new Constraint()
                        {
                            Amount = b,
                            DOF    = StructuralDof.TranslationZ
                        });
                    }
                }
            }
            boundaryIDs = new int[] { 5 };
            int QuadID = model.ElementsDictionary.Count + 1;

            foreach (int boundaryID in boundaryIDs)
            {
                foreach (IReadOnlyList <Node> nodes in modelReader.quadBoundaries[boundaryID])
                {
                    foreach (Node node in nodes)
                    {
                        model.Loads.Add(new Load()
                        {
                            Node = node, DOF = StructuralDof.TranslationX, Amount = +250.0
                        });
                    }

                    //var distributedLoadElement = distributedLoadFactory.CreateElement(CellType.Quad4, nodes);
                    //model.SurfaceLoads.Add(distributedLoadElement);
                }
            }
            return(new Tuple <Model, IModelReader>(model, modelReader));
        }
Beispiel #17
0
        public ContinuumElement2D CreateElement(CellType cellType, IReadOnlyList <Node> nodes, double thickness,
                                                IReadOnlyList <IContinuumMaterial2D> materialsAtGaussPoints, IDynamicMaterial dynamicProperties)
        {
            //TODO: check if nodes - interpolation and Gauss points - materials match
#if DEBUG
            interpolations[cellType].CheckElementNodes(nodes);
#endif
            return(new ContinuumElement2D(thickness, nodes, interpolations[cellType],
                                          integrationsForStiffness[cellType], integrationsForMass[cellType], extrapolations[cellType],
                                          materialsAtGaussPoints, dynamicProperties));
        }