sfepy/sfepy — Issue #113: Add pre_processor
Author: rc
Created: 2012-01-30 10:26:31+00:00
State: open

Add pre_processor hook to query the mesh before the problem is executed.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=111

earlier comments

robert.cimrman said, at 2010-04-09T10:48:28.000Z:

I would implement the following:

filename_mesh = 'get_mesh'

where get_mesh is a name of function taking no arguments, that either loads, or
generates the mesh. The function would have to be registered by using the 'functions'
keyword, as usual.

Is that what you want?

freevryheid said, at 2010-04-09T12:55:23.000Z:

Yes - this would resolve the issue. Thanks

robert.cimrman said, at 2010-04-10T15:33:48.000Z:

It's at the github site [1] - if it works for you, I will push it to the master repo
and close the issue.

Look at tests/test_meshio.py (line 16 and below) for an example. In a normal problem
definition file, just write:

def mesh_hook(mesh, mode):
...

filename_mesh = mesh_hook

[1] http://github.com/rc/sfepy