Commit Graph

120 Commits

Author SHA1 Message Date
Bård Skaflestad
b8806b475d Fix use-of-uninitialised bug in derivation of coarse-block
inner-product matrix.

  Pointy hat: bska
2010-09-06 15:34:27 +00:00
Bård Skaflestad
d316d03f18 Tentative implementation of coarse-sys block contributions. 2010-09-06 15:23:46 +00:00
Bård Skaflestad
2326275d6f Add tentative type definition for coarse-system management. 2010-09-02 16:26:37 +00:00
Bård Skaflestad
94d4adbb6b Add local definition of MAT_SIZE_T, contingent upon preprocessor
symbol 'MATLAB_MEX_FILE' that is automatically defined by MATLAB's
  MEX function.

  Add declarations for factorisation, lin-sys solution, and matrix
  inversion for (symmetric) positive definite full matrices in full
  and packed formats.  Will be used in the coarse-system assembly
  process.
2010-09-02 16:25:29 +00:00
Jostein R. Natvig
0734f8d842 Add copy of (proposed) grid structure. 2010-08-31 14:09:05 +00:00
Bård Skaflestad
4f1939b81b Don't use cutesy contractions in error messages. Refer to the same
parameter names as in the documentation.
2010-08-31 14:00:43 +00:00
Bård Skaflestad
25d4faadc7 Document 'expected_nconn' parameter. Export topo->subfacepos and
topo->subfaces if expected_nconn>0.
2010-08-31 13:15:52 +00:00
Bård Skaflestad
c324097c63 Don't generate "negative" indices (size_t's) whilst double-probing
the set.  Allow 'm' table-lookups (i==m is valid).  Full table
  detected by inspecting final s[j].  Finally, hash_set_insert_core()
  does not return the key but rather the index at which the key was
  inserted.  Update assertion in hash_set_expand() to respect this
  property.

  Also, for increased transparency during debugging, assign
  intermediate quantities of the hash function to separate variables.
2010-08-31 12:27:21 +00:00
Bård Skaflestad
d4f13d3411 Suppress signed/unsigned comparison warnings. 2010-08-31 08:12:07 +00:00
Bård Skaflestad
11c12f8fb6 Fix egregious off-by-one. Now generates coarse grid for 1.122e6
Cartesian cells in 0.1 seconds on a laptop computer.
2010-08-31 01:40:05 +00:00
Bård Skaflestad
2dd2b8d6aa Spell 'API' correctly. 2010-08-30 21:48:26 +00:00
Bård Skaflestad
14f2011baa Add MEX auto-build support for function 'mex_generate_coarsegrid'. 2010-08-30 21:43:39 +00:00
Bård Skaflestad
e0c6e24ab7 Correct a number of small, but crucial, mistakes:
- Initialise new neighbours to INT_MIN rather than -1.  The latter
      is a valid block (the outside) and it is better to properly
      distinguish unset values from boundary blocks.

    - Ensure NULL-initialisation of a block's neighbour structure when
      this structure has just been allocated.

    - Adjust bin-search algorithm to support i==nneigh (target larger
      than all existing neighbouring blocks).

    - This means that if i==nneigh, then we must take precaution so as
      not to reference any invalid table elements.  However, an
      explicit check for i<nneigh means that the semantics of the
      memmove() statement becomes more transparent.

    - Finally, we must properly assign the 'nblocks' and 'nfaces'
      fields of the struct coarse_topology before returning to caller.
2010-08-30 21:42:52 +00:00
Bård Skaflestad
9cdeab3f04 For the pow2(n)'th time: MATLAB indices are one-based... 2010-08-30 21:32:49 +00:00
Bård Skaflestad
f7fe7325b8 Add MEX gateway to C subroutine for generating coarse-grid topologies. 2010-08-30 16:52:20 +00:00
Bård Skaflestad
9cd8f309c3 Announce and implement the public interface for deriving coarse-grid
topology from a fine-grid topology and a partition vector.
2010-08-30 16:51:25 +00:00
Bård Skaflestad
424e919a64 Correctly define the 'b' field of a new block-to-block coarse-scale
connection.
2010-08-29 22:00:03 +00:00
Bård Skaflestad
2391437b3b Add first, untested, edition of code for creating and updating a
block-to-block coarse-scale connection with optional fine-scale
  constituents.
2010-08-29 21:54:11 +00:00
Bård Skaflestad
3d316e6279 Insert summary comments. 2010-08-29 20:01:43 +00:00
Bård Skaflestad
1489e72bc4 Stop-gap implementation of coarse-to-fine connection topology.
Unfinished.
2010-08-27 12:35:13 +00:00
Bård Skaflestad
0c6a564cbb Move hash.c to coarse_conn.c to reflect new responsibilities. 2010-08-27 08:52:00 +00:00
Bård Skaflestad
ae8742b692 Usurp public hash table interface into hash.c . The module is
created for a single purpose: A poor-man's replacement for a
  hash-set used in deriving coarse-grid connections from fine-scale
  connectivity.
2010-08-27 07:37:49 +00:00
Bård Skaflestad
ecb9f57632 Remove a file whose purpose was entirely unclear. Sorry about the churn. 2010-08-27 06:56:34 +00:00
Bård Skaflestad
60755c9f1e Add initial infrastructure for deriving coarse grid connections from
a fine-scale neighbourship definition.
2010-08-26 16:58:21 +00:00
Bård Skaflestad
c2411ab098 Add MEX auto-build support for function 'mex_partition_process'. 2010-08-20 21:45:30 +00:00
Bård Skaflestad
4b7a67de8e Silence compiler by adding prototype for dfs() (i.e., #include
"dfs.h").  Also, don't require build(er|system) to always #define
  the preprocessing symbol "TEST" (to a zero or non-zero value).
2010-08-20 21:44:49 +00:00
Bård Skaflestad
23eebb5d2c Assert copyright for 2010. 2010-08-20 19:16:59 +00:00
Bård Skaflestad
ce6016c9b1 M-x delete-trailing-whitespace . 2010-08-20 19:05:27 +00:00
Bård Skaflestad
66369d49ff Correct a supremely embarrassing typo: When counting the number of
cell-to-cell connections (i.e., when calling count_block_conns()),
  inspect the pointer array (pc2c) rather than the cell array itself
  (c2c).  Clue-by-four supplied by gdb(1).

  Move self connection handling to partition_create_c2c().

  Adjust dfs() 'work' array size to comply with new requirements of
  -r5088.
2010-08-20 17:24:26 +00:00
Bård Skaflestad
7645981d14 Adjust for M's 1-based indexing in the 'neighbours' connection
array [%]

  Assign results to plhs[0] (and print diagnostic).
2010-08-20 17:19:37 +00:00
Jostein R. Natvig
87949a432e Fix embarrasing error. 2010-08-20 14:18:22 +00:00
Bård Skaflestad
9ca7ff4191 Add files missing in -c5083.
Pointy hat: bska
2010-08-19 22:30:54 +00:00
Bård Skaflestad
58a79e9f4d Install support for creating block-internal connection structures.
Not functional atm.
2010-08-19 22:30:10 +00:00
Bård Skaflestad
9ba8749ed8 The file 'partition.c' now depends on 'dfs.c'. Add to build system. 2010-08-19 22:29:12 +00:00
Bård Skaflestad
b160856ec3 Add stub implementation of algorithm for splitting blocks.
Currently lacks the construction of block-internal connections but
  does at least build.

  Not tested.
2010-08-19 16:33:13 +00:00
Jostein R. Natvig
bea6bcaccb Four-space indentation. 2010-08-19 11:02:50 +00:00
Jostein R. Natvig
fe319fbbef Add comment. 2010-08-19 10:52:10 +00:00
Jostein R. Natvig
4519ce2b7c A depth-first graph traversal to find connected components of graph. 2010-08-19 10:46:58 +00:00
Bård Skaflestad
5b673a4960 Be more explicit on the significance of the start pointers for 1:nbin. 2010-08-18 19:16:14 +00:00
Bård Skaflestad
28e6e730db Implicit int went the way of the dodo in 1999. Catch up to this fact. 2010-08-18 16:22:35 +00:00
Bård Skaflestad
a0f013e05f Provide an H1 lines in closer proximity to reality. 2010-08-18 15:08:13 +00:00
Bård Skaflestad
d12bc05d86 Add MEX support for inverting cell-to-block mappings (i.e.,
partition vectors) to create block-to-cell mappings.
2010-08-18 15:04:33 +00:00
Bård Skaflestad
a98073072f Update to new hybsys_* calling conventions. 2010-08-18 09:04:34 +00:00
Bård Skaflestad
be27b881e2 Remove unused variables. 2010-08-18 08:55:14 +00:00
Bård Skaflestad
4013dec710 Support empty grids. 2010-08-18 08:50:26 +00:00
Bård Skaflestad
1f8773b5e7 Solve the "No Type" problem more generally. 2010-08-18 08:46:56 +00:00
Bård Skaflestad
e7155b332a Add documentation, support multiple grid components and '.type' field. 2010-08-18 08:37:40 +00:00
Bård Skaflestad
8df4a5f14b Add rudimentary MEX support for computing non-symmetric (i.e.,
compressible) cell contributions.
2010-08-18 08:19:36 +00:00
Bård Skaflestad
47abc777e7 Aesthetics. Check malloc() status in same sequence as attempted
field allocations.
2010-08-18 07:07:07 +00:00
Bård Skaflestad
2e667bcfee Remove EOL whitespace overlooked in r5056. 2010-08-17 15:48:15 +00:00