In fact, it works fine if I use
MeshTools::Generation::build_delaunay_square (mesh,
10,
10,
0,
0.3,
0,
0.3,
TRI3,
&holes );
But I have an other problem: During my calculation I am creating holes
in the grid. When I then want to impose boundary conditions for this
hole in the next time step (let's say the value of the concentration was
1 at this position and i set it to 0) I get oscillations.
thanks, Robert
Am Mittwoch, den 08.12.2010, 09:54 +0100 schrieb robert:
> Hi,
>
> I have tried to use boundary_id like I found it in example code 13.
> It works fine if I generate my mesh by MeshTools::Generation.
> However, I want to build my grid with the following code:
>
> int main (int argc, char** argv){
>
> // Use typedefs for slightly less typing.
> typedef TriangleInterface::Hole Hole;
> typedef TriangleInterface::PolygonHole PolygonHole;
> typedef TriangleInterface::ArbitraryHole ArbitraryHole;
>
>
> /*++++ Kinetic parameters ++++*/
> Real Dinf = 6e-9;
> Real Qd = 80000.;
> Real dNdt0 = 2.68e-8;
> Real kappa = 0.2;
> Real TCstart = 480.;
> Real deplthreshold = 0.75;
>
>
> //Tt_path object from application --> gives
> //Temperature and time
> Tt_path path
> path.linearinterp(10);
>
>
> // Initialize libMesh.
> LibMeshInit init (argc, argv);
>
> #ifndef LIBMESH_ENABLE_AMR
> if (libMesh::processor_id() == 0)
> std::cerr << "ERROR: This example requires libMesh to be\n"
> << "compiled with AMR support!"
> << std::endl;
> return 0;
> #else
>
> // Create a two-dimensional mesh.
> Mesh mesh (2);
>
>
> // The points:
> mesh.add_point(Point(0. , 0.));
> mesh.add_point(Point(0.3 , 0.));
> mesh.add_point(Point( 0.3 , 0.3));
> mesh.add_point(Point( 0. , 0.3));
>
> // Declare the TriangleInterface, to be used later
> TriangleInterface t(mesh);
>
> // Customize the variables for the triangulation
> t.desired_area() = .005;
> t.triangulation_type() = TriangleInterface::PSLG;
>
> // Define holes
> PolygonHole hole_1(Point(0.1, 0.1), // center
> 0.05, // radius
> 50); // n. points
>
>
> // Create the vector of Hole*
> std::vector<Hole*> holes;
> holes.push_back(&hole_1);
>
> // Attach the list of holes to the triangulator object
> t.attach_hole_list(&holes);
>
> // Triangulate!
> t.triangulate();
>
>
> ...
> ...
> ...
>
>
> for ( ; el != end_el; ++el){
> for (unsigned int s=0; s<elem->n_sides();s++){
> if (elem->neighbor(s)==NULL){
> short int bc_id =
> mesh.boundary_info->boundary_id (elem,s);
>
> /*if (bc_id==BoundaryInfo::invalid_id)
> libmesh_error();
> */
> std::cout<<"boundary_id: "<<bc_id<<" "<<std::endl;
>
>
> }
> }
> }
> }
> }
>
>
> The problem with this code is that I get invalid boundary id's.
> Any suggestions?
>
> Thanks,
> Robert
>
>
> Am Dienstag, den 07.12.2010, 17:42 -0600 schrieb Roy Stogner:
> >
> > On Tue, 7 Dec 2010, robert wrote:
> >
> > > How can I specify different boundary conditions for my domain
> > > boundary and for the 'inner' boundaries surrounding the holes?
> > >
> > > Is there something like:
> > >
> > > if (elem->neighbor(s) == NULL)
> > >
> > > that I can use for the hole boundaries?
> >
> > Look at the boundary ID uses in the example applications. You (or in
> > the example cases, MeshGeneration) set different boundary ids when
> > creating an initial mesh, then test those IDs later when deciding
> > which boundary condition to set on a side.
> > ---
> > Roy
>
>
>
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users