solving M nonlinear PDE


90
views
0
7 weeks ago by
Hi
I would like to write a general program to solve M nonlinear PDE with Fenics with B.Cs and I.Cs. But for each test case, I have to change my code because of the number of PDEs changes (changing the number of the test functions, weak formulation or mixed form ). I would be appreciated if suggest a way to write a general code without a lot of changes.
Best Wishes
Mohsen
Community: FEniCS Project

1 Answer


0
22 days ago by
Hello,


I would do something like this:

...
element_family = FiniteElement(CG,mesh.ufl_cell(), 1)
list_fe = []
for i in range(0, M):
    list_fe.append(element_family)
mixed_function_space = MixedElement(list_fe)
me_fe = FunctionSpace(mesh, mixed_function_space)
...



Hope it helps,

Regards, Leonardo
Please login to add an answer/comment or follow this question.

Similar posts:
Search »