'''General steps required to define materials with the Lagrangian cloud''' ''Pre-modification thoughts'' 1. Add flag to select between defining materials with material volume from level set functions or from the Lagrangian cloud. 2. Add material number to cloud particles defined by the initial surface geometries. Provide option for removing selected surface. Surface 1 must never be removed or divFEM will break. Should this even be an option? Should this occur in {{{nliter}}} 1 or using a separate subroutine following the surface geometry definition??? * Where should be define the material numbers on the cloud particles? Should this occur when the LSFs are defined, or upon cloud definition??? 3. At the time of elemental material definition, count number of each material from cloud in a given element. Provide option for majority rule or others (can we do divFEM with Lag particles??)??? How do we resolve issues with equal numbers of materials? Use old material number or something else??? Note that the general criterion for using the Lag cloud for material definition should check to be sure to use only completely uncut elements, not uncut subelements. * How does strain get transferred from the cloud to the elements??? 4. Take decision from count/rule above and give element new material number. For certain properties, be aware we may want to override the default from the material number using something stored on the cloud particles. The material number stored on the cloud should not be changed based on the elemental material number. However, if we want material changes available, we should be able to update those numbers. ''Potential new subroutines'' 1. {{{define_cloud_mat_number()}}}[[BR]] Use LSF values on octree to define the material number for every cloud particle. This routine should be called in the first grid iteration, after the void has been calculated. The general procedure is * Set material number equal to zero for all cloud particles * Loop through all LSFs * Loop through all cloud particles * If LSF value is negative, give cloud particle current LSF number as material number * In not, do nothing * Should surfaces that are flagged for removal be removed within this subroutine or outside of it??? Should the corresponding LSFs be removed as well, and should {{{params%ns}}} be redefined to be the original value minus the number of removed surfaces??? 2. {{{get_element_material_number_from_cloud()}}}[[BR]] This subroutine should create an array of {{{nelem}}} x {{{nmat}}} (?), fill that array with the number of cloud particles of a given material for each element and assign the element material number based on some criteria. In general, the procedure would be * Allocate an array that is {{{nelem}}} x {{{nmat}}} (or {{{nelem}}} x {{{nlsf}}}???); initialize to zero * Loop through all cloud particles * Find which element contains a given particle * Increment the material number index for the element in the 2D array created above using the cloud particle material number * After looping through all cloud particles, loop through all elements * For a given element, check associated material number distribution list * Look for index of max value * Look for 'ties'. Do a count on the value at the index found above. If that number is >1, we have a tie. * Based on the info above, make a decision on which material number should be used (Things to consider: Majority rule, how to handle ties, etc.) * Call {{{make_matrix.f90}}} using the material number from the decision ''Record of code changes by routine'' '''Dynamic refinement of the surfaces'''