star-meteo

Time varying meteorological data
git clone git://git.meso-star.fr/star-meteo.git
Log | Files | Refs | README | LICENSE

commit 63a679996fac9c23fcb841a9e99c9667d14f8144
parent ad62d440bca5da1d1cb77972f42a24df99c91df1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 14 Aug 2025 11:48:00 +0200

stardis: rm the condition type from the data creation args

It is not necessary to define the type of boundary condition on which
the data will be used, as it is up to the caller (i.e., Stardis) to use
its functions according to the boundary condition they wish to define.

For example, the stardis_boundary_temperature function always returns a
valid temperature and should therefore only be used for Dirichlet
boundary conditions.

If the Stardis plugin data no longer has any arguments, this should not
always be the case. Thus, its data structure and analysis function are
retained, even if they currently do not store or perform any actions, in
order to preserve the overall logic in anticipation of the addition of
arguments.

Diffstat:
Msrc/stardis_smeteo.c | 43+++++--------------------------------------
1 file changed, 5 insertions(+), 38 deletions(-)

diff --git a/src/stardis_smeteo.c b/src/stardis_smeteo.c @@ -13,8 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _POSIX_C_SOURCE 200112L /* getopt */ - #include "smeteo.h" #include "stardis_smeteo.h" #include "stardis_smeteo_library.h" @@ -22,57 +20,26 @@ #include <rsys/algorithm.h> #include <rsys/mem_allocator.h> -#include <getopt.h> - -enum boundary_condition_type { - DIRICHLET, - NEUMANN_ROBIN, - NONE__ -}; - struct boundary_condition { struct stardis_smeteo_lib* lib; struct stardis_smeteo_lib_desc lib_desc; - enum boundary_condition_type type; }; struct args { - enum boundary_condition_type bcond_type; + char dummy; /* No argument yet */ }; -#define ARGS_DEFAULT__ { NEUMANN_ROBIN } +#define ARGS_DEFAULT__ {0} static const struct args ARGS_DEFAULT = ARGS_DEFAULT__; /******************************************************************************* * Helper functions ******************************************************************************/ -static void -usage(FILE* stream, const char* name) -{ - fprintf(stream, "usage: %s [-d]\n", name); -} - static res_T args_init(struct args* args, int argc, char* argv[]) { - int opt = 0; - res_T res = RES_OK; - - ASSERT(args && argc && argv); - - optind = 1; - while((opt = getopt(argc, argv, "d")) != -1) { - switch(opt) { - case 'd': args->bcond_type = DIRICHLET; break; - default: res = RES_BAD_ARG; break; - } - if(res != RES_OK) goto error; - } - -exit: - return res; -error: - usage(stderr, argv[0]); - goto exit; + (void)argc, (void)argv; + *args = ARGS_DEFAULT; + return RES_OK; } static int