[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read a list of point in a python script to define a set of points wi

From: Konstantinos Poulios
Subject: Re: read a list of point in a python script to define a set of points with Dirichlet boundary conditions (follow up)
Date: Thu, 18 Nov 2021 23:03:25 +0100

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)


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:


On Thu, Nov 18, 2021 at 9:16 PM Lesage,Anne Cecile J <> 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)







mfpb_ = gf.MeshFem(meshb, 1)


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




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

[Prev in Thread] Current Thread [Next in Thread]