# How to define some predefined values to some part of the domain in gridap

**URL:** <https://discourse.julialang.org/t/how-to-define-some-predefined-values-to-some-part-of-the-domain-in-gridap/113254>\
**Category:** Modelling & Simulations\
**Tags:** finite-element, gridap, simulations, modelling\
**Created:** [April 19, 2024, 9:38pm UTC](https://discourse.julialang.org/t/how-to-define-some-predefined-values-to-some-part-of-the-domain-in-gridap/113254 "2024-04-19T21:38:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mary/32/53139_2.png) [@mary](https://discourse.julialang.org/u/mary)\
**Post date:** [April 19, 2024, 9:38pm UTC](https://discourse.julialang.org/t/how-to-define-some-predefined-values-to-some-part-of-the-domain-in-gridap/113254/1 "2024-04-19T21:38:56Z")

</div>

Hi,  
I have a domain and I want to solve the pde to get the displacement and phase field. meanwhile I want to set the value of phase field in 3 surfaces near the supports and load line as 1 (s=1)  
I wrote this in julia using gridap in Drichlet boundary conditions. Is it a correct way or I should define it in another way?

```julia
 order = 1
reffe_PF = ReferenceFE(lagrangian ,Float64,order)
V0_PF = TestFESpace(model ,reffe_PF;conformity =:H1,
    dirichlet_tags = ["Left","Right", "Load","LeftSupport","RightSupport", "LoadLine"],
    dirichlet_masks =[true,true,true,true,true,true])
 sh = zero(V0_PF)

```

```julia
PF1(x)=1.0
PF2(x)=1.0
PF3(x)=1.0
PF4(x)=1.0
PF5(x)=1.0
PF6(x)=1.0
U_PF = TrialFESpace(V0_PF,[PF1 ,PF2 ,PF3,PF4 ,PF5 ,PF6])

```

Thank you
