# 11.07.2006

term types:
===========
- discrete weak - (test, unknown) pair + other args, assembled,
  result is vector (or matrix when diffenrentiating)
- discrete integral - not assembled, result is scalar

term arguments passed via a dictionary **kwargs
key == term name as used in equations

argument types:
===============
  - variables
  - materials
  - misc
    - flags (scalars)
    - characteristic functions
    - ...

  state = {some of variables}

materials
=========
  - in list of materials ML
  - updated in time stepper
  - each term has indices into ML
  => argument = ML

misc
====
  argument = misc

variables
=========
  - finite element based (having approximation, nodes, connectivity...)
    = FE fields
    how to deal with non-uniform approximation (e.g. par subdomain)?
    - unknown fields (-> state)
    - parameter fields (name not important - e.g. 'meshVField'
    => argument = variable definition + (vector, offset)
    - test fields - virtual - not present as vectors!
      - action just through their bases
    => argument = variable definition
  - scalars (-> state)
    => argument = variable definition + (vector, offset)
    (offset into global state vector)

  solvers use state variables in a vector only!

example defs:
=============

'fld_3_velocity':
-----------------
# flags: ExtraCoor, GeomDependent, BQP
dim = (3,1)
flags = ('GeomDependent', 'BQP')

approximations = {
    6 : (('3_velocity', 'fld_3_velocity', '3_4_P1B'),
         ('pressure', 'fld_pressure', '3_4_P1'))
}

variables = {
    'u' : ('parameterField', '3_velocity', (3, 4, 5)),
    'w' : ('unknownField', '3_velocity', (3, 4, 5)),
    'v' : ('testField', '3_velocity', (3, 4, 5)),
    'p' : ('unknownField', 'pressure', (9,)),
    'q' : ('testField', 'pressure', (9,)),
    'Nu' : ('meshVField', 'pressure', (3, 4, 5)),
}

new input:
==========

field_1 = {
    'name' : '3_velocity',
    'dim' : (3,1),
    'flags' : ('BQP',), # 'GeomDependent' should go into variable!
    'bases' : (('region_1000', '3_4_P1B'),)
}

field_2 = {
    'name' : 'pressure',
    'dim' : (1,1),
    'flags' : (),
    'bases' : (('region_1000', '3_4_P1'),)
}

variables = {
    'u' : ('field', 'parameter', '3_velocity', (3, 4, 5)),
    'w' : ('field', 'unknown', '3_velocity', (3, 4, 5)),
    'v' : ('field', 'test', '3_velocity', (3, 4, 5)),
    'p' : ('unknownField', 'pressure', (9,)),
    'q' : ('testField', 'pressure', (9,)),
    'Nu' : ('meshVField', 'pressure', (3, 4, 5)),
}
