You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I recently came across this package, and I must say it's been great so far. I've been experimenting with it and encountered an error message while defining a multi field using the following code:
using Gridap
# Define domain
domain = (0,1,0,1)
partition = (10, 10)
model = CartesianDiscreteModel(domain,partition)
labels = get_face_labeling(model)
add_tag_from_tags!(labels,"diri_0",[1,3,7])
add_tag_from_tags!(labels,"diri_1",[2,4,8])
degree = 2
Ω = Triangulation(model)
dΩ = Measure(Ω, degree)
# Material constants
const E = 70.0e9
const ν = 0.3
const λ = (E*ν)/((1+ν)*(1-2*ν))
const μ = E/(2*(1+ν))
σmat(ε) = λ*tr(ε)*one(ε) + 2*μ*ε
### Define solution spaces
# Space for displacement u
order = 1
reffeᵤ = ReferenceFE(lagrangian, VectorValue{2,Float64}, order)
Vᵤ = TestFESpace(model, reffeᵤ, conformity=:H1, dirichlet_tags = ["diri_0", "diri_1"])
disp_x = 0.75
g1 = VectorValue(0.0,0.0)
g2 = VectorValue(disp_x, 0.0)
U = TrialFESpace(Vᵤ,[g1,g2])
# Space for stress σ
reffeₛ = ReferenceFE(lagrangian, TensorValues.SymTensorValue{2, Float64, 3}, order)
Vₛ = TestFESpace(model, reffeₛ; conformity=:H1)
Σ = TrialFESpace(Vₛ)
# Multifield Spaces
X = MultiFieldFESpace([Vᵤ, Vₛ])
Y = MultiFieldFESpace([U, Σ])
# Define Objective functions
function res((u, σ), (vᵤ, vₛ))
∫(σ - σmat∘ε(u))*dΩ
end
The error is related to the line "Vₛ = TestFESpace(model, reffeₛ; conformity=:H1)", and I'm receiving the error message: "ERROR: UndefVarError: i not defined".
I would appreciate any insights or assistance to resolve this issue.
The text was updated successfully, but these errors were encountered:
Thank you for your prompt reply. It appears that the fix is more complicated, requiring some workarounds. I maybe just use VectorValues. But is there an implemented method to transform the symmetric gradient into a vector using Voigt notation?
Alternatively, I could try using TensorValues, but comparing the Tensor with the symmetric gradient i.e. SymTensorValues causes issues with mathematical operations between the two data types. For example, subtracting or adding a symmetric tensor to a normal tensor does not work as expected.
Hi there,
I recently came across this package, and I must say it's been great so far. I've been experimenting with it and encountered an error message while defining a multi field using the following code:
The error is related to the line "Vₛ = TestFESpace(model, reffeₛ; conformity=:H1)", and I'm receiving the error message: "ERROR: UndefVarError: i not defined".
I would appreciate any insights or assistance to resolve this issue.
The text was updated successfully, but these errors were encountered: