Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Morpho v0.6.0 #247

Merged
merged 388 commits into from
Apr 1, 2024
Merged

Morpho v0.6.0 #247

merged 388 commits into from
Apr 1, 2024

Conversation

softmattertheory
Copy link
Contributor

Move v0.6.0 into main.

Morpho now built as a shared library

Rather than the previous monolithic strucutre, the Morpho codebase has been divided into a shared library ("libmorpho") and a terminal application ("morpho-cli"). This means that Morpho can easily be embedded in other applications, and improves maintainability as these components can be updated separately. Morphoview has been migrated to a separate repository.

Internal improvements

  • Major code reorganization to improve the logical structure and maintainability of the morpho codebase.
  • Transitioned to Cmake build system to improve cross-platform compilation.
  • Rewritten parser to improve error reporting and enable reuse across Morpho.

Improved quadrature

Functionals like LineIntegral, AreaIntegral and VolumeIntegral can now make use of a greatly improved quadrature routine. This will become the default in future versions of Morpho. Particularly in 3D, the new routine offers significantly improved performance, and can be extended in future. To use the new quadrature routine simply set the method optional argument:

var a = AreaIntegral(integrandfn, method = {})

The method Dictionary can specifically request particular quadrature rules or orders; more information will be in the dev guide.

Namespaces

You can now use the import keyword with a new keyword, as, to import the contents of a module into a given namespace:

import color as col

print col.Red 

This helps Morpho programs avoid library conflicts and improves modularization.

Tuple data type

Morpho now supports Tuples, an ordered immutable collection. The syntax is similar to Python:

var t = (0,1,2,3)

Tuples act much like Lists, but can be used as keys in a Dictionary.

JSON import and export

Morpho now provides a JSON class which supports import and output using the JavaScript Object Notation (JSON) format, widely used for data interchange.

var a = JSON.parse("[1,2,3]")
print a 

Minor new features

  • Formatted output for numbers is now available using the format method on the Int and Float classes.
  • Errors can now be raised as "warnings", which are alerts to the user that do not interrupt execution.

Improved documentation

Many previously un- or under-documented features have now been added to the interactive help. If you notice something that isn't well documented, please alert us via the issue tracker in Github.

Minor fixes

  • Many improvements to the debugger, including better support for printing object properties.
  • Improved calculation of derivatives.
  • Bugfixes to closures, string interpolation, parallel force and energy calculations and many others.

softmattertheory and others added 30 commits August 7, 2023 11:49
Reset object definition counter to enable morpho_initialize/finalize to be called more than once.
Errors and warnings have similar interface; both have a generic interface given an error struct, and a specialized interface that fetches the error and fills out missing info. ERROR_WARNINGs are always raised as warnings not errors.
@softmattertheory softmattertheory merged commit 618b6c9 into main Apr 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants