require "common"
-- Use this file as template. Do not modify this file for running some testcases
outputname = 'channel_2D'
outputpreview = true

-- general refinement levels
-- minrefine: defines minimum refinement level of the entire domain
--
-- maxrefine: defines maximum refinement
-- gets overwritten from madatory STL levels
-- will become default for stl refinement level once
-- it is not mandatory any more
minrefine = 1
maxrefine = level
-- stl_files: for each stl file put a table into
-- this table of tables. Or just a string for
-- the filname, if the other two parameters should
-- get the default: boundary_type = 1, fileformat = 'binary'
-- refinementlevel is the level to which the stl shall be refined
-- it is mandatory

seederLength = length+dx
print('seeder height'..height)

-- boundingbox: two entries: origin and length in this
-- order, if no keys are used
bounding_cube = {origin = {-seederLength*0.5, -seederLength*.5, -seederLength*0.5},
               length = seederLength}

    -- refinebox: three entries: origin, length and refinementlevel
    refinebox = {{origin = {-length*0.5, -height*.5, -0.5*height},
                length = {length, height, height},
                refinementlevel = level
                }
                }
if useObstacle == true then
    table.insert( refinebox, 
         {origin = {-length*0.15, -height/6+dxDash, -height/6-dxDash }, 
                  length = {length*0.3, height/3-2.*dxDash, height/3+2.*dxDash }, 
                  refinementlevel = maxLevel
                  })  
else
  if usePeriodic == true then
    table.insert( refinebox, 
         {origin = {-length*0.15, -height/6+dxDash, -height/6-dxDash }, 
                  length = {length*0.3, height/3-2.*dxDash, height/3+2.*dxDash }, 
                  refinementlevel = maxLevel
                  })
  else
    if testIntersection then
      table.insert( refinebox, 
           {origin = {-length*0.15, -height/6+dxDash, -length*0.2 }, 
                    length = {length*0.3, height/3-2.*dxDash, length*0.4 }, 
                    refinementlevel = maxLevel
                    })
    else
      table.insert( refinebox, 
           {origin = {-length*0.15, -height/6+dxDash, -height/6+dxDash }, 
                    length = {length*0.3, height/3-2.*dxDash, height/3-2.*dxDash }, 
                    refinementlevel = maxLevel
                    })
    end
  end
end

-- seed: position of seed 
seed = {0.0, 0.0, dx*0.5 }

geom={
     plane={
            {vecA={0.0,length,0.0},
              vecB={0.0,0.0,length},
              pos={length*0.5,-length*0.5,-length*0.5},
  	          bclabel='east',
              }
            ,{vecA={0.0,length,0.0},
              vecB={0.0,0.0,length},
              pos={-length*0.5,-length*0.5,-length*0.5},
	            bclabel='west',
              }
             ,{vecA={length,0.0,0.0},
       	      vecB={0.0,0.0,length},
      	      pos={-length*0.5,height*0.5+dxDash,-length*0.5},
	            bclabel='north',
              }
             ,{vecA={length,0.0,0.0},
	            vecB={0.0,0.0,length},
      	      pos={-length*0.5,-height*0.5-dxDash,-length*0.5},
	            bclabel='south',
              }
             
             }
       }
if useObstacle ==true then
print('Adding sphere')
geom[ 'sphere' ] = {{ origin = {-length*0.35,-0.01*height,0.},
              radius = radius,
              bclabel = 'sphere'}}
end

  if usePeriodic == true then
  else
    table.insert( geom.plane,
         {vecA={length,0.0,0.0},
       	      vecB={0.0,length,0.0},
      	      pos={-length*0.5,-length*0.5,height*0.5+dxDash},
	            bclabel='front',
              })
    table.insert(geom.plane, {vecA={length,0.0,0.0},
	            vecB={0.0,length,0.0},
      	      pos={-length*0.5,-length*0.5,-height*0.5-dxDash},
	            bclabel='back',
              })
  end

if usePeriodic ==true then
geom[ 'periodic' ] = {{
            plane1 = 
            {vecA={length,0.0,0.0},
             vecB={0.0,length,0.0},
             pos={-length*0.5,-length*0.5, dx+dxDash}},
            plane2 = 
            {vecB={length,0.0,0.0},
             vecA={0.0,length,0.0},
             pos={-length*0.5,-length*0.5,-dxDash}}
          }}
end

