A generative two-dimensional structure reverse design method based on MMC
By organizing the explicit geometric parameters of MMC into a discrete structure sequence and utilizing a conditional autoregressive generative model, the problems of long optimization time and lack of explicit geometric parameters in the generated results of MMC topology are solved, enabling the rapid generation of editable parameterized structures suitable for two-dimensional structure topology design.
Patent Information
- Application Number
- CN202611665292.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-27
AI Technical Summary
Existing MMC explicit topology optimization methods require the creation of separate optimization problems for each set of design conditions. This results in the need to re-execute the complete finite element analysis and parameter iteration when the load or boundary conditions change, which is time-consuming. Furthermore, the results generated by data-driven topology optimization methods lack explicit geometric parameters, making them difficult to edit and reuse directly.
A generative two-dimensional structure reverse design method based on MMC is adopted. The explicit geometric parameters of MMC are organized into a discrete structure sequence. The conditional autoregressive generative model is used to learn the conditional distribution of design conditions and structure label sequence, and directly generate recoverable and editable parameterized structures, which are suitable for two-dimensional structure topology generation.
It significantly shortens the topology solution time for new working conditions, generates results with clear geometric meaning, and can quickly generate multiple candidate structures with different geometric shapes, which facilitates finite element verification and subsequent engineering modeling, and improves the efficiency of multi-working-condition design.
Smart Images

Figure CN123179494A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computational mechanics, solid mechanics, structural topology optimization and computer-aided engineering, and specifically relates to a generative two-dimensional structure reverse design method based on MMC. Background Technology
[0002] Structural topology optimization, given a design domain, loads, boundary conditions, and material constraints, determines the optimal distribution of materials within the design domain to obtain a structure that meets load-bearing performance requirements. The moving deformable component method describes the structure using several components with geometric parameters such as center position, length, width, and tilt angle. By adjusting the parameters of each component, it achieves coordinated optimization of the structural shape, dimensions, and topology, resulting in a solution with clearly defined geometric boundaries and component meanings.
[0003] Existing explicit topology optimization methods for MMC typically establish separate optimization problems for each set of design conditions. During a single optimization process, it is necessary to repeatedly calculate the component topology description function and material indicator field, assemble the finite element stiffness matrix, solve for structural displacements, calculate the objective function, constraint functions and their sensitivities, and iteratively update the component parameters until convergence conditions are met. While this method can obtain explicit structures with good mechanical properties, it requires re-executing the complete finite element analysis and parameter iteration whenever the load or boundary conditions change. The solution time increases significantly with the number of load cases, finite element degrees of freedom, and design variables, making it difficult to meet the needs of rapid design and real-time generation of numerous load cases.
[0004] Existing data-driven topology optimization methods typically represent the structure as a pixel map, voxel map, or density field, and use regression networks or image generation networks to predict material distribution. While these methods can reduce some iterative computations, the output lacks explicit geometric parameters that directly correspond to the component's center position, scale, orientation, and boundaries. Post-processing such as thresholding, boundary extraction, smoothing, and parameter reconstruction is often required, which can easily lead to unclear geometric boundaries, difficulties in structural modification, and a disconnect between the generated results and subsequent parametric modeling. This is because the network output space and the explicit structural design variable space are separate, and the generated results cannot be directly incorporated into the MMC geometric model.
[0005] Furthermore, deterministic prediction methods typically provide a single structure for a set of design conditions, making it difficult to represent multiple feasible structures that may exist under the same load, boundary conditions, or target performance. While some generative methods can generate different topologies, the generation process lacks a unified interface with explicit component parameters and mechanical verification, making it difficult to simultaneously consider structural diversity, geometric interpretability, and mechanical performance. Therefore, a topology optimization method is needed that can reuse existing MMC optimization results, directly generate explicit parameterized structures, and connect with finite element verification. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a generative two-dimensional structure reverse design method based on MMC. This method organizes the explicit geometric parameters of Moving Morphable Components (MMCs) into a discrete structural sequence, and directly generates a recoverable, editable, and finite element analysis-capable parametric structure under given design conditions, which is suitable for two-dimensional structure topology generation.
[0007] The specific technical solution adopted in this invention is as follows:
[0008] Firstly, this invention provides a generative two-dimensional structure reverse design method based on MMC, as detailed below:
[0009] S1. Obtain design conditions and establish a computational mechanics model;
[0010] S2. The structure of the computational mechanics model described in S1 is explicitly parameterized using several MMC components, with the component geometric parameters as design variables, and the overall structure represented by the union of the topological description functions of each component.
[0011] S3. For multiple sets of design conditions described in S1, solve the MMC topology optimization problem with the design variables described in S2, and pair the optimized component parameters with the design conditions to form a reference sample;
[0012] S4. Normalize and map the component parameter samples described in S3 into integer labels according to a unified order and value range. Set a component end label after the component label and a structure end label after the complete structure to obtain the structure label sequence.
[0013] S5. Based on the pairing relationship in S3, combine the design conditions described in S1 with the structural label sequence described in S4 to form a paired dataset;
[0014] S6. Construct a conditional autoregressive generative model, including a conditional encoder, a structural label embedding layer, a positional embedding layer, at least one causal decoding block, and a label output layer;
[0015] S7. Train the conditional autoregressive generative model described in S6 using the paired dataset described in S5, and learn the conditional distribution of the design conditions and structure label sequences; when generating, input the target conditions and the structure start label, and generate labels step by step until the output structure end label or the specified length is reached, to obtain one or more candidate structure sequences;
[0016] S8. Restore the candidate structure sequence described in S7 to continuous geometric parameters and reconstruct the explicit structure. Under this design condition, perform finite element analysis to verify its mechanical properties.
[0017] Preferably, the design conditions include load degree-of-freedom vectors and boundary condition degree-of-freedom vectors, which serve as two channels of a dual-channel condition tensor.
[0018] Preferably, in step S2, the geometric parameters of each MMC component include seven parameters in sequence: center abscissa, center ordinate, half length, three half width parameters, and tilt angle sine. The three half width parameters control the change of the component width along the length direction. The maximum value of the topology description function of each MMC component is taken to obtain the union of all components and converted into a material indicator field.
[0019] Preferably, in S3, the topology optimization problem takes the minimum structural compliance as the optimization objective and the material volume fraction not exceeding the specified volume fraction as the constraint, and satisfies the finite element equilibrium equation; in the optimization iteration, the element stiffness contribution is determined according to the material indicator field and the structural displacement is solved, the objective function, constraint function and its sensitivity are calculated, and the MMC component parameters are updated.
[0020] Preferably, in step S4, for each type of parameter, the normalized value of the parameter within the parameter value range is multiplied by the quantization level minus one and rounded down to an integer marker between 0 and the quantization level minus 1; the beginning of the structure marker sequence is also provided with a structure start marker.
[0021] Preferably, the conditional encoder flattens the dual-channel conditional tensor and passes it sequentially through a first linear layer, a GELU activation function, and a second linear layer, and rearranges it into multiple conditional prefix tags. The multiple conditional prefix tags are concatenated before the structural tag sequence to form a joint feature sequence, which is then input into the causal decoding block. The causal decoding block uses a causal mask so that each structural tag position can only utilize all the conditional prefix tags and the preceding structural tags.
[0022] Preferably, the causal decoding block consists of two pre-normalized causal decoding blocks connected in series. Each pre-normalized causal decoding block performs layer normalization on the input and then feeds it into a single-head self-attention layer. The attention output is added to the input of the pre-normalized causal decoding block to form a first residual connection. After layer normalization, the input is fed into an equal-width feedforward network. The output of the equal-width feedforward network is added to the result of the first residual connection to form a second residual connection. The label output layer removes the conditional prefix positions in the joint feature sequence, performs layer normalization on the remaining structural label positions, and outputs the vocabulary logits of each structural label position through a linear layer without bias.
[0023] Preferably, in step S7, when training the conditional autoregressive generative model, the next label is predicted according to the autoregressive order of the previous label. The model is trained by maximizing the conditional likelihood of the real structural label sequence under the given design conditions, that is, minimizing the conditional negative log-likelihood loss of the next label prediction at each position.
[0024] Preferably, in step S8, after removing the structure start marker, component end marker, and structure end marker from the candidate structure sequence, the components are grouped according to the unified parameter order and dequantized according to the same parameter value range used during quantization to restore the continuous geometric parameters of each MMC component; if the third half-width parameter of an MMC component is less than a preset threshold, the component is not incorporated into the overall structure; finite element analysis is used to calculate the compliance, volume fraction, or equivalent elastic performance of the candidate structures, and multiple candidate structures generated under the same design conditions are sorted and screened accordingly.
[0025] In a second aspect, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the generative two-dimensional structure reverse design method based on MMC as described in any one of the first aspects.
[0026] Compared with the prior art, the present invention has the following advantages:
[0027] 1) After the condition generation model is trained, only condition encoding and structural sequence generation are required for new loads and boundary conditions. There is no need to repeat multiple rounds of finite element analysis, sensitivity calculation and parameter iteration from the initial component arrangement. Therefore, the topology solution time for a single new working condition can be significantly shortened and the efficiency of multi-working-condition structural design can be improved.
[0028] 2) The generated result is composed of MMC component parameters, which can directly restore an explicit structure with clear geometric meanings such as center position, length, width and tilt angle, avoiding the need to re-extract and fit the structural boundary from the pixel map or density field, which is convenient for geometric editing, finite element verification and subsequent engineering modeling.
[0029] 3) Loads and boundary conditions participate in the generation of each structural token through conditional encoding, enabling the generated structure to form the main load-bearing path corresponding to the input load conditions. In the two-dimensional test, after verification by a 64×64 finite element mesh, the average relative error of compliance for the training set was 0.1861%, and the average relative error of compliance for the test set was 0.3168%. The relative errors of compliance for the five representative structures were less than 0.10%, 0.36%, less than 0.10%, less than 0.10%, and 0.12%, respectively.
[0030] 4) The autoregressive generation method can learn the probability distribution of the structural sequence under the design conditions. For the same set of target conditions, multiple candidate structures with different geometric shapes can be formed, which is beneficial to expressing the one-to-many relationship in structural reverse design and provides selection space for subsequent performance screening.
[0031] 5) The method can be extended to three-dimensional unit cell reverse design and multi-scale structural design of lumbar implants. The average relative error of the target performance of the three-dimensional unit cell is less than 5%, and different geometric configurations can be generated for the same target performance; the lumbar implant implementation can convert the macroscopic performance allocation results into explicit microstructures, thereby realizing cross-scale structure generation. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of a two-dimensional MMC topology dataset. (a) shows a representative topology in the two-dimensional MMC topology dataset; (b) shows the distribution of normalized structural parameters.
[0033] Figure 2 This represents the probability density distribution of the relative error of compliance on the training and test sets.
[0034] Figure 3 A comparison of the topology generated by the conditional generation model with the conventional MMC optimization structure.
[0035] Figure 4 The process of progressively generating the explicit topology of MMC for the conditional generation model. Detailed Implementation
[0036] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in various embodiments of the present invention can be combined accordingly without mutual conflict.
[0037] This invention provides a generative two-dimensional structure reverse design method based on MMC. Its core idea is to organize the explicit geometric parameters of MMC into a discrete sequence of structural tokens, and use a conditional autoregressive generative model to learn the conditional distribution from the design conditions to the structural token sequence. Thus, when faced with new design conditions, one or more recoverable, editable and finite element-verifiable parameterized structures can be directly generated without re-executing multiple rounds of finite element analysis and parameter iteration.
[0038] This method mainly includes five steps: MMC reference structure construction, explicit parameter serialization, conditional generation model training, target structure generation, and mechanical performance verification. Compared with existing MMC explicit topology optimization, this invention reuses the load transfer laws and component arrangement laws contained in existing optimization samples for new working conditions; compared with data-driven methods that output pixel maps or density fields, the generation results of this invention consist of MMC component parameters with clear geometric meanings, which can be directly used for geometric editing, finite element verification, and subsequent engineering modeling; the autoregressive generation method also enables the generation of multiple candidate structures with different geometric shapes under the same design conditions, providing selection space for performance screening.
[0039] This invention aims to solve the following problems: 1) Existing MMC topology optimization requires multiple rounds of finite element analysis and sensitivity iteration for each new working condition, resulting in long computation times. This invention aims to enable the load transfer and component arrangement rules contained in existing optimized samples to be used for rapid structural generation under new working conditions. 2) Existing data-driven topology optimization mainly outputs pixel, voxel, or density distributions, resulting in a lack of explicit geometric parameters and difficulty in direct editing and reuse. This invention aims to enable the generated structure to be directly restored as an MMC component with a clear center position, length, width, and tilt angle. 3) Existing deterministic prediction is unable to characterize multiple feasible topologies under the same objective condition, and the generated structure is difficult to integrate with computational mechanics analysis. This invention aims to enable the generation process to form one or more candidate explicit structures, and to verify their mechanical properties through finite element calculations under the same load and boundary conditions.
[0040] As a preferred implementation of the present invention, the method is implemented according to S1 to S8. The specific implementation of each step is described in detail below.
[0041] S1: Obtain the design conditions for the structural design task and establish the corresponding computational mechanics model.
[0042] Design conditions describe the external actions and constraints in a structural design task. For two-dimensional structural topology generation, design conditions mainly include load degree-of-freedom vectors and boundary condition degree-of-freedom vectors: the load degree-of-freedom vector is a vector obtained by expanding the concentrated or distributed forces acting on the structure according to the nodal degrees of freedom of the finite element, and the boundary condition degree-of-freedom vector is a vector describing the displacement constraints according to the nodal degrees of freedom. The length of both is equal to the global degree of freedom of the model. The computational mechanics model is a model that can be used for finite element solutions, consisting of a design domain, a finite element mesh, material parameters, and boundary conditions; the shape, element type, and mesh density of the design domain are not limited to the forms given in the embodiments of this invention, and the four-node plane stress element is only one preferred implementation.
[0043] In an embodiment of the present invention, the design domain D is a unit square of size 1×1, divided into 64 elements in each of the two directions, forming 64×64 four-node plane stress finite elements; the total number of nodes is 65×65, each node has two translational degrees of freedom, and the global number of degrees of freedom is 8450; the material has Young's modulus E=1, Poisson's ratio ν=0.3, and structural thickness h=1.
[0044] S2: The structure of the computational mechanics model obtained in S1 is explicitly parameterized using multiple MMC components. The geometric parameters of each component form the structural design variables, and the overall structure is represented by the topological description function of each component and its union.
[0045] MMC (Metal-Modified Component) modules are deformable members explicitly described by a small number of geometric parameters. Each module corresponds to a topological description function, which takes positive values within the module's coverage area and negative values outside the area. Its isosurface gives the module boundary. Taking the maximum value of the topological description functions of all modules yields the union of all modules, thus representing the overall structure. Then, using a regularized Heaviside function, the topological description functions are converted into a material indicator field for use in finite element analysis. The geometric parameters of the modules are described by parameters such as center position, length, width, and tilt angle. The number of modules is unlimited and can be set according to the size of the design domain and the complexity of the structure.
[0046] In embodiments of the present invention, the design variables for each MMC component i are represented as follows:
[0047] d i = (x oi , y oi , L i , t 1i , t 2i , t 3i , s i ) T s i = sin θ i ;
[0048] Where, x oi and y oi L represents the center coordinates of the component. i t is the half length of the component. 1i t 2i and t 3i Three half-width parameters, s, are used to control the variation of component width. i Let c be the sine of the component's tilt angle. i =√|1-s i 2 The design domain coordinates (x, y) are transformed to the component local coordinates (x', y') as follows:
[0049] x′ = ci (xx oi )+s i (yy oi ), y′ = -s i (xx oi )+c i (yy oi );
[0050] The component's widening function and topology description function are as follows:
[0051] b i (x′) = [(t 2i +t 1i -2t 3i ) / (2L i 2 )]x′ 2 + [(t 2i -t 1i ) / (2L i )]x′ + t 3i ;
[0052] φ i (x,y) = 1 - (x′ / L i ) p - [y′ / b i (x′)] p p = 6;
[0053] By φ(x,y)=max{φ1(x,y),…,φ N The set (x,y)} is obtained as the union of all components, where N is the total number of MMC components and p is the exponent of the topology description function. The topology description function is then converted into a material indicator field using a regularized Heaviside function, specifically in the form:
[0054] ;
[0055] Where α is the lower limit of the material indicator value, and ε is the half-width of the regularized transition interval of the topological description function value. In this embodiment, α = 10. -3 ε = 4min(EW, EH), where EW and EH are the dimensions of the element along two directions, respectively.
[0056] This implementation uses 32 initial MMC components (i.e., N=32). The center of each component is located on a 4×4 grid with a spacing of 0.25. Each center is equipped with a pair of components with tilt angle sine values of +0.7 and -0.7, forming an X-shaped component pair in a 4×4 array. The initial half-length of each component is 0.19, and the three initial half-widths are 0.02, 0.03, and 0.02, respectively.
[0057] S3: Solve the MMC topology optimization problem for multiple sets of design conditions. Calculate the material indicator field during the optimization iteration, perform finite element analysis, calculate the objective function, constraint function, and sensitivity, and update the component parameters. Pair the optimized MMC component parameters with the corresponding design conditions to form a reference sample.
[0058] The MMC topology optimization problem is a continuous optimization problem with component geometric parameters as design variables and mechanical performance indicators as objectives or constraints. As a preferred embodiment of the present invention, a specific construction method is provided: minimizing structural compliance as the optimization objective, ensuring the material volume fraction does not exceed a specified volume fraction as a constraint, and satisfying the finite element equilibrium equations. The optimization algorithm is not limited to the moving asymptote method; other gradient-based optimization algorithms can also be used. Sensitivity can be calculated using central finite difference or analytical differentiation.
[0059] In an embodiment of the present invention, given a load vector F, boundary conditions, and a specified volume fraction v, the optimization problem is: Using all MMC component parameters as the design variable d, the optimization problem is:
[0060] min f(d) = F T U;
[0061] st K(d)U = F;
[0062] g(d) = V(d) / |D| - v ≤ 0;
[0063] Where U is the global displacement vector, K(d) is the global stiffness matrix determined by the MMC parameters, V(d) is the structural material area, and |D| is the design domain area. The element stiffness contribution is determined based on the material indication values at each element node, and the structural displacement is solved in the unconstrained degrees of freedom. The result is then expressed as F. T U calculates structural compliance. During optimization, a central finite difference method is used to calculate the change in the material indicator field relative to the parameters of each component. Based on this, the compliance and volume constraint sensitivity are calculated. The component parameters are then updated using the moving asymptote method. The maximum absolute change in the parameter vector between two consecutive iterations is used as the convergence measure, and a convergence threshold of 10 is set. -3 The maximum number of iterations is set to 200, and the volume fraction is given in the range of 0.2 to 0.6. After optimization, the MMC component parameters, displacements, element strain energies, Von Mises stresses, and optimization process data corresponding to the design conditions are saved. The component parameters are paired with the corresponding design conditions to form a reference sample.
[0064] During sample construction, different specified volume fractions are set within the range of 0.2 to 0.6 to enrich the topology of the reference structure while limiting material usage and achieving structural lightweighting. In this embodiment, the specified volume fraction is not used as a conditional input to the model; instead, conditions are generated based on loads and boundary conditions. The main evaluation focuses on how closely the generated structure approximates the corresponding MMC reference structure in terms of compliance.
[0065] S4. After normalizing the continuous geometric parameters of each MMC component according to a unified parameter order and parameter value range, map them to integer tokens through the integerization operator R; set a component end marker after the component parameters and a structure end marker after the complete structure to obtain a structure token sequence that preserves the component division and geometric meaning.
[0066] A unified order refers to arranging the geometric parameters of each component in a fixed parameter category order, ensuring that the value range remains consistent across all samples for the same type of parameter. A token is an integer number obtained after discretizing continuous parameters. Component end markers, structure end markers, and structure start markers are dedicated numbers independent of the parameter quantization value range, used to identify component and structure boundaries, ensuring the sequence maintains component division and geometric meaning. The quantization level can be adjusted according to geometric precision and sequence size, or other uniform or non-uniform discretization methods can be used.
[0067] In embodiments of the present invention, the i-th MMC component is represented as d in a fixed order. i =(d i1 ,d i2 ,…,d i7 The seven parameters are, in order, the central x-coordinate. oi , central ordinate y oi Component half length L i Three half-width parameters t 1i t 2i t 3i and the sine value of the tilt angle s i Let the lower and upper bounds of the j-th type of parameter be l and l, respectively. j and u j If the quantization level is Q, then the integer token corresponding to the j-th type of parameter is:
[0068] q ij = R{[(d ij -l j ) / (u j -l j )](Q-1)},q ij ∈{0,1,…,Q-1};
[0069] Where R is the nearest integer rounding operator, used to convert the value obtained by multiplying the normalization parameter by Q-1 into the nearest integer; when the value is exactly the midpoint between two adjacent integers, the even number is taken, for example R(2.5)=2, R(3.5)=4. In this embodiment, Q=512, and all seven types of MMC parameters are converted into integer tokens between 0 and 511. The lower bound vector and upper bound vector of the seven types of parameters are as follows:
[0070] l= (0, 0, 0.001, 0.001, 0.001, 0.003, -1);
[0071] u = (1, 1, 1.514, 0.1956, 0.2, 0.2, 1).
[0072] It should be noted that the lower bound vector and the upper bound vector mentioned above both adopt the value range preset in the MMC structure optimization program.
[0073] For a two-dimensional structure containing 32 MMC components, let q be the seven parameters of the i-th component. i1 to q i7 The complete structure sequence is then represented as:
[0074] S = [514, q 11 ,…,q 17 ,512, q 21 ,…,q 27 ,512,…,q 32 ,1,…,q 32 [,7,512,513];
[0075] Where 514 is the start token, 512 is the component end token, and 513 is the structure end token. Each component occupies seven parameters (token) and one component end token. The length of the complete sequence is:
[0076] L = 1 + 32×(7+1) + 1 = 258;
[0077] Therefore, the vocabulary used by the model contains at least 515 tokens numbered from 0 to 514, where 0 to 511 correspond to the quantized MMC parameters, and 512 to 514 correspond to the component end, structure end, and start tokens.
[0078] S5. Establish a paired dataset of design conditions and structural token sequences. In the two-dimensional structure, the load degree-of-freedom vector and the boundary condition degree-of-freedom vector are used as two channels of the condition tensor, and the corresponding MMC structural token sequence is used as the model output sequence. The dataset is then divided into training and test sets.
[0079] Each sample in the paired dataset includes a sequence of structural tokens and its corresponding design conditions. In the two-dimensional case, the load degree-of-freedom vectors and boundary condition degree-of-freedom vectors are combined along the channel direction to form a two-channel condition tensor, which serves as the conditional input to the model, while the structural token sequence serves as the output sequence of the model. The ratio of the training set to the test set is not limited to the 8:2 ratio given below.
[0080] In an embodiment of the present invention, the paired dataset contains 30,000 samples. Each sample includes a 258-token MMC structure token sequence, a corresponding load degree-of-freedom vector and boundary condition degree-of-freedom vector (both with a length of 8450), and volume fraction, displacement, element strain energy, and Von Mises stress for mechanical analysis and result verification. Each structure token sequence corresponds one-to-one with the load and boundary condition according to the sample number; the 30,000 samples are divided into a training set (24,000 samples) and a test set (6,000 samples) in an 8:2 ratio.
[0081] like Figure 1 As shown, the two-dimensional MMC topology dataset includes reference structures under different loads and boundary conditions. Figure 1 (a) shows the representative topologies, with red markings indicating the location of boundary conditions and blue markings indicating the location of load application. Each sample presents different component arrangements and topologies. Figure 1 (b) shows the density distribution of the normalized structural parameters after t-SNE dimensionality reduction, with the x and y axes representing the dimensionality-reduced two-dimensional coordinates. The distribution in the figure exhibits multiple local clustering regions, reflecting the non-uniform distribution of the sample parameter representations. The above results demonstrate the differences in structural morphology and parameter representations within the dataset, providing reference samples for conditional generative models under different operating conditions and component arrangements.
[0082] S6. Construct a two-layer conditional autoregressive generative model. The model consists of a dual-channel conditional encoder, a structured token embedding layer, a positional embedding layer, two cascaded pre-normalized causal decoding blocks, an output normalization layer, and a biasless token output layer. Each causal decoding block includes a single-head causal self-attention layer, a residual connection, and an equal-width feedforward network.
[0083] The function of the condition encoder is to transform the design conditions into several condition prefix tokens, so that load and boundary condition information participate in the generation of each structural token. As a preferred embodiment of the present invention, the condition encoder flattens the dual-channel condition tensor and passes it through the first linear layer, the GELU activation function and the second linear layer in sequence, and rearranges it into multiple condition prefix tokens. The multiple condition prefix tokens are concatenated before the structural token sequence to form a joint feature sequence, which is input into the causal decoding block. The causal decoding block uses a causal mask so that each structural token position can only use all the condition prefix tokens and the structural tokens that have been preceded.
[0084] At least one causal decoding block is required, preferably two pre-normalized causal decoding blocks cascaded in series. Each pre-normalized causal decoding block performs layer normalization on the input before feeding it into a single-head self-attention layer. The attention output is added to the input of the pre-normalized causal decoding block to form a first residual connection. After further layer normalization, the input is fed into an equal-width feedforward network. The output of the equal-width feedforward network is added to the result of the first residual connection to form a second residual connection. The label output layer removes the conditional prefix positions from the joint feature sequence, performs layer normalization on the remaining structural label positions, and outputs the vocabulary logits for each structural label position through a linear layer without bias. In practice, other decoder structures of different sizes can also be used, as long as they can predict subsequent MMC parameters based on design conditions and the generated structural information.
[0085] In an embodiment of the invention, the conditional autoregressive generative model employs a Transformer-only decoder composed of two cascaded causal decoding blocks. Let the batch size be B, the structural sequence length be L, the degrees of freedom of a single load or boundary condition vector be D, the token feature width be W, the conditional prefix length be P, the vocabulary size be V, and the maximum structural sequence length be M. In the two-dimensional structure, D = 8450, and the conditional tensor C is obtained by stacking the load degree-of-freedom vectors and boundary condition degree-of-freedom vectors along the channel direction, i.e. .
[0086] The first layer is a conditional encoder. First, the dual-channel conditional tensor is flattened into a 2D vector, then passed sequentially through a first linear layer with an input dimension of 2D and an output dimension of W, a GELU activation function, and a second linear layer with an input dimension of W and an output dimension of P×W. Finally, it is rearranged into P conditional prefix tokens.
[0087] ;
[0088] The second layer consists of structural token embedding and positional embedding. (Word embedding matrix) The l-th integer token sl Convert to a W-dimensional vector; position embedding matrix Provide a W-dimensional vector corresponding to the sequence position. Adding the two together yields the structural features:
[0089] H l s =E tok (s l )+E pos (l), l=0,1,…,L-1;
[0090] The third layer is the concatenation of conditional prefixes and structural features. The P conditional prefixes output by the conditional encoder are placed before the structural token, forming a joint feature sequence of length P+L:
[0091] ;
[0092] The fourth and fifth layers are two identical, cascaded pre-normalized causal decoding blocks. Each causal decoding block first performs layer normalization on its input, then feeds it into a single-headed self-attention layer; the attention output is added to the input of that decoding block to form the first residual connection. Let H be the input of the k-th decoding block. (k-1) Then the attention sublayer is:
[0093] ;
[0094] Where Attn is a single-head self-attention operation, M c This is an upper triangular causal mask. For the r-th position in the joint sequence, masking is performed when the column position c is greater than r, so that the structure token can only utilize all preceding conditional prefixes and the already input preceding structure tokens:
[0095] M c (r,c)=0, c≤r; M c (r,c)=-∞, c>r;
[0096] Attention residual result A (k) After undergoing layer normalization again, the input is fed into a constant-width feedforward network. The feedforward network consists of a first linear layer (W-dimensional to W-dimensional), a GELU activation function, and a second linear layer (W-dimensional to W-dimensional). Its output is related to A. (k) The addition forms the second residual connection:
[0097] ;
[0098] H (k) =A (k) +FFN[LN(A (k) )], k=1,2;
[0099] The sixth layer consists of an output normalization layer and a token output layer. After processing the two causal decoding blocks, the P conditional prefix positions at the very beginning of the joint feature sequence are removed, retaining only the L structural token positions. Layer normalization is then applied, and the vocabulary logits corresponding to each structural position are obtained through a linear layer with input dimension W and output dimension V and no bias.
[0100] ;
[0101] logits only correspond to the structure token position. Changing the load or boundary conditions will change the condition prefix H. c The token output at each structural position is influenced by two causal decoding blocks. During model construction, the vocabulary size V, token feature width W, conditional prefix length P, and maximum structural sequence length M are configurable parameters; for the aforementioned two-dimensional structure, V ≥ 515 and M ≥ 258 should be satisfied.
[0102] In the above formulas, W c1 W c2 W f1 W f2 W o b is the weight matrix corresponding to the linear layer. c1 b c2 b f1 b f2 This is the corresponding bias vector.
[0103] S7. Train a conditional autoregressive generative model using paired data, enabling the model to learn the conditional distribution between the design conditions and the MMC structure sequence. During generation, the target design conditions and the structure start token are input, and subsequent tokens are generated step by step according to the predetermined order of the structure parameters until the structure end token is output or the specified sequence length is reached, forming one or more candidate structure sequences.
[0104] The training adopts an autoregressive approach, predicting the next token from the previous token; during the generation phase, the same target design conditions are repeatedly sampled to obtain multiple candidate structure sequences with different geometric shapes, so as to express the one-to-many relationship in the structural reverse design.
[0105] In an embodiment of the present invention, during training, the load and boundary conditions are input into the conditional encoder, and the structure token sequence is input into the structure token embedding layer in an autoregressive order. For the structure sequence S=(s1,s2,…,s…), L The conditional probability decomposition of the conditional tensor C is as follows:
[0106] ;
[0107] The model is trained by maximizing the conditional likelihood of the true structure sequence given a conditional tensor C, which is equivalent to minimizing the conditional negative log-likelihood loss of the next token prediction at each position:
[0108] ;
[0109] Here, Θ represents all trainable parameters of the conditional autoregressive generative model, and the loss corresponds to the cross-entropy of the target token at each structural position. During training, the logits of the output at each position are converted into vocabulary probabilities using softmax, and the parameters of the conditional encoder, embedding layer, two causal decoding blocks, output normalization layer, and unbiased token output layer are updated accordingly.
[0110] In the generation phase, the target load degree-of-freedom vector and the boundary condition degree-of-freedom vector are combined into a two-channel condition tensor C, and the initial structure marker 514 is input. Assuming that the l-th token has been generated, the model takes the logitsz1 corresponding to the current structure position and calculates the probability of the next token in the vocabulary using softmax.
[0111] p1(v) = exp[z1(v)] / Σ v=0 V-1 exp[z1(v)], v=0,1,…,V-1;
[0112] The next token is selected based on the vocabulary probability, then appended to the generated sequence and re-inputted into the model. This process is repeated to generate subsequent MMC parameter tokens and boundary markers. Generation stops when the structure end marker 513 is encountered or the structure sequence reaches 258 tokens. The component end marker 512 is used to determine the boundary between adjacent MMC components.
[0113] like Figure 4 As shown, each sub-graph, arranged from left to right and top to bottom, illustrates the explicit topology corresponding to the step-by-step generation of the MMC structure sequence by the conditional autoregressive generative model. To demonstrate the generation process, the component parameters formed at different generation stages are restored to their geometric structures. As the component sequence is gradually generated, the geometric arrangement and connection relationships of the structure gradually take shape, ultimately resulting in a connected load-bearing structure. This figure illustrates the process by which the component sequence gradually constitutes the overall explicit topology.
[0114] S8. Convert the candidate structure sequence back to the continuous geometric parameters of each MMC component, and reconstruct the overall explicit structure using the component topology description function; perform finite element analysis under the corresponding design conditions, calculate the compliance, volume fraction or equivalent performance of the candidate structure, and obtain the generated structure and its mechanical performance verification results.
[0115] The reverse quantization uses the same parameter range as the quantization; if the third half-width parameter t3 is too small, the component width is close to zero and has no substantial contribution to the overall structure, so it is not included in the overall structure (the preset threshold is 0.004 in the embodiment); the verification indicators include compliance, volume fraction or equivalent elastic performance, and multiple candidate structures under the same design conditions can be sorted and screened according to the verification results. The screening criteria may also include structural connectivity or geometric manufacturability.
[0116] In an embodiment of the present invention, for each candidate structure, the structure start marker, component end marker, and structure end marker are first removed. Then, the structure is divided into groups of seven parameter tokens, and the continuous parameters of each MMC component are recovered using an inverse quantization formula. The recovered value of the j-th type of parameter is:
[0117] ;
[0118] When the restored sixth parameter t3 is less than 0.004, the component is not incorporated into the overall structure; the remaining components are geometrically reconstructed using topological description functions, and the union of the topological description functions of each component is taken to form the overall explicit structure. Subsequently, the same loads and boundary conditions as the condition input are applied to the 64×64 finite element mesh, and the displacement and compliance are resolved. The mechanical performance verification results are used as the evaluation criteria for candidate structures.
[0119] The implementation of S1 to S8 above gives this invention the following characteristics: First, after the conditional generation model is trained, only conditional encoding and structural sequence generation are required for new loads and boundary conditions. This eliminates the need for repeated rounds of finite element analysis, sensitivity calculation, and parameter iteration starting from the initial component arrangement, significantly shortening the topology solution time for a single new working condition. Second, the generated results are composed of MMC component parameters, which can directly recover explicit structures with clear geometric meanings such as center position, length, width, and tilt angle. This avoids re-extracting and fitting structural boundaries from pixel maps or density fields, facilitating geometric editing, finite element verification, and subsequent engineering modeling. Third, loads and boundary conditions participate in the generation of each structural token through conditional encoding, enabling the generated structure to form the main load-bearing path corresponding to the input working condition. Fourth, the autoregressive generation method can learn the probability distribution of the structural sequence under design conditions. For the same set of target conditions, multiple candidate structures with different geometric shapes can be formed, which is beneficial for expressing the one-to-many relationship in structural reverse design.
[0120] The method and effects of the present invention will be demonstrated below through specific embodiments.
[0121] Example
[0122] This embodiment utilizes a generative two-dimensional structure reverse design method based on MMC of the present invention to generate two-dimensional topological conditions, as detailed below:
[0123] A 64×64 planar stress finite element mesh is established on a unit square design domain of size 1×1, with E=1, ν=0.3, and h=1. The initial design contains 32 MMC components, each uniformly arranged in a 4×4 X-shaped component pair. For each set of loads, boundary conditions, and specified volume fractions ranging from 0.2 to 0.6, an MMC topology optimization problem with minimum compliance as the objective and material volume as the constraint is solved.
[0124] During optimization, the overall structure is formed based on the maximum value of the topology description function of each component, and the material indicator field is obtained by regularizing the Heaviside function. Displacement is solved using the finite element equilibrium equations to calculate compliance and volume constraint sensitivity, and the component parameters are updated using the moving asymptote method. The maximum number of iterations is set to 200, and the convergence threshold is set to 10. -3 The optimized MMC parameters and corresponding mechanical responses are obtained.
[0125] Each structure was uniformly discretized with Q=512 according to the order of 32 components and seven parameters per component. A structure start marker, component end marker, and structure end marker were added to form a structure token sequence of length 258. The 30,000 structure sequences were paired with the corresponding loads and boundary conditions to form a dataset, and the training set and test set were divided in an 8:2 ratio.
[0126] The load degree-of-freedom vector and the boundary condition degree-of-freedom vector are combined into a two-channel conditional tensor and encoded into a conditional feature sequence. The MMC structure token is then generated stepwise using a conditional autoregressive generative model. The generated sequence is restored to the MMC component parameters, and the explicit topology is reconstructed. The compliance is then recalculated under the same 64×64 finite element mesh and the same working conditions.
[0127] like Figure 2 As shown, the red and blue curves represent the probability density distributions of the relative compliance error between the training and test sets, respectively. The horizontal axis represents the relative error, and the vertical axis represents the probability density. Both curves have higher probability densities in the lower error region, and the tail of the test set curve is wider than that of the training set curve. In this embodiment, the average relative compliance errors of the training and test sets are 0.1861% and 0.3168%, respectively. The relative error is calculated as follows:
[0128] ;
[0129] like Figure 3As shown, five representative working conditions were selected, and the structures generated by the conditional generation model were compared with the reference structures obtained by conventional MMC optimization. The upper part of the figure shows the GenMMC-generated structures, the middle part shows the MMC reference structures, and each column corresponds to a set of structures under the same working condition, listing the corresponding compliance and relative errors. The relative errors of compliance for the five working conditions, from left to right, are less than 0.10%, 0.36%, less than 0.10%, less than 0.10%, and 0.12%. From the structural morphology and compliance results, it can be seen that some generated structures differ from the reference structures in local geometric arrangement, but still possess similar compliance, demonstrating the method's ability to generate explicit structures with near-reference mechanical responses under the shown working conditions.
[0130] The above results show that the mechanical properties of the generated structure are comparable to those of the conventional MMC optimized structure, and the solution process for a single new working condition no longer requires multiple rounds of finite element iteration.
[0131] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A generative two-dimensional structure reverse design method based on MMC, characterized in that, Specifically as follows: S1. Obtain design conditions and establish a computational mechanics model; S2. The structure of the computational mechanics model described in S1 is explicitly parameterized using several MMC components, with the component geometric parameters as design variables, and the overall structure represented by the union of the topological description functions of each component. S3. For multiple sets of design conditions described in S1, solve the MMC topology optimization problem with the design variables described in S2, and pair the optimized component parameters with the design conditions to form a reference sample; S4. Normalize and map the component parameter samples described in S3 into integer labels according to a unified order and value range. Set a component end label after the component label and a structure end label after the complete structure to obtain the structure label sequence. S5. Based on the pairing relationship in S3, combine the design conditions described in S1 with the structural label sequence described in S4 to form a paired dataset; S6. Construct a conditional autoregressive generative model, including a conditional encoder, a structural label embedding layer, a positional embedding layer, at least one causal decoding block, and a label output layer; S7. Train the conditional autoregressive generative model described in S6 using the paired dataset described in S5, and learn the conditional distribution of the design conditions and structure label sequences; when generating, input the target conditions and the structure start label, and generate labels step by step until the output structure end label or the specified length is reached, to obtain one or more candidate structure sequences; S8. Restore the candidate structure sequence described in S7 to continuous geometric parameters and reconstruct the explicit structure. Under this design condition, perform finite element analysis to verify its mechanical properties.
2. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, The design conditions include load degree-of-freedom vectors and boundary condition degree-of-freedom vectors, which serve as two channels of a dual-channel condition tensor.
3. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, In S2, the geometric parameters of each MMC component include seven parameters in sequence: center abscissa, center ordinate, half length, three half width parameters, and tilt angle sine value. The three half width parameters control the change of the component width along the length direction. The maximum value of the topology description function of each MMC component is taken to obtain the union of all components and converted into a material indicator field.
4. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, In S3, the topology optimization problem takes the minimum structural compliance as the optimization objective, the material volume fraction not exceeding the specified volume fraction as the constraint, and satisfies the finite element equilibrium equation; In the optimization iteration, the stiffness contribution of the element is determined based on the material indicator field, the structural displacement is solved, the objective function, constraint function and its sensitivity are calculated, and the MMC component parameters are updated.
5. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, In S4, for each type of parameter, the normalized value of the parameter in the parameter value range is multiplied by the quantization level minus one and rounded down to an integer label between 0 and the quantization level minus 1; the beginning of the structure label sequence is also provided with a structure start label.
6. The generative two-dimensional structure reverse design method based on MMC according to claim 2, characterized in that, The conditional encoder flattens the dual-channel conditional tensor and then passes it through the first linear layer, the GELU activation function, and the second linear layer in sequence, and rearranges it into multiple conditional prefix tags. Multiple conditional prefix tags are concatenated before the structural tag sequence to form a joint feature sequence, which is then input into the causal decoding block. The causal decoding block uses a causal mask, so that each structural marker position can only utilize all conditional prefix markers and the structural markers that have already appeared.
7. The generative two-dimensional structure reverse design method based on MMC according to claim 6, characterized in that, The causal decoding block consists of two pre-normalized causal decoding blocks connected in series. Each pre-normalized causal decoding block performs layer normalization on the input and then feeds it into a single-head self-attention layer. The attention output is added to the input of the pre-normalized causal decoding block to form a first residual connection. After layer normalization, the input is fed into an equal-width feedforward network. The output of the equal-width feedforward network is added to the result of the first residual connection to form a second residual connection. The label output layer removes the conditional prefix positions in the joint feature sequence, performs layer normalization on the remaining structural label positions, and outputs the vocabulary logits for each structural label position through a linear layer without bias.
8. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, In S7, when training the conditional autoregressive generative model, the next label is predicted according to the autoregressive order of the previous label. The model is trained by maximizing the conditional likelihood of the real structural label sequence under the given design conditions, that is, minimizing the conditional negative log-likelihood loss of the next label prediction at each position.
9. The generative two-dimensional structure reverse design method based on MMC according to claim 1, characterized in that, In step S8, after removing the structure start marker, component end marker, and structure end marker from the candidate structure sequence, the components are grouped according to the unified parameter order and dequantized according to the same parameter value range used during quantization to restore the continuous geometric parameters of each MMC component. If the third half-width parameter of an MMC component is less than a preset threshold, the component is not included in the overall structure. Finite element analysis is used to calculate the compliance, volume fraction, or equivalent elastic performance of the candidate structures, and the multiple candidate structures generated under the same design conditions are sorted and screened accordingly.
10. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the generative two-dimensional structure reverse design method based on MMC as described in any one of claims 1 to 9.
