コード例 #1
0
        private void ApplyEnrichmentFunctions()
        {
            foreach (var node in crackTipNodesNew)
            {
                double[] enrichmentValues = CrackTipEnrichments.EvaluateFunctionsAt(node);
                node.EnrichmentItems[CrackTipEnrichments] = enrichmentValues;
            }

            // There is no need to process each mesh node. Once a node is enriched with Heaviside it will stay that way until the
            // end. Even if the crack curves towards itself and a crack tip comes near the node, the original discontinuity must
            // be represented by the original Heaviside (this case creates a lot of problems and cannot be modeled with LSM
            // accurately anyway).
            // I am not sure if the value of the Heaviside enrichment doesn't change for elements around the crack tip, once the
            // crack propagates. In first order LSM this is improbable, since there cannot be kinks inside the element, but what
            // about explicit cracks and higher order LSM?
            //TODO: It could be sped up by only updating the Heaviside enrichments of nodes that have updated body
            //      level sets, which requires tracking them.
            //      - Done. Tracking newly enriched nodes is useful for many reasons.
            //TODO: should I also clear and reapply all Heaviside enrichments? It is safer and might be useful for e.g.
            //      reanalysis. Certainly I must not clear all node enrichments, as they may include material interfaces etc.
            //      - Ans: nope in reanalysis old Heaviside enrichments are assumed to stay the same (not sure if that is correct
            //          though)
            foreach (var node in crackBodyNodesNew)
            {
                double[] enrichmentValues = CrackBodyEnrichment.EvaluateFunctionsAt(node);
                node.EnrichmentItems[CrackBodyEnrichment] = enrichmentValues;
            }
        }
コード例 #2
0
        private void ApplyEnrichmentFunctions(HashSet <XNode> bodyNodes, HashSet <XNode> tipNodes)
        {
            // O(n) operation. TODO: This could be sped up by tracking the tip enriched nodes of each step.
            foreach (var node in Mesh.Nodes)
            {
                node.EnrichmentItems.Remove(CrackTipEnrichments);
            }
            foreach (var node in tipNodes)
            {
                double[] enrichmentValues = CrackTipEnrichments.EvaluateFunctionsAt(node);
                node.EnrichmentItems[CrackTipEnrichments] = enrichmentValues;
            }

            // Heaviside enrichment is never removed (unless the crack curves towards itself, but that creates a lot of
            // problems and cannot be modeled with LSM accurately). Thus there is no need to process each mesh node.
            // TODO: It could be sped up by only updating the Heaviside enrichments of nodes that have updated body
            // level sets, which requires tracking them.
            foreach (var node in bodyNodes)
            {
                double[] enrichmentValues = CrackBodyEnrichment.EvaluateFunctionsAt(node);
                node.EnrichmentItems[CrackBodyEnrichment] = enrichmentValues;
            }
        }