Ejemplo n.º 1
0
        private void MakeCo2FixedCads(FEWorld world)
        {
            Co2FixedCads.Clear();
            foreach (var fixedCad in FieldFixedCads)
            {
                IList <int> coIds = GetCoordIdsFromCadId(world, fixedCad.CadId, fixedCad.CadElemType);
                if (fixedCad is DistributedFieldFixedCad)
                {
                    DistributedFieldFixedCad dist = fixedCad as DistributedFieldFixedCad;
                    dist.InitCoordIds(coIds);
                }
                foreach (int coId in coIds)
                {
                    IList <FieldFixedCad> fixedCads = null;
                    if (!Co2FixedCads.ContainsKey(coId))
                    {
                        fixedCads          = new List <FieldFixedCad>();
                        Co2FixedCads[coId] = fixedCads;
                    }
                    else
                    {
                        fixedCads = Co2FixedCads[coId];
                    }
                    if (fixedCads.IndexOf(fixedCad) == -1)
                    {
                        // 同じ変数の拘束条件がすでにあるかチェック
                        {
                            IList <FieldFixedCad> sameFixedCads = new List <FieldFixedCad>();
                            foreach (FieldFixedCad tmp in fixedCads)
                            {
                                bool isSameTarget = false;
                                foreach (uint iDof in tmp.FixedDofIndexs)
                                {
                                    if (fixedCad.FixedDofIndexs.Contains(iDof))
                                    {
                                        isSameTarget = true;
                                        break;
                                    }
                                }
                                if (isSameTarget)
                                {
                                    sameFixedCads.Add(tmp);
                                }
                            }
                            if (sameFixedCads.Count > 0)
                            {
                                foreach (FieldFixedCad tmp in sameFixedCads)
                                {
                                    fixedCads.Remove(tmp);
                                }
                            }
                        }

                        fixedCads.Add(fixedCad);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void Copy(FieldFixedCad src)
        {
            base.Copy(src);

            DistributedFieldFixedCad srcDist = src as DistributedFieldFixedCad;

            CoIds         = new List <int>(srcDist.CoIds);
            DoubleValuess = new List <double[]>();
            foreach (double[] srcValues in srcDist.DoubleValuess)
            {
                double[] values = new double[srcValues.Length];
                srcValues.CopyTo(values, 0);
                DoubleValuess.Add(values);
            }
            ComplexValuess = new List <System.Numerics.Complex[]>();
            foreach (System.Numerics.Complex[] srcValues in srcDist.ComplexValuess)
            {
                System.Numerics.Complex[] values = new System.Numerics.Complex[srcValues.Length];
                srcValues.CopyTo(values, 0);
                ComplexValuess.Add(values);
            }
        }