Dear Anne-Cecile

In a first look it seems correct for homogeneous Dirichlet condition.

For non homogeneous Dirichlet conditions you do not need the partial
mesh_fem, just define

mfpb = gf.MeshFem(meshb, 1)

mfpb.set_classical_fem(press_fem_order)

but then you need to define and use a multiplier variable in the model:

md.add_initialized_data("p_atm", ....)

md.add_fem_variable('p', mfpb)
md.add_filtered_fem_variable('multp', mfpb, DPB)
md.add_linear_generic_assembly_brick(mim, "(p-p_atm)*multp", DPB)

You can see a similar example here:
https://git.savannah.nongnu.org/cgit/getfem.git/tree/contrib/continuum_mechanics/plasticity_finite_strain_linear_hardening_tension_3D.py

BR
Kostas

On Thu, Nov 18, 2021 at 9:16 PM Lesage,Anne Cecile J <
ajles...@mdanderson.org> wrote:

> Dear all
>
>
>
> If I want to define a set of points with Dirichlet boundary conditions on
> a scalar unknown (pressure), are the following python script lines correct
> (using numpy here)?
>
>
>
> *import numpy as np*
>
>
>
> *DPB = 2  # dirichlet on pressure brain*
>
> *print('Read DIRICHLET boundary condition cranio');*
>
> *# read dirichlet conditions on pressure*
>
> *filecranio = open('craniopdir.txt', 'r') # 'r' = read*
>
> *pidcranio = np.loadtxt(filecranio,dtype=int)*
>
> *#print(pidcranio)*
>
> *filecranio.close()*
>
> *fcranio=meshb.faces_from_pid(pidcranio)*
>
> *meshb.set_region(DPB,fcranio)*
>
>
>
>
>
> *mfpb_ = gf.MeshFem(meshb, 1)*
>
> *mfpb_.set_classical_fem(press_fem_order)*
>
> *keptdofs = np.arange(mfpb_.nbdof())*
>
> *keptdofs = np.setdiff1d(keptdofs, mfpb_.basic_dof_on_region(DPB))*
>
> *mfpb = gf.MeshFem("partial", mfpb_, keptdofs)*
>
>
>
> How to set up that on these faces/nodes the pressure is non zero (p0=
> atmospheric pressure)?
>
>
>
> Thank you
>
> Regards
>
> Anne-Cecile
>
>
> The information contained in this e-mail message may be privileged,
> confidential, and/or protected from disclosure. This e-mail message may
> contain protected health information (PHI); dissemination of PHI should
> comply with applicable federal and state laws. If you are not the intended
> recipient, or an authorized representative of the intended recipient, any
> further review, disclosure, use, dissemination, distribution, or copying of
> this message or any attachment (or the information contained therein) is
> strictly prohibited. If you think that you have received this e-mail
> message in error, please notify the sender by return e-mail and delete all
> references to it and its contents from your systems.
>

Reply via email to