A mason-inspired pattern generator for historic masonry structures using quality indexes

A considerable amount of historic masonry structures (HMS) are composed of irregular stone. However, few studies have systematically investigated the influence of masonry patterns (or masonry unit arrangements) on structural behaviour. The main difficulty stems from the pattern acquisition and the definition of adequate parameters that correlate the pattern with the structural behaviour. To this aim, this paper presents a stochastic 2D coursed-rectangular masonry pattern generator that incorporates geometric quality indexes (QI) to generate patterns with consistent masonry quality and structural behaviour. The generator ’ s input parameters separately consider the available stone units and the "virtual mason" ’ s skill level to cover the range of possible pattern qualities. Finally, micro limit analysis simulations show how deviation from the "rules of art" reduces strength capacity by up to 30%. Furthermore, it has been discussed how masonry patterns generated with selected QI-s show consistent structural behaviour, e.g. reducing the coefficient of variation of the strength capacities by 15%.


Introduction
Although fabrication procedures of masonry have evolved to reflect modern advancements [1][2][3], stone masonry remains one of the most used materials since ancient times [4].Over the centuries, a wide variety of building construction techniques have been developed for historic masonry structures (HMS) due to geographical location, raw material availability, technology development, and workers' skills.Such a variety of masonry typologies makes the systematic assessment of HMS difficult.Even referring to brick masonry, which is normally characterised by more rigorous arrangement rules, bond patterns and the number of leaves play a relevant structural role [5], [6].Referring to stonework, making regular arrangements with stone units significantly increased the complexity and cost of the building process.For this reason, ancient masons' skills were paramount in generating good-quality patterns, allocating stone units of different sizes and shapes within the wall, resulting in irregular masonry patterns (Fig. 1).One can note how stone masonry patterns, influenced by both the skills of the mason and the available stone units, significantly impact the structural response of HMS.Therefore, conducting a comprehensive investigation into the typologies of masonry patterns is particularly relevant for safeguarding our built cultural heritage [4], [7].
Given that masonry patterns affect the structural response of structural elements, their proper geometric definition is of utmost importance when the analyst deals with detailed or simplified micromodels [8][9][10][11].However, the inherent complexity of generating irregular masonry patterns has caused a lack of numerical research in this area [12].In the literature, two different approaches are found regarding the generation of irregular masonry patterns, i.e. survey of real masonry structures and virtual masonry generation algorithms.The former provides the most realistic masonry patterns, even though the actual survey of masonry patterns is costly, time-consuming and often only in the external faces, making systematic investigations difficult [13,14].On the contrary, virtual pattern generators offer a powerful and efficient method for generating masonry patterns, with a limitation regarding the complexity of identifying consistent criteria to vary the masonry pattern.In fact, only a limited number of masonry pattern generator algorithms have been proposed in the literature [15].These algorithms are based on probabilistic assumptions, with the masonry units' overall dimensions unknown and defined with certain statistical distributions.Subsequently, blocks are randomly generated and placed using an arrangement rule defined a priori in the generation algorithm, resulting in the construction of the masonry pattern.The main limitation of the available generator algorithms stems from the implementation of the unit arrangement rules.To this end, as follows, state-of-the-art generators are discussed in order to highlight their strengths and weaknesses.
Vadalà et al. [16] presented a simple 2D pattern generator algorithm that creates structural elements characterised by coursed-rectangular masonry patterns.The algorithm uses random distributions for unit lengths and masonry course heights and fills each masonry course sequentially, starting from the bottom and working upwards.Only the unit dimensions are provided as input data without considering the arrangement rule.
Mercuri et al. [17] and Angiolilli et al. [18] proposed a generator algorithm for rubble masonry patterns where the geometric input data are the particle size distribution and the stone-mortar ratio.First, particles are randomly generated, and then the units are defined by Delaunay tetrahedralization.Due to the intrinsic stochastic nature of the method, the uncertainties inherent in the mechanical properties of rubble masonry specimens can be quantified.One can note that the distribution of particles is only controlled by the particle properties, with no arrangement rule introduced in the algorithm.This approximates such highly irregular masonries well but may provide incorrect structural results given the lack of arrangement rules implemented.
Zhang et al. [19] developed a 2D masonry generator algorithm, extending the previous work of Miyata [20].Both generation algorithms can produce masonry patterns from regular to rubble bond types by first placing rectangular blocks and then splitting and distorting them to reach more irregular masonry typologies.Even in this case, the algorithm does not explicitly input unit arrangement rules.
Pereira et al. [21] proposed a generator algorithm for two-leaf masonry walls with coursed-rectangular masonry patterns.The algorithm employs a sample pattern that implicitly defines the distribution of unit sizes, where the probability of occurrence is based on the unit's surface area.Additionally, the alignment of vertical joints in subsequent courses is constrained to attain a realistic masonry pattern.
Finally, Shaqfa et al. [22] developed a 3D masonry pattern generator for multi-leaf masonry walls ranging from regular to rubble.The algorithm generates boxes with random dimensions defined by an input distribution.Hence, the boxes are placed according to a constrained packing optimisation problem, which mimics the building process of the mason accounting for multiple geometric measures (e.g.good interlocking, less travel time for the mason during construction and horizontality of laying surfaces).
It is worth underlining that even though the above generator algorithms can cover a wide range of masonry typologies, few considerations about arrangement rules have been considered.As stated in the literature [23], the quality of arrangement significantly affects the structural performance of unreinforced masonry (i.e. the constitutive material properties); thus, using virtual generators, which do not account for arrangement rules is likely to provide unreliable structural responses [7].Therefore, proper parameters such as geometric quality indexes (QI) should be included in the generation algorithms to correlate the generated masonry pattern with the structural response.In this paper, a 2D coursed-rectangular masonry pattern generator is developed incorporating arrangement rules, which are able to produce consistent masonry quality using geometric QI-s.The generated masonry patterns can be subsequently used in any detailed or simplified micro-modelling numerical approach to perform accurate structural assessments.It should be noted that the proposed generator algorithm only considers the surface (in-plane) pattern to simulate the behaviour of single-leaf walls.However, the majority of HMS are made of multi-leaf masonry walls, where the cross-section patterns considerably influence the out-of-plane behaviour.Hence, the through-the-thickness generator will be considered for future improvements of the proposed methodology.
In order to properly develop the pattern generator, three concurrent research questions have been defined: RQ1: How can the quality of a masonry pattern be characterised using the QI-s?RQ2: Are the generated masonry patterns consistent with the input parameters?RQ3: Can QI-s be considered an effective measure for assessing the structural performance of masonry structures?
The following outline traces the path to answer the above questions.Section 2 presents the functionalities and steps of the generator algorithm and defines the input parameters employed.In Section 3, the considered QI-s are presented, and their correlation with the generator input parameters is defined.Subsequently, Section 4 investigates the sensitivity of the generated masonry patterns on the input parameters.Section 5 discusses the correlation between QI-s and structural capacity  by considering different geometric and mechanic configurations and simulating them in a micro limit analysis (LA) framework.Finally, relevant conclusions are drawn in Section 6.

Masonry generator algorithm
In order to perform accurate structural assessments of existing masonry buildings, complete geometric surveys are needed.However, a complete geometric survey involving the masonry pattern can sometimes not be performed due to the high cost, particularly if the plaster covers the surface pattern.To cover this research gap, the proposed masonry pattern generator employs limited masonry pattern information to predict the masonry arrangement layout of the whole structure.Thus, It is assumed that the surveyed area, where the masonry pattern is considered, represents the whole structural element.Such an assumption could lead to erroneous interpretation in the case of i) a small surveyed area, ii) a very variable masonry pattern, iii) a pattern characterised by multiple distributions.Thus, a proper survey of the masonry pattern, with multiple survey windows, is always recommended.
Fig. 2 shows the general steps of the proposed pattern generation algorithm.First, the survey of the pattern is carried out in a limited area (STEP 1), and subsequent calculation of QI-s (STEP 2) is performed.Afterwards, the overall geometry of the masonry wall under consideration must be defined (STEP 3).Hence, random masonry patterns can be generated using the surveyed QI-s (STEP 4).Such patterns provide the basis for further structural analyses to determine its structural response.One can note that STEPs 3 and 4 can be performed without a survey to conduct a parametric analysis for statistical assessment purposes.This paper deals with the pattern generation algorithm (STEP 4), while details about the other steps can be found in the relevant literature [13], [15], [24][25][26][27].
The input parameters of the proposed generator can be separated into two groups, namely i) block parameters and ii) mason (i.e.workmanship) parameters.This discretisation also distinguishes the sources of uncertainties affecting the construction process of a masonry structure.Therefore, the block parameters consist of the block height (h b ) and aspect ratio (β b ), given by a statistical distribution defined by the available stone units.The mason parameters are the overlap factor (v min ) and block set length (|B|), which consider the skillfulness of the mason and the unit arrangement rule.These four input parameters, detailed in the next two sections, provide a random arrangement of blocks with a consistent masonry quality and, consequently, structural behaviour.

Block parameters
The block parameters define the available stone units on the construction site and do not affect the assembly rule of the structure.The blocks are defined from rectangular units, characterised by the block height (h b ), length (w b ), and aspect ratio (β b ) given by h b /w b .Within the generator algorithm, the block parameters' values for each block are sampled from a normal distribution defined by a mean (μ X ) and standard deviation (σ X ) (Fig. 3).
The choice of a normal distribution has been supported by the assumption that the dimensions of the stone units comply with the central limit theorem [28][29][30], given the stones are randomly selected from the quarry.While this assumption may not be true for all masonry types, in the lack of region or structure-specific surveys, the use of a normal distribution seems to be the best assumption.It should be noted that the w b is a function of both the height and aspect ratio, which results in more consistent masonry quality compared to the unit length being an independent parameter.This is due to the high influence of the aspect ratio on the overlapping between adjacent blocks.Such an assumption is also supported by the findings of Milani et al. [31], who show that the distribution of block heights is relatively symmetric, close to a normal distribution, while the block length distribution is skewed to the left.While the observations in [31] only refer to a case study, similar distributions were surveyed by the authors on other masonry prototypes, as will be presented in Section 4.2.If a normal distribution defines the block height and aspect ratio, the resulting block length distribution is skewed and reflects well with the above-mentioned experimental observations.

Mason parameters
Mason parameters' role is to account for the assembly rule.They can calibrate the level of skillfulness of the "virtual mason" and have no effect on the distribution of block dimensions.The first parameter is the block set length (|B|), which defines the number of possible blocks that the mason can consider for each placement (Fig. 4a).The second parameter is the overlap factor (v min ), which defines the relevance given to staggered vertical joints.Hence, a fitness criterion is defined by an objective function O(h,β), which gives preference to higher overlapping (defined by the distance between the vertical joint of the current block and the course below) between blocks: Here, the subscript j denotes the current block and C i− 1 represents a list of the previous course of units, x and w being their horizontal position and length, respectively, and v min ranges from 0 (no consideration to overlapping) to 0.5 (i.e.preference to the maximum 50% overlap between the blocks).The function expressed in Eq. ( 2) is graphically represented in Fig. 4b.One can note how it takes a value of 1.0 around the vertical joints and linearly decreases to zero.If multiple possible aspect ratios attain the same objective function value, the one with the smaller index in B is placed in the wall, i.e. the closest to the virtual mason.It should be argued that the choice on the value of |B| is very influential on the generated masonry pattern.If |B| is small, the mason has little choice of blocks, so the assembly rule tends to have less significance, while if |B| is set to greater values, the pattern tends to a regular bond, providing the best possible interlocking.In order to better address the earlier mentioned consideration regarding the mason parameters, the generator sensitivity is further discussed in Section 4.

Masonry pattern generator: algorithm description
The masonry pattern generator makes arrangements of units, progressing course by course from the bottom up, and adding one block at a time, moving from left to right.The algorithm decides which block should be placed in the wall for each block placement.The "virtual mason" is characterised by a memory, i.e. the number of consecutive available units it can consider (|B|), and attention to select the most fitting block in a particular position (v min ).When the virtual mason places a block into the wall, the same is removed from his memory, and a new random unit becomes available.In the following, the masonry pattern generator workflow is presented: • Step 1. Generation of a set of course heights, sampled from the input distribution N h (μ, σ) until the sum reaches the predefined wall height (H w ).
• Step 2. Generation of a set of aspect ratios, sampled from the input distribution, N β (μ, σ) with length n = |B|.
Calculate the aspect ratio (β * i,j ) that minimises the objective function O(h, β) and place the next block, having dimensions etc., is represented by an object with its associated properties (block dimensions, contact friction coefficient, QI value, etc.) and behaviour (creating and modifying the pattern).The implementation follows the builder design pattern because the definition of the masonry pattern requires multiple steps and configurations, thus, its straightforward creation would be convoluted.The WallBuilder object is responsible for creating the block layout of the masonry pattern.It requires the Wall-Geometry and PatternProperty objects, which define the masonry specimen's boundaries (and openings) and the pattern properties (block and mason parameters).Across the implementation, several static utility classes have been used to encapsulate the processing and the creation of auxiliary pattern properties.For example, to calculate the interfaces in the block layout, the InterfaceSearch utility class is called by the Wall-Builder object, which returns the contact interfaces in a sorted list.Finally, the block layout and interfaces are extracted to a separate MasonryPattern object.If required, the MasonryPattern can call a utility class to calculate the masonry quality indexes.Finally, the pattern information can be called by other methods in the same JAVA environment (for example, for structural analysis, as presented in Chapter 5) or parsed and exported to several different file formats (.csv,.dxf,etc.), which can be subsequently imported or read by any block-based structural analysis numerical tool to conduct advanced simulations of masonry structures.In Fig. 6, further functionalities of the generator implementation are presented, namely i) the boundary of the masonry specimen can be defined by a set of rectangles, ii) openings (with or without lintel) of any dimension can be placed anywhere in the geometry, iii) different pattern and material parameter regions can be defined on the geometry, influencing the generated masonry pattern characteristics, iv) quoin stones with predefined lengths can be defined at the wall ends (and around openings), and v) custom blocks can be added into an irregular masonry pattern.
In order to perform the pattern generations reported in this paper, the developed algorithm was run on an Intel(R) Core(TM) i7-6700HQ 2 ), where n b is the number of units in the masonry wall.Generating a pattern with 2000 units takes approximately 2.90 s, and the calculation of its QI-s requires 0.5 s (Fig. 7).However, runtimes may vary due to JAVA's Just-in-Time (JIT) compiler, which optimises frequently used code; thus, after some iterations, the same code takes less time to run on the same machine,  reducing the time cost of parametric analysis.

Correlation with geometric indexes
As mentioned in the previous section, the present algorithm's main aim is to generate random masonry patterns having consistent masonry quality, which is representative of the structural behaviour.Several studies attempted to quantify the quality of masonry by geometric indexes, by measuring the deviations from the good building practices ("rules of art").QI-s have been proposed for the surface and cross-section pattern, both individually [12], [32][33][34][35][36][37][38] and combined into a system [15], [27], since it has been seen that a single QI is insufficient to characterise a masonry pattern.Several studies found a good correlation between the Masonry Quality Index (MQI) framework proposed by Borri et al. [27] and the mechanical properties of masonry [39], other studies show a lack of relationship [40].This might be due to the the significant interactions among QI-s, which is disregarded in the framework of MQI.Furthermore, no consensus has been made on the optimal set of QI-s to use.For additional information on the different QI-s in the literature, the reader can refer to Szabó et al. [7].

Possible geometric indexes
Based on the state-of-the-art [7], five possible indexes have been selected to be considered in this study: The block area is defined simply as A b = h 2 b /β b , while the block aspect ratio has been defined above, and the lines of minimum traces are given by: where p = [p 1 , p 2 , .pn ] represents the shortest length polyline between p start and p end , which are the middle points of the top and bottom of the wall for M v l (Fig. 8b), and the two opposite corners for M d l (Fig. 8c).Instead, M URUR l is defined as the structured path UP-RIGHT-UP-RIGHT (Fig. 8d), according to Funari et al. [23].It is obvious from their definitions that A b and β b are correlated with the input parameters of the generator with simple relations.On the other hand, the correlation of the line measures requires further investigation.It should also be noted that many of the quality indexes in the literature reduce to a constant value in the case of coursed rectangular masonry patterns.More complex masonry patterns without defined horizontal courses, e.g.polygonal units, require further elaboration of the considered geometric indexes, such as in [7], [15], [27].
A parametric study has been conducted on 4.00 × 4.00 m 2 wall specimens (Fig. 19a 9 shows the ranges (incorporating different height and aspect ratio dispersion levels CV X = {5%, 10%, 15%}) for the three line measures as a function of the overlap parameter (v min ) and mean aspect ratio (μ β ).M v l has shown dependence in both the block and mason parameters; thus, it is considered adequate for the generator algorithm (Fig. 9a).The results indicated that the value of M d l is not substantially affected by changes in pattern parameters (Fig. 9b).However, it is anticipated that M d l will become significant when considering nonrectangular units, as the length of the diagonal polyline is influenced  by the inclination of the block edges.Instead, the value of M URUR l depends on the block parameters, though the mason parameters do not significantly influence it; thus, it is only a characteristic of the available stone units (Fig. 9c).In order to reduce the number of considered QI-s, only the vertical line of minimum trace (M v l ) has been considered in the following.

Vertical line of minimum trace
The vertical line of minimum trace of regular, running, bond masonry patterns can be easily determined as a function of the units' aspect ratio: In the case of irregular masonry patterns, without an arrangement rule (random placement of blocks), it can be assumed that the overlap between two units of adjacent courses is characterised by a homogenous symmetric distribution between 0 and the half-length of the unit (μ h /2μ β ).Thus, the vertical line of the minimum trace can be computed simply by the average value: For a given mean aspect ratio (μ β ), Eq. ( 8) can be considered as the lower bound (blue line in Fig. 10a) and Eq (7) can be considered as the upper bound (red line in Fig. 10a) for the vertical line of minimum trace because they correspond to a random placement and "perfect" workmanship, respectively.The interlocking increment (δM v l ) is defined as the difference between a pattern's vertical line of minimum trace and the random block placement, as presented by the hatched area in Fig. 10a.For a given μ β , the maximum interlocking increment of the running bond pattern can be computed as: It has been observed that for any coursed-rectangular irregular masonry pattern, the scaled reduction of the vertical line of minimum trace (ΔM v l ) is invariant with respect to the aspect ratio and only a function of the dispersion of the aspect ratio (given by the coefficient of variation CV β ) and the overlap parameter (v min ), and is given by: The scaled reduction of the vertical line of minimum trace defines where a masonry pattern lies in the range between M v l,0 (ΔM v l = 1.0) and M v l,RUN (ΔM v l = 0.0).This relationship enables one to decompose the line of minimum trace into two parts, analogously to the input parameters, where the first part is defined by the dimensions of the available stone units, and the second part considers the arrangement rule of the blocks, as: M v l,0 (μ β ) considers the base value of the line of minimum trace provided by the mean aspect ratio according to Eq. ( 7), while δM v l,RUN defines the mean aspect ratio's capacity to be influenced by the arrangement rule.ΔM v l considers the irregularity and arrangement rule of the pattern independent of the aspect ratio.Values of ΔM v l for different levels of aspect ratio scatter and overlap parameters are reported in Fig. 10b.If one considers the coefficient of variation of the aspect ratio lower than 10%, the line of minimum trace drops continuously, whereas between 10% and 25% moderate changes occur, and from 25% to 40% the line of minimum trace increases back to the value corresponding to a regular pattern.These results are also very sensitive to the overlap parameter values.Higher overlap parameter values generally decrease the reduction in the line of minimum trace, so for v min = 0.5 the maximum reduction of the interlocking increment is only 40%, compared to more than 100% reduction in the case of v min = 0.0.One can note that at low aspect ratio scatter levels, the overlap parameter cannot significantly influence the line of minimum trace, while starting from 10% aspect ratio coefficient of variation, it has a quasi-constant, considerable effect.
Considering a relatively wide range of interest of CV β = 5 − 30%, the value of the interlocking increment δM v l (v min ) can be approximated with the multiple linear regression model given in Eq. ( 12).The results of Fig. 9a are presented in Fig. 11 to validate the equation; the mean values and scatters are shown by the dotted lines and shaded regions, respectively, while the solid line shows the equation.
Eq. ( 12) defines an approximation of the interlocking increment, disregarding the small negative effects of higher CV h values.The increase rate of δM v l (v min ) is steeper at low values and becomes progressively flatter at high values of v min .This underlines the fact that even small considerations on the interlocking can change the line of minimum trace significantly, while the differences between more skilled masons are less prevalent.Furthermore, the value of the interlocking increment is also influenced by the scatter of the aspect ratio (CV β ) and its average (μ β ).As CV β increases, the mason has a greater selection of unit shapes, thus the arrangement rule becomes more and more significant.Furthermore, Fig. 11 shows that the scatter of generated results stays relatively constant at different levels of v min , higher values corresponding to increasing CV β and decreasing μ β .A simple regression model can be again defined, which provides a good approximation of the scatter: (13) This scatter provides the algorithm's ability to generate masonry patterns with a consistent line of minimum trace.
The interlocking increment (δM l v ), compared to the random placement of units given by m v l represents the importance of the mason's skillfulness: If m v l = 0, the mason's skillfulness has no importance because the quality of the masonry pattern is provided by the stone stock distribution, while in the case of m v l ≫0 the mason's skillfulness is increasingly influential and needs to be determined with additional surveying for the assessment of the masonry pattern quality.In Fig. 12, the values of m v l for v min = 0.5 are presented for different aspect ratio distributions.It is shown that depending on the stone stock distribution, an increase between 2% and 24% is achieved if a good masonry arrangement rule is employed.
Finally, the fact that δM v l (v min ) is not significantly influenced by the block height distribution can be attributed to the fact that the line of minimum trace is normalised to the wall height, so in case of a sufficient number of courses are measured, it is not significantly dependent on the block height distribution.

Sensitivity of input parameters
In order to understand the input parameter sensitivity of the proposed masonry pattern generator, a parametric study is conducted in this section.

Comparison with generated masonry structures
At first, the block parameters' distribution is investigated.Fig. 13 shows that the block heights and aspect ratios are distributed randomly across the wall.For a quantitative analysis, 9 block parameter combinations are tested on a 4.00 × 4.00 m 2 panel by considering three levels for both the mean and the coefficient of variation of the input parameters, and 50 masonry patterns are generated for each set.The generated distributions are subsequently compared with the input distributions.
Fig. 14 shows the cumulative probability distribution (CDP) plots of the block heights for various block height distributions, while the aspect ratio distribution is kept constant (μ β = 0.8,CV β = 15%).The red curves represent the input distributions, and the grey areas indicate the range of deviations observed between 50 generated samples, and the dark grey dashed lines show the average of the generated results.The analysis reveals an excellent agreement between the input and generated data, with slight deviations observed for different input values.Specifically, at high values of CV h = σ h /μ h , the generated results are more scattered, and the distributions tend to shift to the left, which results in the generation of units with smaller heights.It is because the unit heights are sampled for an entire course at once, while a course with a smaller height will require more blocks to be filled compared to a taller course, thus generating a shift of the CDP to the left.
Additionally, higher values of μ h result in fewer blocks being placed in the pattern, thereby increasing the potential for higher deviations between the generated distributions.Indeed, while the means correlate very well with the input distribution, the scatter of results tends to increase with μ h .Besides these small deviations, a good agreement between the input and the generated results is shown.Similar to what has been shown before, Fig. 15 shows the distributions of block aspect ratios for different values of input parameters, keeping the block height distribution constant (μ h = 200mm, CV h = 15%).The generated distributions correspond well with the input distributions.However, at low values of the CV β , an overrepresentation of slender blocks can be observed.This is because the last unit of each course has to be cut to confine the geometry of the wall.While in the case of large CV β , this does not result in blocks outside of the input distribution range, if CV β is small, units sometimes have to be cut smaller, thus generating aspect ratios higher than the input range.Fig. 16 presents the effect of the mason parameters on the vertical line of minimum trace (M v l ), which is represented by the average and ± one standard deviation value for various aspect ratio distributions.
The height distributions are not tested due to their small influence on the line of minimum trace (see Section 3).One can note how if |B| = 1, ν min does not affect the results, while when |B| increases, the line of minimum trace converge to a higher value if ν min ∕ = 0.Such outcomes demonstrate how if one wants to generate specific masonry arrangement quality effectively, |B| should not be chosen too small.On the other hand, greater values of |B| would result in lower computational performance of the generator.For the above-mentioned motivations, |B| = 5 − 10 is recommended (it is also a value that reasonably reflects the actual memory of masons [41]), and thus 10 is adopted as follows in this paper.

Comparison with real masonry structures
Two real masonry patterns from historic Portuguese buildings have been analysed to assess the correctness of the assumptions and equations presented in Sections 2 and 3. A portion of the Alcaçova wall of the Guimarães castle [31] and a portion of the old Guimarães city wall are presented in Fig. 17 and Fig. 18, respectively.By calculating the average and standard deviation of the unit heights and aspect ratios, the theoretical distributions of block geometries and the line of minimum trace can be predicted using Eq. ( 11) (red lines in Fig. 17 and Fig. 18).In both cases, the unit heights fit very well with the theoretical distribution, while the surveyed unit aspect ratio distributions seem slightly skewed to the left and have smaller standard deviations.Apart from these subtle differences, the surveyed masonry patterns are described well with the equations defined in Section 3. Considering the interlocking of blocks, the prediction of the line of minimum trace are also compared with the surveyed values.The grey area signifies the 95% certainty area of v min .According to the equation, the castle wall overlap parameter can range between 0.1-0.27,while the city wall only 0.05-0.19.Such a result might be considered as expected since masons with better skills would have been employed in constructing the castle, resulting in a higher quality of workmanship.In both cases, the surveyed line of minimum trace fits well into the range of possible values from the equation.

Correlation with structural response
This section aims to correlate the QI-s presented in Section 3 with the structural response of in-plane masonry walls made with irregular masonry patterns.The overlap parameter v min is also investigated to assess the effect of the arrangement rule.The parametric analysis presented below does not intend to cover all the possible correlations between failure mechanism and their correlation with QI-s [42].However, it shows how generated masonry patterns have a consistent structural behaviour when using the same input QI-s.
The seismic response of the masonry structure has been simulated by a system of mass proportional horizontal forces, which, albeit disregarding dynamic effects, provide an acceptable estimation of the seismic behaviour.In particular, a micro LA framework, originally developed by [43], [44], and previously implemented and used by the authors, [5], [45], [46] has been adopted.Briefly, the micro LA formulation considers the masonry structure as an assemblage of rigid blocks connected by frictional contact interfaces with a non-associative flow rule (Fig. 19).The algorithm iterates by solving linear programming problems (corresponding to the static limit analysis problem), and modifying the yield conditions at the interfaces until it reaches the non-associative solution.The following numerical studies use the JAVA API of the MOSEK (version 10.0.45) interior point LP solver, which deals with a homogeneous and self-dual optimisation algorithm.For further details of the limit analysis methodology, the reader is referred to [5], [45], [46].Because the limit analysis algorithm considers a rigid-perfectly plastic material model, only the strength capacity, in the form of the load factor ( λ), is considered in the following.The influence of the input parameter values is assessed by ANOVA diagrams, which measure the average and standard deviation of the response measures (taken from micro LA) for both individual and the two-way interaction of the input parameters.In brief, the middle line shows the average response, and its slope shows the effect of a parameter; the steeper the slope, the higher is the effect on the response measure.The shaded region show the ± one standard deviation value, which signifies how much a parameter defines the response value, and a higher range signifies a larger scatter in response and a smaller significance to the parameter.For an in-depth discussion of the method, the reader is referred to [5], [36], [45].
The parametric study's structural benchmark consists of 4.00 m high masonry shear walls with different wall aspect ratios.Table 1 presents the 5 variables adopted for the generation of samples.The full factorial dataset involves a total of 144 configurations.The values for the unit dimensions are those typically incurred in Italian stone masonry wall patterns based on an extensive survey [47], as presented in Table 2.The table defines the unit vertical area as the product of the masonry type's mean length and mean height.The configurations have been constrained at the bottom by a frictional interface and subjected to mass-proportional horizontal forces.The specific weight of the blocks has been set equal to 19kN/m 3 , though since the horizontal load is mass proportional, it does not affect the calculated load factor.The friction coefficients are defined to cover a wide range of realistic values observed in different stone masonry specimens [48].
In order to understand a representative number of random masonry pattern samples to generate for each configuration, the number of simulations has been incremented until the average load factor of the samples converged to a value, meaning that the sample statistics well represent the whole population (Fig. 20a).Hence, 150 samples have been generated for each configuration to reach a representative sample size, resulting in 21,600 micro LA simulations according to the loading and boundary conditions represented in Fig. 19a.Furthermore, it has been observed that the load factor results of subsequent simulations, with the same QI values, are normally distributed, characterised by mean μ λ and standard deviation σ λ (Fig. 20b).
Three response measures have been assessed through the parametric analysis.At first, the standard deviation of the samples σ λ , which is a representative parameter to quantify the level of correlation between the QI-s and the structural response, is analysed.High standard deviations signify that the QI-s are not adequate parameters to predict the structural response since a significant scattered response is shown.The coefficient of variation of all the generated load factors is 23.5%, while for one QI setting it is, on average, only 8%, and a maximum 11%.This proves the assumption that the QI-s have a non-negligible correlation with the structural response.
Considering the individual effect of input parameters, presented in Fig. 21, bigger units (higher A b and lower β b ) result in increased scatter  in the structural behaviour because the capacity is more dependent on the actual position of the bigger units, which might have a crucial effect on driving the structural behaviour.As the units are more carefully selected and placed in the wall panel (better arrangement rule), the variation in structural behaviour is decreased.Additionally, a higher friction coefficient is associated with increased standard deviations.Finally, if the wall panel is more slender (smaller β W ), the diagonal crack in the rocking failure mechanism cannot fully develop because it reaches the boundaries of the panel; thus, the effects of the masonry pattern's deviation are smaller compared to the stocky walls where a full diagonal might trigger.
Next, the 5-percentile of the distribution (λ min = Q(0.05)= μ λ − 1.645σ λ ) is assessed, which serves as a good approximation of minimal structural response with a 95% confidence level that the capacity will not fall under.
In terms of minimal structural response, the linear effects of A b , μ and β W seem marginal, while v min having a more prominent positive effect.This supports the assumption that a better arrangement rule results in a higher structural capacity of the masonry wall (Fig. 22).By far β b has the highest effect on λ min and its scatter.Higher β b corresponds with a decrease of both structural capacity and scatter.Slight two-way interactions can be observed between β b ,v min ,β W and μ, where for low values of β b the other parameters seem to have a more prevalent effect.The results indicate that the behaviour of walls constituted by stocky units is dominantly controlled only by the aspect ratio value, while as the units tend to be more elongated, additional parameters, such as the mechanical characteristics at the contact, become more important.
Finally, the λ min values have been compared with the load factors where λ RUN represents the load factor of the running bond patterns.This parameter measures the decrement of strength capacity; thus, theoretically, it should be correlated with the QI-s' extent of deviation from the "rules of art" [7], defined ΔM v l in Chapter 3.
Fig. 23a shows that the relative load factor reduction is linearly correlated with the scaled reduction of vertical line of minimum trace To describe this correlation, a simple regression model can be defined as: ⋅λ RUN − α(β b , μ)⋅λ RUN (17) where γ ≈ 0.20 − 0.23, and can be considered constant for different   stone stock distributions and assembly rules.Contrarily, α is a function of the block aspect ratio and the friction coefficient (Fig. 23b), while is independent of CV β in the range of interest of 0.05 − 0.3.Generally, the irregular masonry patterns exhibit a lower strength capacity (up to 30% in the simulated cases) compared to the running bond reference patterns.Furthermore, the fact that the trend lines in Fig. 23a are parallel indicates that the strength capacity's reduction due to the irregularity of the masonry pattern is independent of the unit aspect ratio, but dependent on the aspect ratio scatter and the overlap parameter, i.e. the general irregularity of the pattern.The strength capacity reduction is highest at low levels of v min and medium aspect ratio scatter, where it reduces the capacity up to 23% (Fig. 10).Considering the coefficient α (Fig. 23b), higher friction coefficient and mean aspect ratio can reduce the capacity by up to 10% compared to the running bond.Conversely, in cases of low friction coefficient and mean aspect ratio, a 10% increased capacity can be observed.The findings also suggest when the mean aspect ratio is low, the influence of the friction coefficient (λ μ=0.9 min /λ μ=0.5 min ) in irregular masonry patterns is less significant compared to the running bond pattern, where the higher friction can be fully utilised.However, when the mean aspect ratio is high (stocky units), the friction attains equal significance in both patterns, as it gains importance in the irregular masonry pattern due to the restricted interlocking of the narrower units.

Conclusions
This paper presents a novel masonry pattern generator algorithm able to generate randomly distributed coursed-rectangular block layouts with consistent masonry quality.The main improvement on existing algorithms is the definition of a variable arrangement rule that influences the quality of the masonry pattern.This arrangement rule captures the skillfulness of a "virtual mason" and results in a more consistent masonry quality and, thus, structural behaviour compared to other generator algorithms in the literature.The following points summarise the main findings of this study: • Masonry pattern generation tools must incorporate proper arrangement rules to generate the wide range of pattern qualities present in Historical Masonry Structures (HMS).This quality can be quantitatively characterised using Quality Indexes (QI-s).• The proposed generator algorithm divides the input parameters into two groups: i) block parameters defining the available stone stock and ii) mason parameters determining the assembly rule.The generator ensures random block arrangements that maintain consistent masonry quality and structural behaviour.• Three QI-s are selected, which correlate well with the generator input parameters and structural behaviour: i) block area, ii) block aspect ratio, iii) line of minimum trace.The first two are fully defined by the block parameters, while the latter is influenced by both mason and block parameters.The effect of mason's parameters is most pronounced for slender blocks and high block aspect ratio scatter, while it diminishes for stocky blocks or close to regular patterns.• The line of minimum trace of coursed-rectangular irregular masonry patterns is an efficient measure to quantitatively describe the blocks interlocking.Its value in irregular patterns falls within a range bounded by the running bond and the random placement of blocks.Its relative position in this range depends only on the irregularity of the pattern.• A significant correlation is observed between the QI-s and the seismic behaviour of masonry shear walls.The strength capacity's scatter within specimens of the same QI-s increases with larger and stockier blocks and better material properties, while a better arrangement rule reduces the scatter.
• The lower bound strength capacity is primarily influenced by the block aspect ratio and the arrangement rule, with slender blocks and a better arrangement rule yielding significantly higher results.• Compared to the regular running bond patterns ("state of the art"), irregular masonry patterns exhibit reduced strength capacity, proportional to the difference in the line of minimum trace between the two patterns.This relationship is linear, influenced by the masonry specimen's aspect ratio and material parameters.• The main limitation of the presented algorithm is that it cannot consider un-coursed masonry patterns with irregularly shaped units (rubble masonry).Furthermore, no considerations on the crosssection pattern are given.Future research developments will generalise the algorithm to include the aspects of typical irregular masonry patterns mentioned above.Future work should focus on developing masonry pattern generators capable of defining the cross-section or 3D pattern to model also the out-of-plane response of HMS, which is often associated with the most devastating failures.
CPU-based PC (running at 2.60 GHz) with 16 GB RAM, running under Microsoft Windows 10 Professional.Both the geometry generation and the calculation of QI-s have a time complexity of O(n b

Fig. 5 .
Fig. 5. UML class diagram of the implementation of the generator algorithm.

Fig. 6 .
Fig. 6.Showcase of the functionalities of the generator implementation.

Fig. 7 .
Fig. 7. Time complexities of the pattern generation and QI calculation.

Fig. 8 .
Fig. 8. Considered geometric line measures, a) survey window, b) vertical, c) diagonal line of minimum trace, d) structured path UP-RIGHT-UP-RIGHT.

Fig. 9 .Fig. 10 .
Fig. 9. Dependency of line measures on the generator input parameters, a) vertical line of minimum trace, b) diagonal line of minimum trace, c) structured path UP-RIGHT-UP-RIGHT.

Fig. 11 .Fig. 12 .
Fig. 11.Correlation of generator input parameters with the vertical line of minimum trace at different levels of height and aspect ratio distributions.

Fig. 15 .
Fig. 15.Comparison of the input and generated distributions of block aspect ratio at different distribution levels.

Fig. 16 .
Fig. 16.Influence of mason parameters on the vertical line of minimum trace at different aspect ratio distribution levels.

Fig. 19 .
Fig. 19.Micro limit analysis algorithm, a) Structural configuration and geometric representation; b) Modification of yield function for the non-associative solution.

Fig. 21 .
Fig. 21.ANOVA plots of the individual effect of input parameters on the load factor standard deviation.

Fig. 22 .
Fig. 22. ANOVA plots of the individual and combined effects of the aspect ratio with the other input parameters.

Fig. 23 .
Fig. 23.Effect of deviations from the "rules of art", a) load factor reduction, b) capacity reduction as a function of the friction coefficient and aspect ratio.

Table 1
Input values of the parametric analysis.