Please wait...
×

Error

Posted Fri, 02 Nov 2018 03:00:48 GMT by Ahmad Askar
Is there anyway to assign Heads BC as parameters in Fepest except IFM scripting. If IFM is the only way, is there any prepared script for such issue as it is very common and I have no experience in IFM scripting.
Posted Thu, 06 Dec 2018 23:34:43 GMT by Alex Costall PhD Student
I'd like to know as well. I'm surprised it's not already a feature.
Posted Mon, 17 Dec 2018 16:07:48 GMT by adacovsk
I modified some code from a previous user here years ago, I think his name was Ludwig... You're going to have to switch it to head rather than neumann BC.

[code]flux_in_left, flux_in_right, flux_out[/code] are arrays containing node numbers, representing the neumann BC, for three unique areas on my model. Note that node numbers start from 1 in FEFLOW but 0 in the IFM, I subtract 1 in the code rather than modify the arrays taken from FEFLOW

[code]void CFepestparam::PreEnterSimulator (IfmDocument pDoc)
{
/*
this plug-in allows for boundary conditions to be parameter groups and assigned specific values
normally this is only available for element selections
fpi files contain the names and the values which pest assigns to each parameter group
*/
//Reading the values
//tab corresponds to the number of boundary condition parameter groups
double tab [3]={0.000, 0.000, 0.000};
//parameter group name
string colA;
//parameter group value
double colB;

int i=0;
ifstream inputFile("M:\\femdata\\ifm.fpi");
if (inputFile.is_open())
{
while ((!inputFile.eof())&&(i<sizeof(tab) / sizeof(tab[0])))
{
inputFile>>colA;
inputFile>>colB;
tab[i]=colB;
i++;
}
inputFile.close();
}

double Val_flux_in_left = tab [0];
double Val_flux_in_right = tab [1];
double Val_flux_out = tab [2];

//Assigning the values to the nodes with the flux boundary conditions
for (int i=0;i < sizeof(flux_in_left) / sizeof(flux_in_left[0]) -1; i++)
{
IfmSetBcFlowTypeAndValueAtCurrentTime(pDoc, flux_in_left[i]-1, IfmBCC_NEUMANN, 0, Val_flux_in_left);
}
for (int i=0;i < sizeof(flux_in_right) / sizeof(flux_in_right[0])-1; i++)
{
IfmSetBcFlowTypeAndValueAtCurrentTime(pDoc, flux_in_right[i]-1, IfmBCC_NEUMANN, 0, Val_flux_in_right);
}
for (int i=0;i < sizeof(flux_out) / sizeof(flux_out[0])-1; i++)
{
IfmSetBcFlowTypeAndValueAtCurrentTime(pDoc, flux_out[i]-1, IfmBCC_NEUMANN, 0, Val_flux_out);
}
/*Writing values to file
ofstream myfile;
myfile.open ("M:\\femdata\\example.txt");
myfile << tab[0] << endl << tab[1] << endl << tab[2];
myfile.close();
*/
}[/code]

You must be signed in to post in this forum.