Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Resource
  • Published:

A programmable environment for shape optimization and shapeshifting problems

A preprint version of the article is available at arXiv.

Abstract

Soft materials underpin many domains of science and engineering, including soft robotics, structured fluids, and biological and particulate media. In response to applied mechanical, electromagnetic or chemical stimuli, such materials typically change shape, often dramatically. Predicting their structure is of great interest to facilitate design and mechanistic understanding, and can be cast as an optimization problem where a given energy function describing the physics of the material is minimized with respect to the shape of the domain and additional fields. However, shape-optimization problems are very challenging to solve, and there is a lack of suitable simulation tools that are both readily accessible and general in purpose. Here we present an open-source programmable environment, Morpho, and demonstrate its versatility by showcasing a range of applications from different areas of soft-matter physics: swelling hydrogels, complex fluids that form aspherical droplets, soap films and membranes, and filaments.

This is a preview of subscription content, access via your institution

Access options

Buy this article

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Soap films and membranes.
Fig. 2: Nematic liquid-crystal tactoids.
Fig. 3: Modeling swelling hydrogels under confinement using tetrahedral meshes and level-set constraints.
Fig. 4: Filament on a spherical substrate.
Fig. 5: Level-set methods.

Similar content being viewed by others

Data availability

All data were generated by Morpho from input scripts provided in a separate repository at https://doi.org/10.5281/zenodo.14193815 (ref. 83). Source data are provided with this paper.

Code availability

The Morpho code used for this study is archived with Zenodo at https://doi.org/10.5281/zenodo.14179515 (ref. 43). Updated versions will be available from GitHub at https://github.com/Morpho-lang/morpho. Source code for all examples shown in this publication is provided in a separate repository at https://doi.org/10.5281/zenodo.14193814 (ref. 83). All code is released under an open-source MIT license.

References

  1. Wehner, M. et al. An integrated design and fabrication strategy for entirely soft, autonomous robots. Nature 536, 451–455 (2016).

    Article  MATH  Google Scholar 

  2. Shah, D. S. et al. A soft robot that adapts to environments through shape change. Nat. Mach. Intell. 3, 51–59 (2021).

    Article  MATH  Google Scholar 

  3. Khanra, A. et al. Controlling the shape and topology of two-component colloidal membranes. Proc. Natl Acad. Sci. USA 119, e2204453119 (2022).

    Article  MATH  Google Scholar 

  4. Safdari, M., Zandi, R. & van der Schoot, P. Effect of electric fields on the director field and shape of nematic tactoids. Phys. Rev. E 103, 062703 (2021).

    Article  MATH  Google Scholar 

  5. Ferris, A. J., Rosenblatt, C. & Atherton, T. J. Spontaneous anchoring-mediated topography of an orientable fluid. Phys. Rev. Lett. 126, 057803 (2021).

    Article  Google Scholar 

  6. Cousins, J. R., Duffy, B. R., Wilson, S. K. & Mottram, N. J. Young and Young–Laplace equations for a static ridge of nematic liquid crystal, and transitions between equilibrium states. Proc. R. Soc. A 478, 20210849 (2022).

  7. Silverberg, J. L. et al. Using origami design principles to fold reprogrammable mechanical metamaterials. Science 345, 647–650 (2014).

    Article  MATH  Google Scholar 

  8. Paulose, J., Chen, B. G.-g. & Vitelli, V. Topological modes bound to dislocations in mechanical metamaterials. Nat. Phys. 11, 153–156 (2015).

  9. Goodman-Strauss, C. & Sullivan, J. M. in Discrete Geometry (ed. Bezdek, A.) Ch. 22 (Marcel Dekker, 2003).

  10. Sydney Gladman, A., Matsumoto, E. A., Nuzzo, R. G., Mahadevan, L. & Lewis, J. A. Biomimetic 4D printing. Nat. Mater. 15, 413–418 (2016).

    Article  Google Scholar 

  11. Na, J.-H. et al. Programming reversibly self-folding origami with micropatterned photo-crosslinkable polymer trilayers. Adv. Mater. 27, 79–85 (2015).

    Article  MATH  Google Scholar 

  12. Jensen, K. E. et al. Wetting and phase separation in soft adhesion. Proc. Natl Acad. Sci. USA 112, 14490–14494 (2015).

    Article  MATH  Google Scholar 

  13. Datta, S. S., Preska Steinberg, A. & Ismagilov, R. F. Polymers in the gut compress the colonic mucus hydrogel. Proc. Natl Acad. Sci. USA 113, 7041–7046 (2016).

    Article  Google Scholar 

  14. Xie, Z. & Atherton, T. J. Jamming on convex deformable surfaces. Soft Matter 20, 1070–1078 (2024).

    Article  MATH  Google Scholar 

  15. Keber, F. C. et al. Topology and dynamics of active nematic vesicles. Science 345, 1135–1139 (2014).

    Article  MATH  Google Scholar 

  16. Peterson, M. S. E., Baskaran, A. & Hagan, M. F. Vesicle shape transformations driven by confined active filaments. Nat. Commun. 12, 7247 (2021).

    Article  MATH  Google Scholar 

  17. Hoffmann, L. A., Carenza, L. N., Eckert, J. & Giomi, L. Theory of defect-mediated morphogenesis. Sci. Adv. 8, eabk2712 (2022).

    Article  Google Scholar 

  18. Hawkes, E. et al. Programmable matter by folding. Proc. Natl Acad. Sci. USA 107, 12441–12445 (2010).

    Article  MATH  Google Scholar 

  19. Sethian, J. A. Level Set Methods and Fast Marching Methods: Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision and Materials Sciences (Cambridge Univ. Press, 2010).

  20. Provatas, N. & Elder, K. Phase-Field Methods in Materials Science and Engineering (Wiley, 2010).

  21. Brakke, K. A. The surface evolver. Exp. Math. 1, 141–165 (1992).

    Article  MathSciNet  MATH  Google Scholar 

  22. Brakke, K. A., Klinowski, J. & Mackay, A. L. The Surface Evolver and the stability of liquid surfaces. Philos. Trans. R. Soc. Lond. A 354, 2143–2157 (1996).

  23. Barrata, I. A. et al. DOLFINx: the next generation FEniCS problem solving environment. Zenodo https://zenodo.org/records/10447666 (2023).

  24. Rathgeber, F. et al. Firedrake: automating the finite element method by composing abstractions. ACM Trans. Math. Softw. 43, 1–27 (2016).

    Article  MathSciNet  MATH  Google Scholar 

  25. Laurain, A. A level set-based structural optimization code using fenics. Struct. Multidisc. Optim. 58, 1311–1334 (2018).

    Article  MathSciNet  MATH  Google Scholar 

  26. Paganini, A. & Wechsung, F. Fireshape: a shape optimization toolbox for firedrake. Struct. Multidisc. Optim. 63, 2553–2569 (2021).

    Article  MathSciNet  MATH  Google Scholar 

  27. Rozvany, G. I. A critical review of established methods of structural topology optimization. Struct. Multidisc. Optim. 37, 217–237 (2009).

    Article  MathSciNet  MATH  Google Scholar 

  28. Sigmund, O. A 99 line topology optimization code written in Matlab. Struct. Multidisc. Optim. 21, 120–127 (2001).

    Article  MATH  Google Scholar 

  29. Mohammadi, B. & Pironneau, O. Shape optimization in fluid mechanics. Annu. Rev. Fluid Mech. 36, 255–279 (2004).

    Article  MathSciNet  MATH  Google Scholar 

  30. Mittal, R. & Iaccarino, G. Immersed boundary methods. Annu. Rev. Fluid Mech. 37, 239–261 (2005).

    Article  MathSciNet  MATH  Google Scholar 

  31. Evans, L. C. Partial Differential Equations Vol. 19 (American Mathematical Society, 2022).

  32. Walker, S. W. The Shapes of Things: A Practical Guide to Differential Geometry and the Shape Derivative (SIAM, 2015).

  33. Susanne, C., Brenner, L. & Scott, L. The Mathematical Theory of Finite Element Methods Vol. 15 (Springer, 1994).

  34. Canham, P. B. The minimum energy of bending as a possible explanation of the biconcave shape of the human red blood cell. J. Theor. Biol. 26, 61–81 (1970).

    Article  MATH  Google Scholar 

  35. Helfrich, W. Elastic properties of lipid bilayers: theory and possible experiments. Z. Naturforsch. C 28, 693–703 (1973).

  36. Kamien, R. D. The geometry of soft materials: a primer. Rev. Mod. Phys. 74, 953–971 (2002).

    Article  MATH  Google Scholar 

  37. Nelson, D., Piran, T. & Weinberg, S. Statistical Mechanics of Membranes and Surfaces 2nd edn (World Scientific, 2004).

  38. Powers, T. R., Huber, G. & Goldstein, R. E. Fluid-membrane tethers: minimal surfaces and elastic boundary layers. Phys. Rev. E 65, 041901 (2002).

    Article  MATH  Google Scholar 

  39. de Gennes, P. G. & Prost, J. The Physics of Liquid Crystals (Clarendon Press, 1993).

  40. Lagerwall, J. P. & Scalia, G. A new era for liquid crystal research: applications of liquid crystals in soft matter nano-, bio- and microtechnology. Curr. Appl. Phys. 12, 1387–1412 (2012).

    Article  MATH  Google Scholar 

  41. Prinsen, P. & van der Schoot, P. Shape and director-field transformation of tactoids. Phys. Rev. E 68, 021701 (2003).

    Article  MATH  Google Scholar 

  42. Mottram, N. J. & Newton, C. J. P. Introduction to Q-tensor theory. Preprint at https://arxiv.org/abs/1409.3542 (2014).

  43. Atherton, T. et al. Morpho-lang/morpho: v0.6.1. Zenodo https://doi.org/10.5281/zenodo.14179515 (2024).

  44. Adler, J. H., Andrei, A. S. & Atherton, T. J. Nonlinear methods for shape optimization problems in liquid crystal tactoids. Preprint at https://arxiv.org/abs/2310.04022 (2023).

  45. Ahmed, E. M. Hydrogel: preparation, characterization and applications: a review. J. Adv. Res. 6, 105–121 (2015).

    Article  MATH  Google Scholar 

  46. Bertrand, T., Peixinho, J., Mukhopadhyay, S. & MacMinn, C. W. Dynamics of swelling and drying in a spherical gel. Phys. Rev. Appl. 6, 064010 (2016).

    Article  MATH  Google Scholar 

  47. Azzam, R. A. Polymeric conditioner gels for desert soils. Commun. Soil Sci. Plant Anal. 14, 739–760 (1983).

    Article  MATH  Google Scholar 

  48. Wei, Y. & Durian, D. J. Effect of hydrogel particle additives on water-accessible pore structure of sandy soils: a custom pressure plate apparatus and capillary bundle model. Phys. Rev. E 87, 053013 (2013).

    Article  MATH  Google Scholar 

  49. Kang, M. K. & Huang, R. A variational approach and finite element implementation for swelling of polymeric hydrogels under geometric constraints. J. Appl. Mech. 77, 061004 (2010).

    Article  Google Scholar 

  50. Louf, J.-F., Lu, N. B., O’Connell, M. G., Cho, H. J. & Datta, S. S. Under pressure: hydrogel swelling in a granular medium. Sci. Adv. 7, eabd2711 (2021).

    Article  Google Scholar 

  51. Joshi, C., Giso, M. Q., Louf, J.-F., Datta, S. S. & Atherton, T. J. An energy-optimization method to study gel-swelling in confinement. Soft Matter 19, 7184–7191 (2023).

    Article  Google Scholar 

  52. Quesada-Pérez, M., Maroto-Centeno, J. A., Forcada, J. & Hidalgo-Alvarez, R. Gel swelling theories: the classical formalism and recent approaches. Soft Matter 7, 10536 (2011).

    Article  MATH  Google Scholar 

  53. Plummer, A., Adkins, C., Louf, J.-F., Košmrlj, A. & Datta, S. S. Obstructed swelling and fracture of hydrogels. Soft Matter 20, 1425–1437 (2024).

    Article  Google Scholar 

  54. Swigon, D., Coleman, B. D. & Tobias, I. The elastic rod model for DNA and its application to the tertiary structure of DNA minicircles in mononucleosomes. Biophys. J. 74, 2515–2530 (1998).

    Article  MATH  Google Scholar 

  55. Plumb-Reyes, T. B., Charles, N. & Mahadevan, L. Combing a double helix. Soft Matter 18, 2767–2775 (2022).

    Article  MATH  Google Scholar 

  56. Prasath, S. G., Marthelot, J., Govindarajan, R. & Menon, N. Shapes of a filament on the surface of a bubble. Proc. R. Soc. A 477, 20210353 (2021).

  57. Gibou, F., Fedkiw, R. & Osher, S. A review of level-set methods and some recent applications. J. Comput. Phys. 353, 82–109 (2018).

    Article  MathSciNet  MATH  Google Scholar 

  58. Zhao, H.-K., Merriman, B., Osher, S. & Wang, L. Capturing the behavior of bubbles and drops using the variational level set approach. J. Comput. Phys. 143, 495–518 (1998).

    Article  MathSciNet  MATH  Google Scholar 

  59. Kang, M., Merriman, B. & Osher, S. Numerical simulations for the motion of soap bubbles using level set methods. Comput. Fluids 37, 524–535 (2008).

    Article  MathSciNet  MATH  Google Scholar 

  60. Howard, A. A. & Tartakovsky, A. M. A conservative level set method for N-phase flows with a free-energy-based surface tension model. J. Comput. Phys. 426, 109955 (2021).

  61. Osher, S. & Fedkiw, R. P. Level set methods: an overview and some recent results. J. Comput. Phys. 169, 463–502 (2001).

    Article  MathSciNet  MATH  Google Scholar 

  62. Blackford, L. S. et al. An updated set of basic linear algebra subprograms (BLAS). ACM Trans. Math. Softw. 28, 135–151 (2002).

    Article  MathSciNet  MATH  Google Scholar 

  63. Anderson, E. et al. LAPACK Users’ Guide (SIAM, 1999).

  64. Davis, T. A. Direct Methods for Sparse Linear Systems (SIAM, 2006).

  65. Xing, X. et al. Morphology of nematic and smectic vesicles. Proc. Natl Acad. Sci. USA 109, 5202–5206 (2012).

    Article  MATH  Google Scholar 

  66. Giomi, L. & Desimone, A. Spontaneous division and motility in active nematic droplets. Phys. Rev. Lett. 112, 147802 (2014).

    Article  MATH  Google Scholar 

  67. Maroudas-Sacks, Y. et al. Topological defects in the nematic order of actin fibers as organization centers of hydra morphogenesis. Nat. Phys. 17, 251–259 (2020).

  68. Nystrom, R. Crafting Interpreters (Genever Benning, 2021).

  69. Anderson, E. et al. LAPACK Users’ Guide 3rd edn (Society for Industrial and Applied Mathematics, 1999).

  70. Nocedal, J. & Wright, S. J. Numerical Optimization (Springer, 1999).

  71. Boyd, S., Boyd, S. P. & Vandenberghe, L. Convex Optimization (Cambridge Univ. Press, 2004).

  72. Dalcin, L. D., Paz, R. R., Kler, P. A. & Cosimo, A. Parallel distributed computing using Python. Adv. Water Resour. 34, 1124–1139 (2011).

    Article  Google Scholar 

  73. Balay, S. et al. PETSc: portable, extensible toolkit for scientific computation. Astrophysics Source Code Library ascl:2210.016 (2022).

  74. Emerson, D. B., Farrell, P. E., Adler, J. H., MacLachlan, S. P. & Atherton, T. J. Computing equilibrium states of cholesteric liquid crystals in elliptical channels with deflation algorithms. Liq. Cryst. 45, 341–350 (2018).

    Article  MATH  Google Scholar 

  75. Persistence of Vision Raytracer [computer software] (Persistence of Vision Raytracer, 2004); http://www.povray.org/

  76. Crane, K. Discrete Differential Geometry: An Applied Introduction Notices of the AMS, Communication (CMU School of Computer Science, 2018).

  77. Fernandez-Nieves, A. Microgel Suspensions: Fundamentals and Applications (Wiley, 2011).

  78. Flory, P. J. & Rehner, J. Statistical mechanics of cross-linked polymer networks I. Rubberlike elasticity. J. Chem. Phys. 11, 512–520 (1943).

    Article  MATH  Google Scholar 

  79. Flory, P. J. & Rehner, J. Statistical mechanics of cross-linked polymer networks II. Swelling. J. Chem. Phys. 11, 521–526 (1943).

    Article  MATH  Google Scholar 

  80. Hong, W., Zhao, X., Zhou, J. & Suo, Z. A theory of coupled diffusion and large deformation in polymeric gels. J. Mech. Phys. Solids 56, 1779–1793 (2008).

    Article  MATH  Google Scholar 

  81. Rognes, M. E., Calderer, M.-C. & Micek, C. A. Modelling of and mixed finite element methods for gels in biomedical applications. SIAM J. Appl. Math. 70, 1305–1329 (2009).

    Article  MathSciNet  MATH  Google Scholar 

  82. Sussman, M., Smereka, P. & Osher, S. A level set approach for computing solutions to incompressible two-phase flow. J. Comput. Phys. 114, 146–159 (1994).

    Article  MATH  Google Scholar 

  83. Atherton, T. Morpho-lang/morpho-paper: v1.0. Zenodo https://doi.org/10.5281/zenodo.14193815 (2024).

Download references

Acknowledgements

This material is based on work supported by the National Science Foundation under grant no. ACI-2003820. The funders had no role in study design, data collection and analysis, decision to publish or preparation of the manuscript. T.J.A. thanks the many people who have used various versions of the program or otherwise contributed to the project: C. Moseley, K. Vohra, P. Navarro, H. Ramirez, R. Ong, S. Wufeng, A. Wilson, A. Culbert, A. DeBenedictis, B. Mbanga, C. Burke, I. Hunter, M. Giso, M. S. E. Peterson, Z. Xie, J. E. Flores-Calderón and students from the Tufts Computational Physics course who patiently tried early versions of the code.

Author information

Authors and Affiliations

Authors

Contributions

T.J.A. designed the overall architecture for the Morpho code. T.J.A., C.J. and D.H. contributed to implementation. A.S.A., S.H. and J.H.A. advised on optimization algorithms. C.W. and E.D. developed the tactoid analysis example. E.H. devised the tubule pulling example. C.J. developed the filament and hydrogel examples. All authors prepared the paper.

Corresponding author

Correspondence to Timothy J. Atherton.

Ethics declarations

Competing interests

The authors declare no competing interests.

Peer review

Peer review information

Nature Computational Science thanks the anonymous reviewer(s) for their contribution to the peer review of this work. Primary Handling Editor: Jie Pan, in collaboration with the Nature Computational Science team.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information

Supplementary Video 1

Membrane tether at increasing indentation.

Supplementary Video 2

Swelling hydrogel bead between confining spheres.

Supplementary Video 3

Coiling transition of an elastic filament confined to a curved surface.

Supplementary Video 4

Two-dimensional minimal surface problem solved by a level-set method with finite differences.

Supplementary Video 5

Two-dimensional minimal surface problem solved by a variational level-set method.

Source data

Source Data Fig. 1

Statistical source data.

Source Data Fig. 2

Statistical source data.

Source Data Fig. 3

Statistical source data.

Source Data Fig. 4

Statistical source data.

Source Data Fig. 5

Statistical source data.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Joshi, C., Hellstein, D., Wennerholm, C. et al. A programmable environment for shape optimization and shapeshifting problems. Nat Comput Sci (2024). https://doi.org/10.1038/s43588-024-00749-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1038/s43588-024-00749-7

Search

Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing