# Metafor

ULiege - Aerospace & Mechanical Engineering

### Site Tools

doc:user:remeshing:remeshing

# Differences

This shows you the differences between two versions of the page.

 doc:user:remeshing:remeshing [2016/06/13 17:02]joris [Changing mesh density during the computation] doc:user:remeshing:remeshing [2018/05/04 15:47]boman ↷ Links adapted because of a move operation Both sides previous revision Previous revision 2018/05/04 15:47 boman ↷ Links adapted because of a move operation2016/06/14 18:15 joris [Options] 2016/06/13 17:33 joris [Options] 2016/06/13 17:29 joris [Dynamic balancing] 2016/06/13 17:19 joris [File 2 : script] 2016/06/13 17:13 joris [File 2 : script] 2016/06/13 17:11 joris [Changing the options] 2016/06/13 17:11 joris [CopyRemesher] 2016/06/13 17:04 joris [Data Transfer] 2016/06/13 17:03 joris [Using other remeshing criteria] 2016/06/13 17:02 joris [Changing mesh density during the computation] 2016/06/13 17:02 joris [Changing mesh density during the computation] 2016/06/13 17:01 joris [Changing the critical remeshing value during the computation] 2016/06/13 16:57 joris [How does FENRIR work ?] 2016/06/13 16:56 joris [Dynamic balancing] 2016/06/13 16:55 joris [Quasi-static balancing] 2016/06/13 16:53 joris [Post-remeshing operations] 2016/06/13 16:52 joris [Changing the fields to transfer] 2016/06/13 16:51 joris [Transfinite Meshers] 2016/06/13 16:48 joris [Transfinite Meshers] 2016/06/13 16:46 joris [Transfinite Meshers] 2016/06/13 16:36 joris [CopyRemesher] 2016/06/13 16:35 joris [Using other remeshing criteria] 2016/06/13 16:34 joris [Changing the critical remeshing value during the computation] 2016/06/13 16:32 joris [History curves] 2016/06/13 16:30 joris [File 2 : script] 2016/06/13 16:28 joris [File 1 : test-case] 2016/06/13 16:27 joris 2016/06/13 16:25 joris 2016/06/13 14:46 joris [Quasi-static Balancing] 2016/06/09 17:17 joris [Quasi-static Balancing] 2016/06/09 17:14 joris [Quasi-static Balancing] 2016/06/09 17:09 joris 2016/06/03 17:54 joris [Example] 2016/06/03 17:26 joris [Example] 2016/06/03 17:25 joris [Introduction] Next revision Previous revision 2018/05/04 15:47 boman ↷ Links adapted because of a move operation2016/06/14 18:15 joris [Options] 2016/06/13 17:33 joris [Options] 2016/06/13 17:29 joris [Dynamic balancing] 2016/06/13 17:19 joris [File 2 : script] 2016/06/13 17:13 joris [File 2 : script] 2016/06/13 17:11 joris [Changing the options] 2016/06/13 17:11 joris [CopyRemesher] 2016/06/13 17:04 joris [Data Transfer] 2016/06/13 17:03 joris [Using other remeshing criteria] 2016/06/13 17:02 joris [Changing mesh density during the computation] 2016/06/13 17:02 joris [Changing mesh density during the computation] 2016/06/13 17:01 joris [Changing the critical remeshing value during the computation] 2016/06/13 16:57 joris [How does FENRIR work ?] 2016/06/13 16:56 joris [Dynamic balancing] 2016/06/13 16:55 joris [Quasi-static balancing] 2016/06/13 16:53 joris [Post-remeshing operations] 2016/06/13 16:52 joris [Changing the fields to transfer] 2016/06/13 16:51 joris [Transfinite Meshers] 2016/06/13 16:48 joris [Transfinite Meshers] 2016/06/13 16:46 joris [Transfinite Meshers] 2016/06/13 16:36 joris [CopyRemesher] 2016/06/13 16:35 joris [Using other remeshing criteria] 2016/06/13 16:34 joris [Changing the critical remeshing value during the computation] 2016/06/13 16:32 joris [History curves] 2016/06/13 16:30 joris [File 2 : script] 2016/06/13 16:28 joris [File 1 : test-case] 2016/06/13 16:27 joris 2016/06/13 16:25 joris 2016/06/13 14:46 joris [Quasi-static Balancing] 2016/06/09 17:17 joris [Quasi-static Balancing] 2016/06/09 17:14 joris [Quasi-static Balancing] 2016/06/09 17:09 joris 2016/06/03 17:54 joris [Example] 2016/06/03 17:26 joris [Example] 2016/06/03 17:25 joris [Introduction] 2016/06/02 15:42 joris [Balancing] 2016/06/02 15:38 joris [Balancing] 2016/06/02 12:56 joris [Post-remeshing operations] 2016/06/02 12:54 joris 2016/06/02 12:49 joris [Post-remeshing operations] 2016/06/02 12:49 joris [Post-remeshing operations] 2016/06/02 12:49 joris [Post-step operations] 2016/06/02 12:48 joris [Changing the fields to transfer] 2016/06/02 12:44 joris [Changing the fields to transfer] 2016/06/02 12:44 joris [Changing the options] 2016/06/02 12:40 joris [Changing the options] 2016/06/02 12:40 joris [Changing the transfer method] 2016/06/02 12:40 joris [Changing the transfer method] 2016/06/02 12:39 joris [Data Transfer] 2016/06/02 12:22 joris [Remeshing with Transfinite Mesher 1D or 2D] Line 44: Line 44: Second, [[doc/user/meshtransfer/datatransferbetweenmeshes|data must be transferred]] from the old to the new mesh. As you very well know, the Gauss points contains information about strains and stresses, and the nodes about displacements, velocities and temperatures. However, just after remeshing, the newly defined nodes and Gauss points do not know anything, since they were just created ! If we do not want to loose what was computed during the previous time integration, then data (stresses, temperatures, velocities...) must be transferred to the new mesh. Second, [[doc/user/meshtransfer/datatransferbetweenmeshes|data must be transferred]] from the old to the new mesh. As you very well know, the Gauss points contains information about strains and stresses, and the nodes about displacements, velocities and temperatures. However, just after remeshing, the newly defined nodes and Gauss points do not know anything, since they were just created ! If we do not want to loose what was computed during the previous time integration, then data (stresses, temperatures, velocities...) must be transferred to the new mesh. - Once this is done (it used to take a bloody hell of a f***ing time, but now the time required is more reasonable, see [[commit:01_19]] for details), we have a good new mesh, containing data from the previous computation. From this, the simulation can be restarted, which means that the time integration is carried out further, until the remeshing criterion is met again and another remeshing operation takes place. + Once this is done (it used to take a bloody hell of a f***ing time, but now the time required is more reasonable, see [[commit:2016:01_19]] for details), we have a good new mesh, containing data from the previous computation. From this, the simulation can be restarted, which means that the time integration is carried out further, until the remeshing criterion is met again and another remeshing operation takes place. And that's it for the basics ! But as they say, a picture is worth a thousand words, and I guess that a video is worth a thousand pictures, so just enjoy the following video, about the modelling of forging, to see how it works : And that's it for the basics ! But as they say, a picture is worth a thousand words, and I guess that a video is worth a thousand pictures, so just enjoy the following video, about the modelling of forging, to see how it works : Line 258: Line 258: autoRemesh.setBalancing(True) autoRemesh.setBalancing(True) - + + autoRemesh.makeAnim = False + autoRemesh.execute() autoRemesh.execute() Line 272: Line 274: * ''setInteractionToPostStep'' gives to FENRIR the user number of the interaction on which post-remeshing operations should be executed (typically, any contact interaction), here number 1. * ''setInteractionToPostStep'' gives to FENRIR the user number of the interaction on which post-remeshing operations should be executed (typically, any contact interaction), here number 1. - * Finally, the line ''autoRemesh.setBalancing(True)'' is the magical ingredient that makes everything taste better... I will talk more about this in a [[#Balancing|following section]]. + * The line ''autoRemesh.setBalancing(True)'' is the magical ingredient that makes everything taste better... I will talk more about this in a [[#Balancing|following section]]. + + * Finally, the line ''autoRemesh.makeAnim = False'' indicates that we have no wish to make a save a picture every time that a fac is saved (to make an anim later on). If set to ''True'', then after each time integration, all facs will be loaded and a screenshot will be saved as a .bmp in the folder Anim, located in the workspace, just as is traditionally done when clicking on the button ''makeAnimation'' in Metafor GUI. Now that you have altered your test case to include remeshing, and that you have defined this little script, all that remains is to launch Metafor and execute your script (execute, not load/meta). Everything should work out perfectly. Now that you have altered your test case to include remeshing, and that you have defined this little script, all that remains is to launch Metafor and execute your script (execute, not load/meta). Everything should work out perfectly. Line 346: Line 350: Two different remeshing criteria have been implemented yet, one based on a ''[[doc/user/results/courbes_res#valueextractor|ValueExtractor]]'', the other on time. Two different remeshing criteria have been implemented yet, one based on a ''[[doc/user/results/courbes_res#valueextractor|ValueExtractor]]'', the other on time. - Previously, the one relying on a valueExtractor was used in a very simple way : on one side of the part, with the field ''IF_MESH_QUALITY''. But is can be used with any ''[[doc/user/results/courbes_res#valueextractor|ValueExtractor]]'' you want, and on any geometrical entity. For example, let us assume that we want a criterion based on the aspect ratio, which is to be evaluated on two different sides. Then we simply define a skin with these two sides and we have the following : + Previously, the one relying on a ''valueExtractor'' was used in a very simple way : on one side of the part, with the field ''IF_MESH_QUALITY''. But is can be used with any ''[[doc/user/results/courbes_res#valueextractor|ValueExtractor]]'' you want, and on any geometrical entity. For example, let us assume that we want a criterion based on the aspect ratio, which is to be evaluated on two different sides. Then we simply define a skin with these two sides and we have the following : #Stop Criterion #Stop Criterion Line 359: Line 363: But then, there is also a simple criterion based on time, if you want to remesh every few seconds or so. But then, there is also a simple criterion based on time, if you want to remesh every few seconds or so. - In this case, you must first define a vector containing all the times at which you want to remesh (''p[stopTime]''), then use the key ''p[integrationNumber]'' to set the right remeshing time depending on the integration. See below for the example : + In this case, you must first define a vector containing all the times at which you want to remesh (''p[stopTime]''), then use the key ''p[integrationNumber]'' to set the right remeshing time depending on the integration. See below, or see ''apps.remeshing2.fullAuto.cont2cRemeshing'', for the example : def getParameters(_p={}): def getParameters(_p={}): Line 415: Line 419: CopyRemesher(side, p['remeshing'].oldDomain, domain, density).execute() CopyRemesher(side, p['remeshing'].oldDomain, domain, density).execute() - Therefore, if you have a complex domain, just divide it into the appropriate sides and copy/remesh as you see fit. + Therefore, if you have a complex domain, just divide it into the appropriate sides and copy/remesh as you see fit. However, when you want to remesh one side, copy another side, and that the two sides have a common edge, then you must first use CopyRemesher, then Gen4remesher, in order ensure that the nodes of the edges are also copied and not regenerated ! - + - When you want to remesh one side, copy another side, and that the two sides have a common edge, then you must first use CopyRemesher, then Gen4remesher, in order ensure that the nodes of the edges are also copied and not regenerated !  + ==== Transfinite Meshers ==== ==== Transfinite Meshers ==== Line 434: Line 436: By default, the transfer of data is done using Philippe's complex "FVTM" routine with all its default parameters (see [[doc:user:meshtransfer:datatransferbetweenmeshes]], in French). By default, the transfer of data is done using Philippe's complex "FVTM" routine with all its default parameters (see [[doc:user:meshtransfer:datatransferbetweenmeshes]], in French). - For the advanced user, changing these parameters is possible (in the ''main()'' function of the [[#File 2 : script|script]]) + For the __advanced__ user, changing these parameters is possible (in the ''main()'' function of the [[#File 2 : script|script]]) ==== Changing the transfer method ==== ==== Changing the transfer method ==== Line 466: Line 468: cell.addOption(INTPT_NB, 5) cell.addOption(INTPT_NB, 5) - To understand all these options, please look at [[doc:user:meshtransfer:datatransferbetweenmeshes|Philippe's doc]] + To understand all these options, please look at [[doc:user:meshtransfer:datatransferbetweenmeshes|Philippe's doc]]. ====  Changing the fields to transfer ==== ====  Changing the fields to transfer ==== Line 545: Line 547: Since we conserve the inertial forces and correct the internal ones, this post-remeshing algorithm works quite well for quasi-static and low speed dynamic computations. For high speed dynamic computations, it is best not to use it and simply let the simulation continue. Since we conserve the inertial forces and correct the internal ones, this post-remeshing algorithm works quite well for quasi-static and low speed dynamic computations. For high speed dynamic computations, it is best not to use it and simply let the simulation continue. + + ==== Options ==== + + The complete ''setBalancing'' command is actually + + setBalancing(executeBalancing, velocitiesExtrapolation=True, maxItes=7, balancingTolerance=0.001) + + The first argument has already been described and indicates whether balancing should be done or not. + + For the advanced user, a few options can be played with by changing the three of arguments. + + First of all, it is possible to deactivate the ''stepPredictor()''. If you do not know what it is, do not touch it. If you do, well sometimes, when transfer errors are significant, the balancing can go better if executed without this predictor, so without extrapolating the next step based on velocities and accelerations. This is fine only in quasi-static, because in dynamic computations velocities and accelerations also intervene in the computation of forces. To do so, simply set the second argument to ''False''. If have not investigated this greatly, but I believe that this could be a sign that the mesh of the computation was not fine enough, so activating this option could hide the real problem. I believe it should be reserved for battery tests, because we want to have tests with rather coarse meshes there. + + Second, the number of iterations for each step of the balancing can be changed. By default, seven iterations are tried before increasing the fraction of the unbalanced forces and starting again. + + Finally, the tolerance can also be changed. The parameter $\alpha$, used to ponder the unbalanced forces, starts at 1 and is progressively divided by 2 when a step fails. Once $\alpha$ becomes smaller than the tolerance, the algo stops itself, returns an error, and the temporal integrationdoes not restart. The default value of 0.001 can be changed if needed. + + --- //[[pjoris@ulg.ac.be|Pierre Joris]] 2016/06/13 //