SIFEL/TRFEL/PREP/inputt.cpp File Reference

#include <string.h>
#include "iotools.h"
#include "kwdset.h"
#include "vector.h"
#include "siftop.h"
#include "gfunct.h"
#include "aliast.h"
#include "globalt.h"
#include "globprept.h"
#include "prepalias.h"
#include "inputt.h"
#include "bocont.h"
#include "dbcrst.h"
#include "dbmatt.h"
#include "entitybocon.h"
#include "aggregator.h"

Go to the source code of this file.

Functions

void assemble_bclimcond (selement &el, snode *nodes, long prop, list &bclimc, gentity ent, long *bnid, long *entid, long nentid)
 function assembles array of indeces of climatcond object for the given element
long assemble_bnodvalt (selement &el, snode *nodes, long prop, entitybocon &ebc, list &bnvl, gentity ent, long minid, long *bnid, long *entid, long nentid)
 function assembles bnodval object from the entitybocon object and array of bndoval indeces for the given element
loadeltbc2loadelt (long eid, selement &el, snode *nodes, long prop, bocontypet bc, long **bnid, gentity ent, long *entid, long nentid)
 function returns pointer to a new loadelt structure with BC created for the given entity bc, element and entity property id
long get_nbo (selement &el, gentity ent)
 returns the number of boundary objects
long input_crst (XFILE *in, descript *d)
 input cross-section from the preprocessor file section
long input_crst (char *fname, descript *d)
 input cross-section from the cross-section file
long input_elem_crsect (XFILE *in, const enumstr elemsects[], long nsect)
 assignment of element cross-section types
long input_elem_edgebc (XFILE *in, const enumstr elemsects[], long nsect)
 assignment edge load to elements
long input_elem_eltimefunct (XFILE *in, const enumstr elemsects[], long nsect)
 assignment of time functions to elements
long input_elem_matt (XFILE *in, const enumstr elemsects[], long nsect)
 assignment of element material types
long input_elem_sourcet (XFILE *in, const enumstr elemsects[], long nsect)
 assignment of sources of quantities on elements
long input_elem_surfbc (XFILE *in, const enumstr elemsects[], long nsect)
 assignment surface load to elements
long input_elem_typet (XFILE *in, const enumstr elemsects[], long nsect)
 assignment of element types
long input_elem_vertbc (XFILE *in, const enumstr elemsects[], long nsect)
 assignment vertex (nodal) load to elements
long input_elempropt (XFILE *in)
 input of element properties
long input_filest (XFILE *in, descript &d)
 input section with names of topology, material and cross section files
long input_lct (XFILE *in)
 input of description of load cases
long input_materialst (XFILE *in, descript *d)
 input material from the preprocessor file section
long input_materialst (char *fname, descript *d)
 input material from the material file
long input_nod_bocont (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of boundary conditions at nodes
long input_nod_coupl_dofst (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of coupled dofs at nodes
long input_nod_crsect (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of cross-setions at nodes
long input_nod_dof_tfunct (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of time functions cotrolling dofs at nodes
long input_nod_initcondt (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of initial conditions at nodes
long input_nod_sourcet (XFILE *in, const enumstr nodsects[], long nsect)
 assignment of sources of quantities at nodes
long input_nodpropt (XFILE *in)
 input of nodal properties
long input_siftopt (XFILE *in, descript *d)
 input topolgy using siftop class
long inputt (XFILE *in, descript *d)
 main function for input from the preprocessor file
const gentity operator-- (gentity &a, int)
long read_inicd_file (char *cndfname, long ndof)
 reading of initial conditions from file

Function Documentation

void assemble_bclimcond ( selement &  el,
snode *  nodes,
long  prop,
list bclimc,
gentity  ent,
long *  bnid,
long *  entid,
long  nentid 
)

function assembles array of indeces of climatcond object for the given element

The function fills array of indeces bnid by the index of the last climatcond object in the list bclimc for the given element and boundary condition (BC).

Parameters:
el - element to which the BC will be assigned
nodes - array of all nodes in the given topology
prop - entity property id of the element el where the entity BC will be applied
bclimc - list of assigned climatic condition
ent - entity type for which the the BC will be assigned
bnid - array with indeces of bnodval objects for the given coefficients (numbering of indeces must be from zero) bnid[i] returns index for i-th boundary object of the given coefficient prescribed by bclimc
entid - array of entity indeces for the given property number detected on the additional edges or surfaces
nentid - the length of array entid
Returns:
The function stores resulting indeces of climatcond objects in the parameter bnid.

Created by Tomas Koudelka, 09.2011

Definition at line 4218 of file inputt.cpp.

References list::count(), gcurve, gsurface, gvertex, and print_err().

Referenced by input_elem_edgebc(), input_elem_surfbc(), and input_elem_vertbc().

long assemble_bnodvalt ( selement &  el,
snode *  nodes,
long  prop,
entitybocon ebc,
list bnvl,
gentity  ent,
long  minid,
long *  bnid,
long *  entid,
long  nentid 
)

function assembles bnodval object from the entitybocon object and array of bndoval indeces for the given element

The function fills array of indeces bnid by the indeces in the list of bnodvalt object for the given element and boundary condition (BC).

Parameters:
el - element to which the BC will be assigned
nodes - array of all nodes in the given topology
prop - entity property id of the element el where the entity BC will be applied
ebc - object with BC for the given entity ent
bnvl - list of assigned bnodvalt objects
ent - entity type for which the the BC will be assigned
minid - the minimum index from which the list bnvl is searched for the identical bnodvalt objects of the given BC. It is used for reduction of ammount of bnodvalt objects.
bnid - array with indeces of bnodval objects for the given coefficients (numbering of indeces must be from zero) bnid[i] returns index for i-th boundary object of the given coefficient prescribed by ebc
entid - array of entity indeces for the given property number detected on the additional edges or surfaces
nentid - the length of array entid
Returns:
The function stores resulting indeces of bnodvalt objects in the parameter bnid.
Return values:
0 - on success
1 - cannot create bnodvalt object - parser error

Created by Tomas Koudelka, 10.2010

Definition at line 4025 of file inputt.cpp.

References list::append(), list::at(), list::count(), entitybocon::dc, gcurve, entitybocon::getval(), gsurface, gvertex, bnodvalt::nodval, bnodvalt::nsc, and print_err().

Referenced by input_elem_edgebc(), input_elem_surfbc(), and input_elem_vertbc().

loadelt* bc2loadelt ( long  eid,
selement &  el,
snode *  nodes,
long  prop,
bocontypet  bc,
long **  bnid,
gentity  ent,
long *  entid,
long  nentid 
)

function returns pointer to a new loadelt structure with BC created for the given entity bc, element and entity property id

The function creates new object of the loadelt type which contains edge or surface boundary condition (BC) generated for given element and its entities with given property.

Parameters:
eid - element id (numbering must be from zero)
el - element whose BC will be generated
nodes - array of all nodes in the given topology
prop - entity property id of the element el where the entity BC will be applied
bc - type of assigned BC
bnid - array with indices of bnodval objects for all prescribed coefficients (numbering of indices must be from zero) bnid[i][j] returns index for i-th coefficient of j-th boundary object
ent - entity type
entid - array of entity indeces for the given property number detected on the additional edges or surfaces
nentid - the length of array entid
Returns:
The function returns pointer to the new allocated object of the loadelt type.

Created by TKo, 10.2010

Definition at line 4322 of file inputt.cpp.

References loadelt::bc, loadelt::eid, gcurve, growing_np_problem, growing_np_problem_nonlin, gsurface, gvertex, if(), memset(), loadelt::nbo, loadelt::nnbo, loadelt::nvid, presc_trmiss, Tp, probdesct::tprob, loadelt::trcid, and loadelt::trrid.

Referenced by input_elem_edgebc(), input_elem_surfbc(), and input_elem_vertbc().

long get_nbo ( selement &  el,
gentity  ent 
)

returns the number of boundary objects

The function determines the number of boundary objects of the given entity type on the given element.

Parameters:
el - structure of element
ent - entity type
Returns:
The function returns the number of boundary objects.

Created by TKo, 10.2010

Definition at line 4453 of file inputt.cpp.

References gcurve, gsurface, and gvertex.

Referenced by input_elem_edgebc(), input_elem_surfbc(), and input_elem_vertbc().

long input_crst ( XFILE in,
descript d 
)

input cross-section from the preprocessor file section

Function reads cross-section database from corresponding XFILE section

Parameters:
in - pointer to the opened XFILE
d - pointer to structure with description of preprocessor setup

Returns:

Return values:
0 - on success
1 - if fails opening file
2 - if fails reading cross-section parameters

Created by TKo, 06.2014

Definition at line 434 of file inputt.cpp.

References begsec_crsec, bsec_str, descript::crsstr, Dbcrst, XFILE::ignorecase, XFILE::kwdmode, Mesprt, dbcrst::read(), dbcrst::readtc(), sect_mode_seq, Tc, XFILE::warning, xf_setsec(), xfclose(), and yes.

long input_crst ( char *  fname,
descript d 
)

input cross-section from the cross-section file

Function reads cross-section database from file with name given by the fname

Parameters:
fname - string with database file name
d - pointer to structure with description of preprocessor setup
Return values:
0 - on success
1 - if fails opening file
2 - if fails reading cross-section parameters

Created by TKo, 09.2010

Definition at line 387 of file inputt.cpp.

References descript::crsstr, Dbcrst, XFILE::ignorecase, XFILE::kwdmode, Mesprt, dbcrst::read(), dbcrst::readtc(), sequent_mode, Tc, XFILE::warning, xfclose(), xfopen(), and yes.

Referenced by inputt().

long input_elem_crsect ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment of element cross-section types

The function assigns cross-section type to the elements. It scans sections eledgpr, elsurfpr, elvolpr for keyword "el_type". The record which assigns cross-section type to the element looks like follows: "el_crsec" "propid" prop crsec_type crsec_id where prop is positive integer number.

The asssigning starts at section for volumes and finishes at section for edges. If an element belongs to several entities and different cross-section types are prescribed for these entities, error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - cannot find required cross-section in database
2 - different cross-section types have been assigned to one element
3 - property numbers of the required entity type have not been read on elements
4 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 2124 of file inputt.cpp.

References Check_unused_prop, XFILE::col, crsectypet_kwdset(), Dbcrst, El_cst, El_cstdbi, El_csti, entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, dbcrst::mark_used(), memset(), print_err(), dbcrst::search_crs(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_edgebc ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment edge load to elements

The function assigns edge boundary condition (BC) to the elements with with required edge property. It scans section eledgpr for keyword "edge_bc". The record which assigns edge BC to the element looks like follows: "edge_bc" "propid" prop "lc_id" load_case_index "bc_type" boundary_condition_type {entity_bocon} x nbce where prop is positive integer number, entity_bocon is record for entitybocon class and nbce is the number of prescribed quantities (nv, trc, trr) in the given bc_type. For more details see entityload.cpp|h and loadelt.cpp|h

It scans only section for edges. If an element belongs to several entities and different BC types are prescribed for these entities, merging of BC is performed.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - load case id is out of range
2 - error in BC reading
3 - failure of merging of BC or ceration of bnodvalt objects
4 - unknown type of entity or problem type is required
5 - property numbers of the required entity type have not been read on elements
6 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 2915 of file inputt.cpp.

References answertype_kwdset(), list::append(), assemble_bclimcond(), assemble_bnodvalt(), bc2loadelt(), bocontype_kwdset(), Check_unused_prop, XFILE::col, list::count(), det_climcond, El_cc_lst, El_ccf_lst, El_gcc_lst, El_gccf_lst, El_gtrcc_lst, El_loadt, El_loadtcol, El_loadtln, El_nv_lst, El_trc_lst, El_trcc_lst, El_trr_lst, entitypstr, XFILE::fname, gcurve, gen_climcond, get_nbo(), getkwd_sect(), XFILE::give_maxlnsize(), XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), loadelt::merge(), no, probdesct::ntm, presc_trmiss, print_err(), entitybocon::read(), climatcond2::read(), climatcond::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, tetrahedronlinear, Top, Tp, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_eltimefunct ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment of time functions to elements

Function reads time functions for switching on/off of given elements. It scans sections eledgpr, elsurfpr, elvolpr for keyword "el_tfunct". The record which assigns volume load to the element looks like follows: "el_tfunct" "propid" prop "el_tfunc" time_function_id where prop is positive integer number.

The asssigning starts at section for volumes and finishes at section for vertices. In case of multiple assigning of different time functions, error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects

Returns :

Return values:
0 - on success
1 - assignment of different time function at one element
2 - property numbers of the required entity type have not been read on elements
3 - element have not assigned a time function
4 - property number of the required entity type have not been found on elements

Definition at line 3826 of file inputt.cpp.

References Check_unused_prop, XFILE::col, El_tfunc, entitypstr, XFILE::fname, getkwd_sect(), gregion, growing_np_problem, growing_np_problem_nonlin, Gtt, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, memset(), gtopology::ngf, print_err(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, probdesct::tprob, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_matt ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment of element material types

The function assigns material type to the elements. It scans sections eledgpr, elsurfpr, elvolpr for keyword "el_type". The record which assigns material type to the element looks like follows: "el_mat" "propid" prop "num_mat" nmat nmat*{"type" material_type "type_id" material_id} where prop is positive integer number.

The asssigning starts at section for volumes and finishes at section for edges. If an element belongs to several entities and different material types are prescribed for these entities, error of assignment is signalized. Finally, the function checks whether all elements have assigned a material type.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - different material types have been assigned to one element
2 - no type has been assigned to elements
3 - property numbers of the required entity type have not been read on elements
4 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 1907 of file inputt.cpp.

References Check_unused_prop, XFILE::col, Dbmatt, El_matdbi, El_matid, El_mattype, El_nmat, entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, dbmatt::mark_used(), mattypet_kwdset(), memset(), probdesct::ntm, print_err(), dbmatt::search_mat(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_sourcet ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment of sources of quantities on elements

Function reads and assigns sources of given quantity on elements. It scans sections eledgpr, elsurfpr, elvolpr for keyword "el_src". The record which assigns sources to element looks like follows: "el_src" "propid" prop "lc_id" lcid {"src_val" v}|{"src_type" srt {gfunct|hydrh|cemhyd}} |___________| |____________________________________| | | stat_prob all_other_prob

The record contains call of sourcet::read function over the reading of lcid, For more details see sourcet.cpp.

The asssigning starts at section for volumes and finishes at section for vertices. If an element belongs to several entities and a source of quantity is prescribed for these entities, the sources of quantity are compared and if they differ, the error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - invalid load case id
2 - two boundary conditons cannot be merged
3 - growing transport problem type is required (dofs have to be controlled by time functions)
4 - nodes with required property and entity type cannot be found

Created by TKo, 09.2010

Definition at line 2287 of file inputt.cpp.

References list::append(), list::at(), Check_unused_prop, XFILE::col, sourcet::compare(), list::count(), El_sourcet, El_srclst, entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), probdesct::ntm, print_err(), sourcet::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, xf_setsec(), and xfscanf().

long input_elem_surfbc ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment surface load to elements

The function assigns surface boundary condition (BC) to the elements with with required surface property. It scans sections elsurfpr for keyword "surf_bc". The record which assigns surface BC to the element looks like follows: "surf_bc" "propid" prop "lc_id" load_case_index "bc_type" boundary_condition_type {entity_bocon} x nbce where prop is positive integer number, entity_bocon is record for entitybocon class and nbce is the number of prescribed quantities (nv, trc, trr) in the given bc_type. For more details see entityload.cpp|h and loadelt.cpp|h

It scans only section for surfaces. If an element belongs to several entities and different BC types are prescribed for these entities, merging of BC is performed.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - load case id is out of range
2 - error in BC reading
3 - failure of merging of BC or bnodvalt object
4 - unknown type of entity or problem type is required
5 - property numbers of the required entity type have not been read on elements
6 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 3375 of file inputt.cpp.

References answertype_kwdset(), list::append(), assemble_bclimcond(), assemble_bnodvalt(), bc2loadelt(), bocontype_kwdset(), Check_unused_prop, XFILE::col, list::count(), det_climcond, El_cc_lst, El_ccf_lst, El_gcc_lst, El_gccf_lst, El_gtrcc_lst, El_loadt, El_loadtcol, El_loadtln, El_nv_lst, El_trc_lst, El_trcc_lst, El_trr_lst, entitypstr, XFILE::fname, gen_climcond, get_nbo(), getkwd_sect(), XFILE::give_maxlnsize(), gsurface, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), loadelt::merge(), no, probdesct::ntm, presc_trmiss, print_err(), entitybocon::read(), climatcond2::read(), climatcond::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, tetrahedronlinear, Top, Tp, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_typet ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment of element types

The function assigns element type to the elements. It scans sections eledgpr, elsurfpr, elvolpr for keyword "el_type". The record which assigns type to the element looks like follows: "el_type" "propid" prop element_type where prop is positive integer number.

The asssigning starts at section for volumes and finishes at section for edges. If an element belongs to several entities and types are prescribed for these entities, error of assignment is signalized. Finally, the function checks whether all elements have assigned type.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - different types have been assigned to one element
2 - no type has been assigned to elements
3 - property numbers of the required entity type have not been read on elements
4 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 1762 of file inputt.cpp.

References Check_unused_prop, XFILE::col, El_type, elemtypet_kwdset(), entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), print_err(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elem_vertbc ( XFILE in,
const enumstr  elemsects[],
long  nsect 
)

assignment vertex (nodal) load to elements

The function assigns boundary condition (BC) to the element nodes with required vertex property. It scans only section elvertpr for keyword "vertex_bc". The record which assigns edge BC to the element looks like follows: "vertex_bc" "propid" prop "lc_id" load_case_index "bc_type" boundary_condition_type {entity_bocon} x nbce where prop is positive integer number, entity_bocon is record for entitybocon class and nbce is the number of prescribed quantities (nv, trc, trr) in the given bc_type. For more details see entityload.cpp|h and loadelt.cpp|h

It scans only section elvertpr. If an element belongs to several entities and different BC types are prescribed for these entities, merging of BC is performed.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array elemsects
Return values:
0 - on success
1 - load case id is out of range
2 - error in BC reading
3 - failure of merging of BC or ceration of bnodvalt objects
4 - unknown type of entity or problem type is required
5 - property numbers of the required entity type have not been read on elements
6 - property number of the required entity type have not been found on elements

Created by TKo, 09.2010

Definition at line 2457 of file inputt.cpp.

References answertype_kwdset(), list::append(), assemble_bclimcond(), assemble_bnodvalt(), bc2loadelt(), bocontype_kwdset(), Check_unused_prop, XFILE::col, list::count(), det_climcond, El_cc_lst, El_ccf_lst, El_gcc_lst, El_gccf_lst, El_gtrcc_lst, El_loadt, El_loadtcol, El_loadtln, El_nv_lst, El_trc_lst, El_trcc_lst, El_trr_lst, entitypstr, XFILE::fname, gen_climcond, get_nbo(), getkwd_sect(), XFILE::give_maxlnsize(), gvertex, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), loadelt::merge(), no, probdesct::ntm, presc_trmiss, print_err(), entitybocon::read(), climatcond2::read(), climatcond::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, trianglelinear, xf_setsec(), and xfscanf().

Referenced by input_elempropt().

long input_elempropt ( XFILE in  ) 

input of element properties

Function reads element properties from file in

Parameters:
in - poinetr to opened input file with property description
Return values:
0 - on success
1 - fails input of element types
2 - fails input of material
3 - fails input of cross-sections
4 - fails input of vertex boundary conditions
5 - fails input of edge boundary conditions
6 - fails input of surface boundary conditions
7 - fails input of time functions for elements

Created 09.2010 by Tomas Koudelka koudelka@cml.fsv.cvut.cz

Definition at line 533 of file inputt.cpp.

References enumstr::alias, begsec_eledgpr, begsec_elsurfpr, begsec_elvertpr, begsec_elvolpr, bsec_str, El_loadt, enumstr::id, input_elem_crsect(), input_elem_edgebc(), input_elem_eltimefunct(), input_elem_matt(), input_elem_surfbc(), input_elem_typet(), input_elem_vertbc(), XFILE::kwdmode, and sequent_mode.

Referenced by inputt().

long input_filest ( XFILE in,
descript d 
)

input section with names of topology, material and cross section files

The function reads section with files used for the generation of TRFEL input file e.g., topology, material or cross section files. It also reads setup of preprocessor.

Parameters:
in - pointer to the opened XFILE structure
d - structure with input data format description
Return values:
0 - on success

Created by Tomas Koudelka, 7.7.2014

Definition at line 173 of file inputt.cpp.

References answertype_kwdset(), descript::crf, descript::crskwd, descript::crsstr, descript::icf, descript::inicdf, descript::matf, descript::matkwd, descript::matstr, descript::meshfmt, meshform_kwdset(), no, descript::redgn, descript::topf, xfscanf(), and yes.

Referenced by main().

long input_lct ( XFILE in  ) 

input of description of load cases

Input of data about load cases (time functions for elements in growing transport problems).

Parameters:
in - pointer to the opened XFILE structure
Return values:
0 - on success

Created 10.2010 by Tomas Koudelka koudelka@cml.fsv.cvut.cz

Definition at line 225 of file inputt.cpp.

References begsec_loadcase, bsec_str, growing_np_problem, growing_np_problem_nonlin, Gtt, XFILE::kwdmode, gtopology::read_gf(), sect_mode_full, sequent_mode, Tp, probdesct::tprob, xf_setsec(), and xfscanf().

Referenced by inputt().

long input_materialst ( XFILE in,
descript d 
)

input material from the preprocessor file section

Function reads material database from corresponding XFILE section.

Parameters:
in - pointer to the opened XFILE file
d - pointer to structure with description of preprocessor setup

Returns :

Return values:
0 - on success
1 - if fails detecting of material XFILE section
2 - if fails reading material parameters

Created by TKo, 06.2014

Definition at line 343 of file inputt.cpp.

References begsec_mater, bsec_str, Dbmatt, XFILE::ignorecase, XFILE::kwdmode, descript::matstr, Mesprt, dbmatt::read(), dbmatt::readtm(), sect_mode_seq, Tm, XFILE::warning, xf_setsec(), xfclose(), and yes.

long input_materialst ( char *  fname,
descript d 
)

input material from the material file

Function reads material database from file with name given by the fname

Parameters:
fname - string with database file name
d - pointer to structure with description of preprocessor setup

Returns :

Return values:
0 - on success
1 - if fails opening file
2 - if fails reading material parameters

Created by TKo, 09.2010

Definition at line 295 of file inputt.cpp.

References Dbmatt, XFILE::ignorecase, XFILE::kwdmode, descript::matstr, Mesprt, dbmatt::read(), dbmatt::readtm(), sequent_mode, Tm, XFILE::warning, xfclose(), xfopen(), and yes.

Referenced by inputt().

long input_nod_bocont ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of boundary conditions at nodes

Function reads and assigns boundary conditions at each node. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "bocon". The record which assigns dofs to node looks like follows: "bocon" "propid" prop "num_bc" nbc {"dir" dir "cond" cond [func]}[nbc]

The asssigning starts at section for volumes and finishes at section for vertices. If a node belongs to several entities and boundary conditions are prescribed for these entities, the assigned boundary conditions are merged and a message is written into the log file. In case of multiple assigning of different boundary conditions in same direction, error of merging is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - assignment of different number of dofs at one node
2 - invalid load case id or expression could not be parsed
3 - two boundary conditons cannot be merged
4 - growing transport problem type is required (dofs have to be controlled by time functions)
5 - nodes with required property and entity type cannot be found

Definition at line 616 of file inputt.cpp.

References list::append(), list::at(), Check_unused_prop, XFILE::col, bocont::compare(), list::count(), entitypstr, XFILE::fname, getkwd_sect(), gregion, growing_np_problem, growing_np_problem_nonlin, XFILE::ignorecase, XFILE::kwdmode, bocont::lcid, XFILE::line, Log, memset(), Nod_bclst, Nod_bocon, probdesct::ntm, print_err(), bocont::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, probdesct::tprob, xf_setsec(), and xfscanf().

Referenced by input_nodpropt().

long input_nod_coupl_dofst ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of coupled dofs at nodes

Function reads and assigns coupled dofs at each node. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "dof_coupl". The record which assigns coupled dofs to nodes looks like follows: "dof_coupl" "propid" prop "num_coup_dir" ndir {"dir" dir_index}[ndir]

The asssigning starts at section for volumes and finishes at section for vertices. If a node belongs to several entities and boundary conditions are prescribed for these entities, the assigned boundary conditions are merged and a message is written into the log file.In case of multiple assigning of different boundary conditions in same direction, error of merging is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - assignment of different number of dofs at one node
2 - invalid number of coupled dofs (out of <1;ndof>)
3 - invalid coupled dof number (out of <1;ndof>)
4 - growing transport problem type is required (dofs have to be controlled by time functions)
5 - nodes with required property and entity type cannot be found

Created by TKo, 09.2010

Definition at line 813 of file inputt.cpp.

References Check_unused_prop, XFILE::col, entitypstr, XFILE::fname, getkwd_sect(), gregion, growing_np_problem, growing_np_problem_nonlin, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), Nod_ccn, probdesct::ntm, print_err(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, probdesct::tprob, xf_setsec(), and xfscanf().

Referenced by input_nodpropt().

long input_nod_crsect ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of cross-setions at nodes

Function reads cross-sections at each node. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "nod_crsec". The record which assigns a cross-section to node looks like follows: "nod_crsec" "propid" prop "type" type_keyword "type_id" type_index

The asssigning starts at section for volumes and finishes at section for vertices. In case of multiple assigning of different cross-sections, error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - cannot find required cross-section in database
2 - different cross-section type has been assigned at one node
3 - nodes with required property and entity type cannot be found

Created by TKo, 09.2010

Definition at line 1164 of file inputt.cpp.

References Check_unused_prop, XFILE::col, crsectypet_kwdset(), Dbcrst, entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, dbcrst::mark_used(), memset(), nocrosssectiont, Nod_cst, Nod_cstdbi, Nod_csti, print_err(), dbcrst::search_crs(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, xf_setsec(), and xfscanf().

Referenced by input_nodpropt().

long input_nod_dof_tfunct ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of time functions cotrolling dofs at nodes

Function reads time functions for switching dofs on/off at each node. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "nod_tfunc". The record which assigns dofs to node looks like follows: "nod_tfunc" "propid" prop {"tfunc_id" tfunc_id}[ndofn]

The asssigning starts at section for volumes and finishes at section for vertices. In case of multiple assigning of different time functions, error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - cannot determine unique number of dofs for the given property and entity type
2 - number of prescribed time functions is out of range <1,ntm>
3 - dof id is out of range <1,ntm>
4 - nodes with required property and entity type cannot be found
5 - invalid time function id

Created by TKo, 09.2010

Definition at line 995 of file inputt.cpp.

References Check_unused_prop, XFILE::col, entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), Nod_ccn, probdesct::ntm, print_err(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, xf_setsec(), and xfscanf().

Referenced by input_nodpropt().

long input_nod_initcondt ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of initial conditions at nodes

Function reads initial conditions at nodes. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "nod_inicond". The record which assigns nodal initial conditions looks like follows: "nod_inicond" "propid" prop "cond" {initial_condition}

The asssigning starts at section for volumes and finishes at section for vertices. If a node belongs to several entities and initial conditions are prescribed for these entities, the assigned conditions are merged and a message is written into the log file.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - cannot read initial conditions from file
2 - assignment of different types of initial conditons at one node
3 - nodes with required property and entity type cannot be found

Created by TKo, 09.2010

Definition at line 1309 of file inputt.cpp.

References Check_unused_prop, XFILE::col, cond, entitypstr, file, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, Inicdf, XFILE::kwdmode, XFILE::line, Log, memset(), Nod_inicd, probdesct::ntm, prepcondtype_kwdset(), print_err(), read_inicd_file(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, xf_setsec(), and xfscanf().

Referenced by input_nodpropt().

long input_nod_sourcet ( XFILE in,
const enumstr  nodsects[],
long  nsect 
)

assignment of sources of quantities at nodes

Function reads and assigns nodal sources of given quantity at each node. It scans sections nodvertpr, nodedgpr, nodsurfpr, nodvolpr for keyword "nod_src". The record which assigns sources to node looks like follows: "nod_src" "propid" prop "lc_id" lcid {"src_val" v}|{"src_type" srt {gfunct|hydrh|cemhyd}} |___________| |____________________________________| | | stat_prob all_other_prob

The record contains call of sourcet::read function over the reading of lcid, For more details see sourcet.cpp.

The asssigning starts at section for volumes and finishes at section for vertices. If a node belongs to several entities and a source of quantity is prescribed for these entities, the sources of quantity are compared and if they differ, the error of assignment is signalized.

Parameters:
in - pointer to opened input file with property description - array with descriptors of sections, which will be searched - number of searched sections i.e number of elements in array nodsects
Return values:
0 - on success
1 - invalid load case id
2 - two boundary conditons cannot be merged
3 - nodes with required property and entity type cannot be found

Created by TKo, 09.2010

Definition at line 1590 of file inputt.cpp.

References list::append(), list::at(), Check_unused_prop, XFILE::col, sourcet::compare(), list::count(), entitypstr, XFILE::fname, getkwd_sect(), gregion, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, Log, memset(), Nod_sourcet, Nod_srclst, probdesct::ntm, print_err(), sourcet::read(), sect_mode_full, sect_mode_fwd, sect_mode_seq, Top, Tp, xf_setsec(), and xfscanf().

long input_nodpropt ( XFILE in  ) 

input of nodal properties

Function reads nodal properties from file in

Parameters:
in - poinetr to opened input file with property description
Return values:
0 - on success
1 - fails input of boundary conditions
2 - fails input of common code numbers
3 - fails input of time functions of dofs
4 - fails input of cross-sections
5 - fails input of initial conditions

Created 09.2010 by Tomas Koudelka koudelka@cml.fsv.cvut.cz

Definition at line 480 of file inputt.cpp.

References input_nod_bocont(), input_nod_coupl_dofst(), input_nod_crsect(), input_nod_dof_tfunct(), input_nod_initcondt(), XFILE::kwdmode, Nod_ccn, and sequent_mode.

Referenced by inputt().

long input_siftopt ( XFILE in,
descript d 
)

input topolgy using siftop class

Function reads topology file in, format of the file is described by structure d.

Parameters:
in - pointer to the opened XFILE structure
d - structure with input data format description

Function returns:

Return values:
0 : on success
4 : in case of unknown mesh format

In case of reading alternative file format :

Return values:
1 : on error in reading of node
2 : on error in reading of element
3 : on error in reading of global node numbers

Created by TKo, 09.2010

Definition at line 260 of file inputt.cpp.

References descript::meshfmt, descript::paral, print_err(), descript::redgn, sifel, t3d, and Top.

Referenced by inputt().

long inputt ( XFILE in,
descript d 
)

main function for input from the preprocessor file

Function reads problem data from file in a writes it to file out in SIFEL format.

Parameters:
in - pointer to opened input file
outf - pointer to string with name of output file
Return values:
0 - on succes
1 - unable to open temporary file
2 - if fails reading number of loading cases
3 - if fails reading topology
4 - if fails reading materials
5 - if fails reading cross-sections
6 - if fails reading property file
7 - if fails writing output file

Created by TKo, 09.2010

Definition at line 37 of file inputt.cpp.

References precond::agg, boss, descript::crf, descript::crssec, ignore, XFILE::ignorecase, aggregator::impl, input_crst(), input_elempropt(), input_lct(), input_materialst(), input_nodpropt(), input_siftopt(), XFILE::kwdmode, descript::matf, descript::matsec, no, descript::paral, slesolv::prec, print_err(), precond::pt, sfeti, probdesct::ssle, slesolv::tlinsol, descript::topf, Tp, XFILE::warning, xfclose(), and xfopen().

Referenced by main().

const gentity operator-- ( gentity a,
int   
)

Overloaded postfix decrementation operator -- for enum gentity

Created by TKo, 09.2010

Definition at line 3973 of file inputt.cpp.

References gcurve, gregion, gsurface, gvertex, and print_err().

long read_inicd_file ( char *  cndfname,
long  ndof 
)

reading of initial conditions from file

The function reads initial conditions at nodes stored in the file given by the cndfname. The file must be according to the format of the text output file from the TRFEL/PARTRFEL. Values of all unknown quanitities at nodes must be included. The function stores the initial values directly in the Nod_inicd variable which is either allocated and filled with the read values or it is set to the NULL.

Parameters:
cndfname - file name with initial condition values at nodes (created by TRFEL/PARTRF)
ndof - number of DOFs, i.e. number of transported quantities in the problem.
Return values:
0 - on success
1 - initial condition file could not be opened
2 - node number out of range <1, nn>

Created by Tomas Koudelka, 03.2012.

Definition at line 1508 of file inputt.cpp.

References XFILE::col, XFILE::ignorecase, XFILE::kwdmode, XFILE::line, memset(), Nod_inicd, print_err(), sequent_mode, Top, XFILE::warning, xfopen(), and xfscanf().

Referenced by input_nod_initcondt().


Generated by  doxygen 1.6.2