Is there a way to apply several boundary condition on the same mesh with new dolfin version ?
Dear all,
I use FEniCS with c++ interface to solve multiscale FEM. I only succeed with version 1.0 because
I need to define two or more periodic boundary conditions on the same mesh. It seems to be impossible
with the new version.
Is there a way to apply more than one boundary condition on the same mesh in version 1.2 ?
For example in the version 1.0 I define two sub-domains for a UnitSquare mesh :
/**
* Sub-domain to define the periodicity for height.
*
*/
bool MicroScale:
return fabs(x[1]) < 0.00005;
}
void MicroScale:
y[0] = x[0];
y[1] = x[1] - 1;
}
/**
* Sub-domain to define the periodicity for width.
*
*/
bool MicroScale:
return fabs(x[0]) < 0.00005;
}
void MicroScale:
y[0] = x[0] - 1;
y[1] = x[1];
}
\\And then, later in the code I declare the two periodic boundary conditions :
// Set up boundary condition for height
PeriodicSubdoma
PeriodicBC pbch(V, psh);
// Set up Boundary condition for width
PeriodicSubdoma
PeriodicBC pbcw(V, psw);
// Collect boundary conditions
std::vector<const BoundaryCondition*> bcs;
bcs.push_
bcs.push_
// Define variational problem
//[...] I skip the definition part cause it is not really interesting, I think.
LinearVariation
It works perfectly well with this version, but when I try to do it in version 1.1,
an error occurs. I can only use one boundary condition. (I haven't try yet with the version 1.2).
And I have an other problem: is there a way to replace the second part of equation u(X) - u(X') = 0 in the new version ?
I need to replace the 0 by another member.
For the second question, I can modify the periodic boundary myself, if there is no other solution,
but the first question is a real problem for me. I can't update my version.
thank you for your help and your attention,
Abdallah.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Abdallah Ben Othman for more information if necessary.