• Re: 64 bit compilation VC++ 2010 Pro

    Thanks Peter!
  • IfmSetMatUnsatFittingExponent - working as intended?

    Hi FEFLOW forum,

    I am developing a module that carries out Markov Chain Monte Carlo inversion of observed drained volumes of water from columns of sediment. The model utilizes the Van Genuchten model for the variably saturated zone. In the inversion scheme I need to pertubate model parameters randomly and then set the updated parameter values for all elements in the model. I do this successfully for all parameters except the "fitting exponent" n in the VG model. I use the IfmSetMatUnsatFittingExponent() function and [u]using the inspector I can see that the value is set correctly[/u] however simulation results are non consistent (negative drainage). Omitting the line of code containing IfmSetMatUnsatFittingExponent(...) solves all problems. I use the function like this:

      for(j = 0; j < NELE; j++)
      {
        ..
        IfmSetMatUnsatFittingExponent(pDoc,j,p_try[6]);  //Bad!
        ..
      }

    p_try is the trial parameter vector and NELE is the total number of elements in the model.

    It works like a charm with other similar functions like e.g. IfmSetMatUnsatFittingCoefficient() but perhaps I am using it wrong? Or could there be a bug in the API function? 

    Thanks in advance and best regards :)
    Søren
  • Re: 64 bit compilation VC++ 2010 Pro

    Thanks Alexander.

    The dll is created but I get the following errormessage "Invalid registration procedure: "RegisterModule"!" in FEFLOW (both Classic and the new version) when trying to load the dll as a module. The problem occurs when compiling both 32 and 64 bit using VC++ 2010 and using the FEFLOW IFM template as described in the manual. Manual registration using the command prompt yields the same error.
  • Re: 64 bit compilation VC++ 2010 Pro

    I managed to resolve some of the issues myself but I am left with the following errors:

    1>------ Rebuild All started: Project: ifm, Configuration: Debug X64 ------
    1>Build started 22-02-2011 10:08:16.
    1>_PrepareForClean:
    1>  Deleting file "X64\Debug\ifm.lastbuildstate".
    1>InitializeBuildStatus:
    1>  Creating "X64\Debug\ifm.unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>ClCompile:
    1>  ifc_pch.c
    1>  ifc_alloc.c
    1>  ifc_amr.c
    1>  ifc_archive.c
    1>  ifc_assert.c
    1>  ifc_bc.c
    1>  ifc_bcc.c
    1>  ifc_bhe.c
    1>  ifc_budg.c
    1>  ifc_compat.c
    1>  ifc_content.c
    1>  ifc_ctrl.c
    1>  ifc_diagram.c
    1>  ifc_file.c
    1>  ifc_fracs.c
    1>  ifc_graphic.c
    1>  ifc_grp.c
    1>  ifc_mat.c
    1>  ifc_module.c
    1>  ifc_obs.c
    1>  ifc_power.c
    1>  ifc_profile.c
    1>  ifc_refdistr.c
    1>  ifc_regio.c
    1>  ifc_res.c
    1>  ifc_strings.c
    1>  ifc_time.c
    1>  ifc_topo.c
    1>  ifc_win32.c
    1>  ifc_xdk.c
    1>Lib:
    1>  ifm.vcxproj -> C:\Users\Public\Documents\WASY FEFLOW 6.0\sdk\ifm\lib\vc10\X64\Debug\ifm.lib
    1>FinalizeBuildStatus:
    1>  Deleting file "X64\Debug\ifm.unsuccessfulbuild".
    1>  Touching "X64\Debug\ifm.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:01.34
    2>------ Rebuild All started: Project: TVBC, Configuration: Debug X64 ------
    2>Build started 22-02-2011 10:08:18.
    2>_PrepareForClean:
    2>  Deleting file "X64\Debug\TVBC.lastbuildstate".
    2>InitializeBuildStatus:
    2>  Touching "X64\Debug\TVBC.unsuccessfulbuild".
    2>ClCompile:
    2>  TVBC.cpp
    2>Link:
    2>  TVBC.vcxproj -> C:\Users\Public\Documents\WASY FEFLOW 6.0\TVBC\X64\Debug\TVBC.dll
    2>Manifest:
    2>  Deleting file "X64\Debug\TVBC.dll.embed.manifest".
    2>LinkEmbedManifest:
    2>  TVBC.vcxproj -> C:\Users\Public\Documents\WASY FEFLOW 6.0\TVBC\X64\Debug\TVBC.dll
    2>PostBuildEvent:
    2>  Description: Registering IFM plug-in...
    2>  *** FEFLOW Error ***
    2>    Invalid registration procedure: "RegisterModule"!
    2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command ""C:\Program Files\WASY\FEFLOW 6.0\\bin64\feflow60c.exe" -ifmregister -module "C:\Users\Public\Documents\WASY FEFLOW 6.0\TVBC\X64\Debug\TVBC.dll"
    2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 1.
    2>
    2>Build FAILED.
    2>
    2>Time Elapsed 00:00:01.09
    ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

    Apparently the module will not register. I tried to remove the double slash and the doube quote in this string ""C:\Program Files\WASY\FEFLOW 6.0\\bin64\feflow60c.exe" in Properties->Build events->Post Build events (in VC++) but with no result.

    Regards,
    Søren
  • 64 bit compilation VC++ 2010 Pro

    Hi WASY,

    I have an existing 32 bit IFM module that works as intended on Windows XP 32 bit. Due to a recent upgrade in hardware I now need to compile the module for FEFLOW 64 bit using Windows 7 64 bit Enterprise. To do so I use Microsoft VC++ 2010 Professional. I have changed the neccesary settings/options/preferences so that the compiler is set to x64 in accordance with the pdf IFM example guide (which appears to very obsolete). I even created a new module in FEFLOW 64 bit so that I could simple copy-paste the code from the original module into the new source file (the part of the code written by me - not the code generated automatically by FEFLOW on module creation). 

    This however does not work.

    I get the following errors when compiling:

    1>------ Rebuild All started: Project: ifm, Configuration: Debug X64 ------
    1>Build started 21-02-2011 11:43:47.
    1>_PrepareForClean:
    1>  Deleting file "X64\Debug\ifm.lastbuildstate".
    1>InitializeBuildStatus:
    1>  Creating "X64\Debug\ifm.unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>ClCompile:
    1>  ifc_pch.c
    1>  ifc_alloc.c
    1>  ifc_amr.c
    1>  ifc_archive.c
    1>  ifc_assert.c
    1>  ifc_bc.c
    1>  ifc_bcc.c
    1>  ifc_bhe.c
    1>  ifc_budg.c
    1>  ifc_compat.c
    1>  ifc_content.c
    1>  ifc_ctrl.c
    1>  ifc_diagram.c
    1>  ifc_file.c
    1>  ifc_fracs.c
    1>  ifc_graphic.c
    1>  ifc_grp.c
    1>  ifc_mat.c
    1>  ifc_module.c
    1>  ifc_obs.c
    1>  ifc_power.c
    1>  ifc_profile.c
    1>  ifc_refdistr.c
    1>  ifc_regio.c
    1>  ifc_res.c
    1>  ifc_strings.c
    1>  ifc_time.c
    1>  ifc_topo.c
    1>  ifc_win32.c
    1>  ifc_xdk.c
    1>Lib:
    1>  ifm.vcxproj -> C:\Users\Public\Documents\WASY FEFLOW 6.0\sdk\ifm\lib\vc10\X64\Debug\ifm.lib
    1>FinalizeBuildStatus:
    1>  Deleting file "X64\Debug\ifm.unsuccessfulbuild".
    1>  Touching "X64\Debug\ifm.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:01.26
    2>------ Rebuild All started: Project: TVBC, Configuration: Debug x64 ------
    2>Build started 21-02-2011 11:43:49.
    2>_PrepareForClean:
    2>  Deleting file "x64\Debug\TVBC.lastbuildstate".
    2>InitializeBuildStatus:
    2>  Touching "x64\Debug\TVBC.unsuccessfulbuild".
    2>ClCompile:
    2>  TVBC.cpp
    2>Link:
    2>    Creating library C:\Users\SEP\Documents\FEFLOW IFM Projects\TVBC\x64\Debug\TVBC.lib and object C:\Users\SEP\Documents\FEFLOW IFM Projects\TVBC\x64\Debug\TVBC.exp
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmRegisterProc referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetPrimarySource referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetHtmlPage referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetCopyrightPath referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetDescriptionString referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmRegisterModule referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmModuleVersion referenced in function RegisterModule
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetBorderNode referenced in function "void __cdecl OnEditDocument(struct IfmModuleStruct *,struct _WidgetRec *)" (?OnEditDocument@@YAXPEAUIfmModuleStruct@@PEAU_WidgetRec@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmInfo referenced in function "void __cdecl OnEditDocument(struct IfmModuleStruct *,struct _WidgetRec *)" (?OnEditDocument@@YAXPEAUIfmModuleStruct@@PEAU_WidgetRec@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetNumberOfBorderNodes referenced in function "void __cdecl OnEditDocument(struct IfmModuleStruct *,struct _WidgetRec *)" (?OnEditDocument@@YAXPEAUIfmModuleStruct@@PEAU_WidgetRec@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetResultsFlowHeadValue referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetBccFlowTypeAndValueAtCurrentTime referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetResultsYVelocityValue referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetResultsXVelocityValue referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetBccFlowType referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetBcFlowType referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetBcMassTypeAndValueAtCurrentTime referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmSetBcFlowTypeAndValueAtCurrentTime referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetY referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetX referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetCurrentTimeIncrement referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>TVBC.obj : error LNK2019: unresolved external symbol IfmGetAbsoluteSimulationTime referenced in function "void __cdecl PreTimeStep(struct IfmModuleStruct *)" (?PreTimeStep@@YAXPEAUIfmModuleStruct@@@Z)
    2>C:\Users\SEP\Documents\FEFLOW IFM Projects\TVBC\x64\Debug\TVBC.dll : fatal error LNK1120: 22 unresolved externals
    2>
    2>Build FAILED.
    2>
    2>Time Elapsed 00:00:00.79
    ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

    I can't seem to find a guide on how to set this up in VC++ 2010 allthough one is mentioned here http://www.feflow.info/html/help/default.htm?turl=HTMLDocuments%2Fmorehelp%2Fdocumentation.htm (can't seem to download it anywhere). Will I need the 2008 version to make this work?

    Thanks in advance!

    Regards,
    Søren
  • Re: Setting the slice number

    Thank you Peter - it was very useful :)
  • Setting the slice number

    I am using a 3D FEFLOW model to simulate fluid flow and density-dependent solute transport in a contaminated aquifer. Decontamination is done by injecting a "cleaning" agent into the aquifer by employing various pumping schemes. One scenario involves switching between injection and water abstraction at two wells over time. Thus, one well injects the cleaning agent while another well abstracts water some distance away. At a later point in time the injection well is switched to an abstraction well while at the same time switching the other well (abstraction well) to an injection well.

    In FEFLOW, this pumping scheme can not be handled by powerseries alone because the specified concentration boundary at the injection well must be removed once the well is switched to an abstraction well and reset once it is switched back to injection (or am I wrong?). This is easily accomplished for a single slice with an IFM module but my problem is that I want to remove/set the boundary condition for all slices that involve the well-screen. I have checked the available IFM functions (and this forum) but none of them seem to give the option to switch between slices/layers. I was hoping for a function that would have the name ifmSetSliceNumber or something similar. I am pretty sure that the solution is straightforward but I just can seem to work it out. I am sorry if this topic is covered in another thread.

    Thanks in advance!
    Søren
  • 3D reference distribution export

    I am using a 3D FEFLOW model to study the capture zone due to water abstraction in buried valley structures in the Danish area. I have aligned the gravitation vector with the (negative) y-axis from considerations about flexibility. I need to produce difference maps of hydraulic head in 3D.

    I have managed to create a reference distribution from the initial values and to contour the difference in hydraulic heads. However, I cant seem to figure out how to export these differences for the entire model (to an outputfile). I can only export results from one slice at a time. Exporting nodal values from one slice at a time when working with more than hundred slices is too cumbersome.

    How do I export model results for all slices at once?

    Thanks in advance!
    Søren
  • Re: Power function boundary conditions

    Will do.

    Thank you Peter!
  • Power function boundary conditions

    I am working with oscillating boundary conditions in FEFLOW. I use the power function tool to set a specified transient head boundary from a timeseries based on a sine curve. I use a free and moveable or the phreatic surface condition at the watertable. The problem is that when I monitor heads on the head-specified boundary nodes they are not consistent with the input values. E.g. the observed head on the boundary node is lagged and never reaches the full amplitude of the sine curve. The lag problem seems to occur in the first couple of timesteps where the head differs significantly from what is prescribed in the timeseries. The amplitude problem persists throughout the simulated period. I have tried to include a long timeseries including several oscillations and then start the model in the "middle" of the power function timeperiod in order to make sure that any interpolation of the sine curve is correct at each end of the period. I have tried different types of interpolation (Akima, Constant, etc etc). None of these approaches seem to help. Can anyone help me?

    Thanks in advance!

    Regards,
    Søren