ug4
easy_util.lua File Reference

Functions

function util EasyCreateApproxSpace (dom, fct)
 
function util EasyDirichlet_0_Boundary (p)
 
function util EasyLoadGrid (p)
 
function NeededParameters (p, parameters)
 
function SetDefaultParameters (T, defaultT)
 
function util_std_dirichlet_one_2 (x, y, t)
 
function util_std_dirichlet_one_3 (x, y, z, t)
 
function util_std_dirichlet_zero_2 (x, y, t)
 
function util_std_dirichlet_zero_3 (x, y, z, t)
 
function util_std_zero_2 (x, y, t)
 
function util_std_zero_3 (x, y, z, t)
 

Function Documentation

◆ EasyCreateApproxSpace()

function util EasyCreateApproxSpace ( dom  ,
fct   
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :114-127

function util.EasyCreateApproxSpace(dom, fct)
local approxSpace = ApproximationSpace(dom)
for i, v in pairs(fct) do
approxSpace:add_fct(v, "Lagrange", 1)
end
approxSpace:init_levels()
approxSpace:init_top_surface()
return approxSpace
end
int local(bglp_vertex_descriptor p)
Definition: parallel_matrix.h:57

◆ EasyDirichlet_0_Boundary()

function util EasyDirichlet_0_Boundary ( p  )

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :129-140

function util.EasyDirichlet_0_Boundary(p)
NeededParameters(p, {"dim", "boundaries"})
if p.fct == nil then p.fct = {"c"} end
local dirichletBND = DirichletBoundary()
for i,v in pairs(p.boundaries) do
for ifct,vfct in pairs(p.fct) do
dirichletBND:add("util_std_dirichlet_zero_"..p.dim, vfct, v)
end
end
return dirichletBND
end
parameterString p
function NeededParameters(p, parameters)
static const int dim
for(yylen=0;yystr[yylen];yylen++) continue

◆ EasyLoadGrid()

function util EasyLoadGrid ( p  )

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :80-112

◆ NeededParameters()

function NeededParameters ( p  ,
parameters   
)

checks in the table p that all elements of parameters are non-nil. if some are nil, an error is thrown

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :69-78

function NeededParameters(p, parameters)
for i, v in pairs(parameters) do
if p[v] == nil then
print("\ntable ")
print(p)
print("needs parameter \""..v.."\" !")
ug_assert(false, "table needs parameter \""..v.."\" !")
end
end
end
function ug_assert(condition, msg)
function table print(data, style)

◆ SetDefaultParameters()

function SetDefaultParameters ( ,
defaultT   
)

this function ensures that elements in T which are not set (i.e. T[i]=nil) are set to T[i] = defaultT[i] this way we can use T as a parameter Table and all parameters not given are set to default values e.g. SetDefaultParameters(T, {smoother="jac", maxLevels=2})

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :61-65

function SetDefaultParameters(T, defaultT)
for i, v in pairs(defaultT) do
if T[i] == nil then T[i] = v end
end
end
function SetDefaultParameters(T, defaultT)

◆ util_std_dirichlet_one_2()

function util_std_dirichlet_one_2 ( ,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :48-50

function util_std_dirichlet_one_2(x, y, t)
return true, 1
end
function util_std_dirichlet_one_2(x, y, t)

◆ util_std_dirichlet_one_3()

function util_std_dirichlet_one_3 ( ,
,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :52-54

function util_std_dirichlet_one_3(x, y, z, t)
return true, 1
end
function util_std_dirichlet_one_3(x, y, z, t)

◆ util_std_dirichlet_zero_2()

function util_std_dirichlet_zero_2 ( ,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :40-42

function util_std_dirichlet_zero_2(x, y, t)
return true, 0
end
function util_std_dirichlet_zero_2(x, y, t)

◆ util_std_dirichlet_zero_3()

function util_std_dirichlet_zero_3 ( ,
,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :44-46

function util_std_dirichlet_zero_3(x, y, z, t)
return true, 0
end
function util_std_dirichlet_zero_3(x, y, z, t)

◆ util_std_zero_2()

function util_std_zero_2 ( ,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :32-34

function util_std_zero_2(x, y, t)
return 0
end
function util_std_zero_2(x, y, t)

◆ util_std_zero_3()

function util_std_zero_3 ( ,
,
,
 
)

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / easy_util.lua :36-38

function util_std_zero_3(x, y, z, t)
return 0
end
function util_std_zero_3(x, y, z, t)