Opened 20 years ago

Last modified 19 years ago

#12 closed defect

set_quantity API — at Initial Version

Reported by: ole Owned by: ole
Priority: normal Milestone: ANUGA maintenance
Component: Architecture and API Version:
Severity: normal Keywords:
Cc:

Description

Suggestion for set_quantity

set_quantity(name, X, location, region) where name: Name of quantity X:

-Compatible list,

-compatible list or numeric array, -constant -list of points or array with attribute values (use LS) (How to distinguish this from a numeric array? - perhaps use keyword arguments for everything) -callable object (f: x, y -> z) where x,y,z are arrays

  • inline
  • file functions
  • polygon functions

-another quantity Q or an expression of the form

a*Q+b*R+c, where a,b,c are scalars, arrays or quantities Q,R are quantities (or 1?)

  • pts filename (use LS and caching) (how to select attribute?)
  • general expression to be parsed

location: Where values are to be stored.

Permissible options are: vertices, edges, centroid, unique_vertices

region: Identify subset of triangles. Permissible values are

  • tag name (refers to tagged region)
    • indices (refers to specific triangles)
    • polygon (identifies region)

(incorporate uniqueness/non-uniqueness)

IDEA for set_quantity:

Use keywords and call underlying specific method, e.g.

if filename is not None:

vertex_values = caching( fitfunc, filename, dependencies = ...) set_quantity(..., ..., vertex_values)

elif:

Largely done. Should create class Point_set representing points and attribute(s) Include filename too? Yep (and selected attributes) This could also facilitate use of multiple point sources (e.g. at different resolutions)

Change History (0)

Note: See TracTickets for help on using tickets.