ug4
domain_util.lua File Reference

Functions

function util CheckSubsets (dom, neededSubsets)
 
function util CreateAndDistributeDomain (gridName, numRefs, numPreRefs, neededSubsets, distributionMethod, verticalInterfaces, numTargetProcs, distributionLevel, wFct, noIntegrityCheck)
 
function util CreateDomain (gridName, numRefs, neededSubsets, noIntegrityCheck)
 

Function Documentation

◆ CheckSubsets()

function util CheckSubsets ( dom  ,
neededSubsets   
)

util.CheckSubsets checks if all required subsets are contained in the SubsetHandler

Parameters
domDomain
neededSubsetsList of subsets the SubsetHandler must contain
Returns
true if all subsets are contained, false else

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / domain_util.lua :42-52

function util.CheckSubsets(dom, neededSubsets)
sh = dom:subset_handler()
for i, tval in ipairs(neededSubsets) do
if sh:get_subset_index(tval) == -1 then
print("Domain does not contain subset '"..tval.."'.")
return false
end
end
return true
end
function table print(data, style)
if(!(yy_init))
Definition: lexer.cpp:997
for(yylen=0;yystr[yylen];yylen++) continue

◆ CreateAndDistributeDomain()

function util CreateAndDistributeDomain ( gridName  ,
numRefs  ,
numPreRefs  ,
neededSubsets  ,
distributionMethod  ,
verticalInterfaces  ,
numTargetProcs  ,
distributionLevel  ,
wFct  ,
noIntegrityCheck   
)

Creates a new domain and loads the specified grid. The method then performs numPreRefs refinements before it distributes the domain onto the available processes. The partitioning method can be chosen through distributionMethod. After distribution the domain is refined until a total of numRefs refinement steps has been performed (including numPreRefs). A list of subset-names can be specified. After distribution the methods checks Whether all processes received the required subsets. The method returns the created domain.

Note
Some paramters are optional. nil is a valid value for each optional parameter.
Returns
(Domain) the created domain
Parameters
gridName(string) The filename of the grid which shall be loaded. The grid is searched in a path relative to the current path first. If it isn't found there, the path is interpreted as an absolute path. If the grid still can't be found, the method tries to load it from UG_BASE/data/grids.
numRefs(int) The total number of global refinements
numPreRefs(int) The number of refinements that are performed before distribution.
neededSubsets(optional, list of strings) The subsets that are required by the simulation. If not all those subsets are present, the method aborts. Default is an empty list.
distributionMethod(optional, string) The distribution method. Either "bisection" or "metis". Default is "bisection". See util.DistributeDomain for more information (in UG_BASE/scripts/util/domain_distribution.lua)
verticalInterfaces(optional, bool) Vertical interfaces are required by multi-grid solvers. Default is true. See util.DistributeDomain for more information (in UG_BASE/scripts/util/domain_distribution.lua)
numTargetProcs(optional, int) The number of target processes to which the domain shall be distributed. Make sure that the number of target processes is not higher than the number of elements in the distributionLevel. Default is NumProcs() See util.DistributeDomain for more information (in UG_BASE/scripts/util/domain_distribution.lua)
distributionLevel(optional, int) The level on which the distribution is performed. Default is the domains top-level after pre-refinement. See util.DistributeDomain for more information (in UG_BASE/scripts/util/domain_distribution.lua)
wFct(optional SmartPtr<EdgeWeighting>) Sets the weighting function for the 'metisReweigh' partitioning method.
noIntegrityCheck(optional, bool) Disables integrity check if 'true'.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / domain_util.lua :168-243

◆ CreateDomain()

function util CreateDomain ( gridName  ,
numRefs  ,
neededSubsets  ,
noIntegrityCheck   
)

Creates a new domain and loads the specified grid. The method then performs numRefs global refinements. A list of subset-names can be specified which have to be present in the loaded grid. The method returns the created domain.

Note
Some paramters are optional. nil is a valid value for each optional parameter.
Returns
(Domain) the created domain
Parameters
gridName(string) The filename of the grid which shall be loaded. The grid is searched in a path relative to the current path first. If it isn't found there, the path is interpreted as an absolute path. If the grid still can't be found, the method tries to load it from UG_BASE/data/grids.
numRefs(int) The total number of global refinements
numPreRefs(int) The number of refinements that are performed before distribution.
neededSubsets(optional, list of strings) The subsets that are required by the simulation. If not all those subsets are present, the method aborts. Default is an empty list.
noIntegrityCheck(optional, bool) Disables integrity check if 'true'.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / domain_util.lua :73-118