Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mesh"></param>
 /// <param name="crack"></param>
 /// <param name="magnificationOfJintegralRadius">The outer countour of the J-integral domain is defined as:
 ///     radius = magnification * sqrt(areaOfElementContainingTip). This parameter is the magnification.
 ///     It should be at least 1.5 (see "Modeling quasi-static crack growth with the extended finite element
 ///     method Part II: Numerical applications, Huang et al, 2003" page 7546). Usually values 2-3 are selected
 ///     (see Ahmed thesis, 2009).</param>
 /// <param name="auxiliaryStatesStrategy"></param>
 /// <param name="sifCalculationStrategy"></param>
 public Propagator(IMesh2D <XNode, XContinuumElement2D> mesh, double magnificationOfJintegralRadius,
                   IAuxiliaryStates auxiliaryStatesStrategy, ISIFCalculator sifCalculationStrategy,
                   ICrackGrowthDirectionLaw2D growthDirectionLaw, ICrackGrowthLengthLaw2D growthLengthLaw)
 {
     this.mesh = mesh;
     this.magnificationOfJintegralRadius = magnificationOfJintegralRadius;
     this.auxiliaryStatesStrategy        = auxiliaryStatesStrategy;
     this.sifCalculationStrategy         = sifCalculationStrategy;
     this.growthDirectionLaw             = growthDirectionLaw;
     this.growthLengthLaw = growthLengthLaw;
     this.Logger          = new PropagationLogger();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="logger">Intermediate crack propagation data that were gathered by a previous analysis and will be
        ///     enforced now.</param>
        /// <param name="actualPropagator">For asserting purposes</param>
        public FixedPropagator(PropagationLogger logger, Propagator actualPropagator = null)
        {
            this.actualPropagator = actualPropagator;
            checkPropagation      = (actualPropagator == null) ? false : true;
            this.Logger           = logger;
            for (int i = 0; i < logger.GrowthAngles.Count; ++i)
            {
                logger.InteractionIntegralsMode1.Add(0.0);
                logger.InteractionIntegralsMode2.Add(0.0);
                logger.SIFsMode1.Add(0.0);
                logger.SIFsMode2.Add(0.0);
            }

            iteration = 0;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// The file must have the number of iteration in the first line. Then in each line it must have the growth angle in the
 /// local cartesian system around the crack tip, the growth length SIF Mode I and SIF mode II of a new iteration,
 /// separated by a space. No empty lines at the end.
 /// </summary>
 /// <param name="anglesLengthsPath"></param>
 /// <returns></returns>
 private PropagationLogger ReadFromFile(string anglesLengthsPath)
 {
     using (var reader = new StreamReader(anglesLengthsPath))
     {
         var logger        = new PropagationLogger();
         int numIterations = int.Parse(reader.ReadLine());
         for (int i = 0; i < numIterations; ++i)
         {
             string[] words = reader.ReadLine().Split(' ');
             if (words.Length != 4)
             {
                 throw new IOException("Each line must have the growth angle, growth length,"
                                       + " SIF Mode I and SIF Mode II of an iteration, separated by a space");
             }
             logger.GrowthAngles.Add(double.Parse(words[0]));
             logger.GrowthLengths.Add(double.Parse(words[1]));
             logger.SIFsMode1.Add(double.Parse(words[2]));
             logger.SIFsMode2.Add(double.Parse(words[3]));
         }
         return(logger);
     }
 }