Example #1
0
void RegisterBridge_PCL(Registry& reg, string parentGroup)
{
	string grp(parentGroup);
	grp.append("/pcl");

	reg.add_function("PclDebugBarrierEnabled", &PclDebugBarrierEnabled, grp,
					"Enabled", "", "Returns the whether debug barriers are enabled.");

	reg.add_function("PclDebugBarrierAll", &PclDebugBarrierAll, grp,
					 "", "", "Synchronizes all parallel processes if the executable"
							 "has been compiled with PCL_DEBUG_BARRIER=ON");

	reg.add_function("NumProcs", &pcl::NumProcs, grp,
					"NumProcs", "", "Returns the number of active processes.");

	reg.add_function("ProcRank", &pcl::ProcRank, grp,
					"ProcRank", "", "Returns the rank of the current process.");

	reg.add_function("SynchronizeProcesses", &pcl::SynchronizeProcesses, grp,
					"", "", "Waits until all active processes reached this point.");

	reg.add_function("AllProcsTrue", &PclAllProcsTrue, grp,
					 "boolean", "boolean", "Returns true if all processes call the method with true.");

	reg.add_function("ParallelMin", &ParallelMin<double>, grp, "tmax", "t", "returns the minimum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelMax", &ParallelMax<double>, grp, "tmin", "t", "returns the maximum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelSum", &ParallelSum<double>, grp, "tsum", "t", "returns the sum of t over all processes. note: you have to assure that all processes call this function.");

	reg.add_function("ParallelVecMin", &ParallelVecMin<double>, grp, "tmax", "t", "returns the minimum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelVecMax", &ParallelVecMax<double>, grp, "tmin", "t", "returns the maximum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelVecSum", &ParallelVecSum<double>, grp, "tsum", "t", "returns the sum of t over all processes. note: you have to assure that all processes call this function.");
}
static void Domain(Registry& reg, string grp)
{
	string suffix = GetDomainSuffix<TDomain>();
	string tag = GetDomainTag<TDomain>();

	#ifdef UG_PARALLEL
		{
			typedef DomainBalanceWeights<TDomain, AnisotropicBalanceWeights<TDomain::dim> > T;
			string name = string("AnisotropicBalanceWeights").append(suffix);
			reg.add_class_<T, IBalanceWeights>(name, grp)
				.template add_constructor<void (*)(TDomain&)>()
				.add_method("set_weight_factor", &T::set_weight_factor)
				.add_method("weight_factor", &T::weight_factor)
				.set_construct_as_smart_pointer(true);
			reg.add_class_to_group(name, "AnisotropicBalanceWeights", tag);
		}

		{
			typedef BalanceWeightsLuaCallback<TDomain> T;
			string name = string("BalanceWeightsLuaCallback").append(suffix);
			reg.add_class_<T, IBalanceWeights>(name, grp)
				.template add_constructor<void (*)(SmartPtr<TDomain> spDom,
												   const char* luaCallbackName)>()
				.add_method("set_time", &T::set_time)
				.add_method("time", &T::time)
				.set_construct_as_smart_pointer(true);
			reg.add_class_to_group(name, "BalanceWeightsLuaCallback", tag);
		}

		{
			string name = string("DomainLoadBalancer").append(suffix);
			typedef DomainLoadBalancer<TDomain> T;
			typedef LoadBalancer TBase;
			reg.add_class_<T, TBase>(name, grp)
				.template add_constructor<void (*)(SmartPtr<TDomain>)>("Domain")
				.set_construct_as_smart_pointer(true);
			reg.add_class_to_group(name, "DomainLoadBalancer", tag);
		}

		reg.add_function("CreateProcessHierarchy",
						 static_cast<SPProcessHierarchy (*)(TDomain&, size_t,
						 									size_t, size_t, int,
						 									int)>
						 	(&CreateProcessHierarchy<TDomain>),
						 grp, "ProcessHierarchy", "Domain, minNumElemsPerProcPerLvl, "
						 "maxNumRedistProcs, maxNumProcs, minDistLvl, "
						 "maxLvlsWithoutRedist");
		reg.add_function("CreateProcessHierarchy",
						 static_cast<SPProcessHierarchy (*)(TDomain&, size_t,
						 									size_t, size_t, int,
						 									int, IRefiner*)>
						 	(&CreateProcessHierarchy<TDomain>),
						 grp, "ProcessHierarchy", "Domain, minNumElemsPerProcPerLvl, "
						 "maxNumRedistProcs, maxNumProcs, minDistLvl, "
						 "maxLvlsWithoutRedist, refiner");

	#endif
}
Example #3
0
void RegisterBridge_PCL(Registry& reg, string parentGroup)
{
	string grp(parentGroup);
	grp.append("/PCL");

	reg.add_function("DisableMPIInit", &DisableMPIInitDUMMY, grp, "", "",
	                 "Tells PCL to not call MPI_Init and MPI_Finalize.");

	reg.add_function("PclDebugBarrierEnabled", &PclDebugBarrierEnabledDUMMY, grp,
					"Enabled", "", "Returns the whether debug barriers are enabled.");

	reg.add_function("PclDebugBarrierAll", &PclDebugBarrierAllDUMMY, grp,
					 "", "", "Synchronizes all parallel processes if the executable"
							 "has been compiled with PCL_DEBUG_BARRIER=ON");

	reg.add_function("NumProcs", &NumProcsDUMMY, grp,
					"NumProcs", "", "Returns the number of active processes.");

	reg.add_function("ProcRank", &ProcRankDUMMY, grp,
					"ProcRank", "", "Returns the rank of the current process.");

	reg.add_function("SynchronizeProcesses", &SynchronizeProcessesDUMMY, grp,
					"", "", "Waits until all active processes reached this point.");

	reg.add_function("AllProcsTrue", &AllProcsTrueDUMMY, grp,
					 "boolean", "boolean", "Returns true if all processes call the method with true.");

	reg.add_function("ParallelMin", &ParallelMinDUMMY<double>, grp, "tmax", "t", "returns the maximum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelMax", &ParallelMaxDUMMY<double>, grp, "tmin", "t", "returns the minimum of t over all processes. note: you have to assure that all processes call this function.");
	reg.add_function("ParallelSum", &ParallelSumDUMMY<double>, grp, "tsum", "t", "returns the sum of t over all processes. note: you have to assure that all processes call this function.");
}
Example #4
0
bool RegisterSerializationCommands(Registry &reg, const char* parentGroup)
{
	stringstream grpSS; grpSS << parentGroup << "/Serialization";
	std::string grp = grpSS.str();

	try
	{
//		reg.add_function("LuaList_writeObjects", &LuaList_writeObjects, grp.c_str());
		reg.add_function("LuaWrite", &LuaWrite, grp.c_str());
		reg.add_function("LuaWriteCout", &LuaWriteCout, grp.c_str());
	}
	UG_REGISTRY_CATCH_THROW(grp);

	return true;
}
Example #5
0
void RegisterGridBridge_FileIO(Registry& reg, string parentGroup)
{
    string grp = parentGroup;

//	UGXFileInfo
    reg.add_class_<UGXFileInfo>("UGXFileInfo", grp)
    .add_constructor()
    .add_method("parse_file", &UGXFileInfo::parse_file, "", "filename")
    .add_method("num_grids", &UGXFileInfo::num_grids)
    .add_method("num_subset_handlers", &UGXFileInfo::num_subset_handlers)
    .add_method("num_subsets", &UGXFileInfo::num_subsets)
    .add_method("grid_name", &UGXFileInfo::grid_name, "grid name", "gridInd")
    .add_method("subset_handler_name", &UGXFileInfo::subset_handler_name, "", "gridInd#shInd")
    .add_method("subset_name", &UGXFileInfo::subset_name, "", "gridInd#shInd#subsetInd")
    .add_method("grid_has_volumes", &UGXFileInfo::grid_has_volumes, "", "gridInd")
    .add_method("grid_has_faces", &UGXFileInfo::grid_has_faces, "", "gridInd")
    .add_method("grid_has_edges", &UGXFileInfo::grid_has_edges, "", "gridInd")
    .add_method("grid_has_vertices", &UGXFileInfo::grid_has_vertices, "", "gridInd")
    .add_method("physical_grid_dimension", &UGXFileInfo::physical_grid_dimension, "", "gridInd")
    .add_method("topological_grid_dimension", &UGXFileInfo::topological_grid_dimension, "", "gridInd")
    .add_method("grid_world_dimension", &UGXFileInfo::grid_world_dimension, "", "gridInd")
    .set_construct_as_smart_pointer(true);

//  GridObject functions
    reg.add_function("LoadGrid", static_cast<bool (*)(Grid&, ISubsetHandler&, const char*)>(&LoadGrid), grp,
                     "", "grid#sh#filename")
    .add_function("LoadGrid", static_cast<bool (*)(Grid&, const char*)>(&LoadGrid), grp,
                  "", "grid#filename")
    .add_function("SaveGrid", static_cast<bool (*)(Grid&, const ISubsetHandler&, const char*)>(&SaveGrid), grp,
                  "", "grid#sh#filename")
    .add_function("SaveGrid", static_cast<bool (*)(Grid&, ISubsetHandler&, const char*)>(&SaveGrid), grp,
                  "", "grid#sh#filename")
    .add_function("SaveGrid", static_cast<bool (*)(Grid&, const char*)>(&SaveGrid), grp,
                  "", "grid#filename")
//			.add_function("LoadGridObject", &LoadGridObject, grp,
//					"", "go#filename")
//			.add_function("SaveGridObject", &SaveGridObject, grp,
//					"", "go#filename")
    .add_function("SaveGridHierarchy", &SaveGridHierarchy, grp,
                  "", "mg#filename")
    .add_function("SaveGridHierarchyTransformed",
                  static_cast<bool (*)(MultiGrid&, ISubsetHandler&, const char*, number)>(
                      &SaveGridHierarchyTransformed),
                  grp, "", "mg#sh#filename#offset")
    .add_function("SaveGridHierarchyTransformed",
                  static_cast<bool (*)(MultiGrid&, const char*, number)>(
                      &SaveGridHierarchyTransformed),
                  grp, "", "mg#filename#offset")
    .add_function("SaveParallelGridLayout", &SaveParallelGridLayout,
                  grp, "", "mg#filename#offset")
    .add_function("SaveSurfaceViewTransformed", &SaveSurfaceViewTransformed);
}
Example #6
0
void RegisterStandardBridges(Registry& reg, string parentGroup)
{
	try
	{
		// uncomment this to register test-methods
		//RegisterBridge_Test(reg, parentGroup);

		RegisterBridge_VecMath(reg, parentGroup);
		RegisterBridge_Util(reg, parentGroup);
		RegisterBridge_PCL(reg, parentGroup);

		RegisterBridge_Profiler(reg, parentGroup);
		RegisterBridge_Misc(reg, parentGroup);
		RegisterBridge_Raster(reg, parentGroup);
		RegisterBridge_OrthoPoly(reg, parentGroup);

		#ifdef UG_GRID
			RegisterBridge_Grid(reg, parentGroup);
		#endif
		
		#ifdef UG_ALGEBRA
			RegisterBridge_Selection(reg, parentGroup);
			RegisterBridge_Domain(reg, parentGroup);
			RegisterBridge_PeriodicBoundary(reg, parentGroup);
			RegisterBridge_Refinement(reg, parentGroup);
			RegisterBridge_DomainRayTracing(reg, parentGroup);
			RegisterBridge_Transform(reg, parentGroup);
			RegisterBridge_LoadBalancing(reg, parentGroup);

		//	depends on lib_disc
			RegisterBridge_DiscCommon(reg, parentGroup);
			RegisterBridge_ElemDiscs(reg, parentGroup);

		//	depends on lib_algebra
			RegisterBridge_AlgebraCommon(reg, parentGroup);
			RegisterBridge_Preconditioner(reg, parentGroup);
			RegisterBridge_Schur(reg, parentGroup);
			RegisterBridge_Obstacle(reg, parentGroup);
			RegisterBridge_PILUT(reg, parentGroup);
			RegisterBridge_Solver(reg, parentGroup);
			RegisterBridge_Eigensolver(reg, parentGroup);
			RegisterBridge_DomainDependentPreconditioner(reg, parentGroup);
			//RegisterBridge_ConstrainedLinearIterator(reg, parentGroup);

			RegisterBridge_Restart(reg, parentGroup);

		//	depends on lib_disc
			RegisterBridge_DiscAlgebra(reg, parentGroup);
			RegisterBridge_DomainDisc(reg, parentGroup);
			RegisterBridge_GridFunction(reg, parentGroup);
			RegisterBridge_Interpolate(reg, parentGroup);
			RegisterBridge_Evaluate(reg, parentGroup);
			RegisterBridge_MaxError(reg, parentGroup);
			RegisterBridge_Ordering(reg, parentGroup);
			RegisterBridge_UserData(reg, parentGroup);
			RegisterBridge_Constraints(reg, parentGroup);
			RegisterBridge_MultiGrid(reg, parentGroup);
			RegisterBridge_Output(reg, parentGroup);
			RegisterBridge_AdaptiveTools(reg, parentGroup);
			RegisterBridge_FiniteVolume(reg, parentGroup);
			RegisterBridge_Integrate(reg, parentGroup);
			RegisterBridge_ManifoldUtil(reg, parentGroup);
			RegisterBridge_ReferenceMappingTest(reg, parentGroup);
		#endif


	//	build a string with all compiled dimensions
		stringstream availDims; bool first = true;
#ifdef UG_DIM_1
		if(!first) {availDims << ",";}; availDims << "1";
		first = false;
#endif
#ifdef UG_DIM_2
		if(!first) {availDims << ",";}; availDims << "2";
		first = false;
#endif
#ifdef UG_DIM_3
		if(!first) {availDims << ",";}; availDims << "3";
		first = false;
#endif

#ifdef UG_ALGEBRA
		reg.add_function("InitUG", static_cast<void (*)(int, const AlgebraType&, bool)>(&InitUG), "/ug4/Init",
		                 "", string("Dimension|selection|value=[").append(availDims.str()).
		                 	 append("]#AlgebraType#verbose"));
		reg.add_function("InitUG", static_cast<void (*)(int, const AlgebraType&)>(&InitUG), "/ug4/Init",
		                 "", string("Dimension|selection|value=[").append(availDims.str()).
		                 	 append("]#AlgebraType"));
		reg.add_function("GetUGDim", &GetUGDim, "/ug4", "dimension", "", "Returns the dimension to which UG was initialized.");

	// 	AlgebraType Interface
		reg.add_class_<AlgebraType>("AlgebraType", "/ug4/Init")
			.add_constructor<void (*)(const char*, int)>("Type|selection|value=[\"CPU\"]#Blocksize|selection|value=[1,2,3,4]")
			.add_constructor<void (*)(const char*)>("Type|selection|value=[\"CPU\"]", "Variable Blocksize")
			.set_construct_as_smart_pointer(true);
#endif

	}
	UG_REGISTRY_CATCH_THROW("RegisterStandardInterfaces")
	UG_CATCH_THROW("RegisterStandardInterfaces failed.")

	reg.registry_changed();
}
Example #7
0
void RegisterGridBridge_Grid(Registry& reg, string parentGroup)
{
	string grp = parentGroup;
//	Geometric Objects
	reg.add_class_<GridObject>("GridObject", grp);
	reg.add_class_<Vertex, GridObject>("Vertex", grp);
	reg.add_class_<Edge, GridObject>("Edge", grp)
		.add_method("num_vertices", &Edge::num_vertices, grp)
		.add_method("vertex", &Edge::vertex, grp);
	reg.add_class_<Face, GridObject>("Face", grp)
		.add_method("num_vertices", &Face::num_vertices, grp)
		.add_method("vertex", &Face::vertex, grp);
	reg.add_class_<Volume, GridObject>("Volume", grp)
		.add_method("num_vertices", &Volume::num_vertices, grp)
		.add_method("vertex", &Volume::vertex, grp);

	reg.add_function("IsValid", &IsValidPtr<Vertex>, grp);
	reg.add_function("IsValid", &IsValidPtr<Edge>, grp);
	reg.add_function("IsValid", &IsValidPtr<Face>, grp);
	reg.add_function("IsValid", &IsValidPtr<Volume>, grp);

//	Grid
	reg.add_class_<Grid>("Grid", grp)
		.add_constructor()
		.add_method("clear", static_cast<void (Grid::*)()>(&Grid::clear))
		.add_method("clear_geometry", &Grid::clear_geometry)
		.add_method("num_vertices", &Grid::num_vertices)
		.add_method("num_edges", &Grid::num_edges)
		.add_method("num_faces", &Grid::num_faces)
		.add_method("num_triangles", &Grid::num<Triangle>)
		.add_method("num_quadrilaterals", &Grid::num<Quadrilateral>)
		.add_method("num_volumes", &Grid::num_volumes)
		.add_method("num_tetrahedrons", &Grid::num<Tetrahedron>)
		.add_method("num_pyramids", &Grid::num<Pyramid>)
		.add_method("num_prisms", &Grid::num<Prism>)
		.add_method("num_hexahedrons", &Grid::num<Hexahedron>)
		.add_method("reserve_vertices", &Grid::reserve<Vertex>, "", "num")
		.add_method("reserve_edges", &Grid::reserve<Edge>, "", "num")
		.add_method("reserve_faces", &Grid::reserve<Face>, "", "num")
		.add_method("reserve_volumes", &Grid::reserve<Volume>, "", "num")
		.set_construct_as_smart_pointer(true);

//	MultiGrid
	reg.add_class_<MultiGrid, Grid>("MultiGrid", grp)
		.add_constructor()
		.add_method("num_levels", &MultiGrid::num_levels)

		.add_method("num_vertices", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Vertex>)
		.add_method("num_edges", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Edge>)
		.add_method("num_faces", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Face>)
		.add_method("num_triangles", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Triangle>)
		.add_method("num_quadrilaterals", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Quadrilateral>)
		.add_method("num_volumes", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Volume>)
		.add_method("num_tetrahedrons", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Tetrahedron>)
		.add_method("num_pyramids", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Pyramid>)
		.add_method("num_prisms", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Prism>)
		.add_method("num_hexahedrons", (size_t (MultiGrid::*)(int) const) &MultiGrid::num<Hexahedron>)
		.set_construct_as_smart_pointer(true);

//	standard attachments
	reg.add_class_<AInt>("AInt");
	reg.add_class_<ANumber>("ANumber");
	reg.add_class_<APosition1>("APosition1");
	reg.add_class_<APosition2>("APosition2");
	reg.add_class_<APosition3>("APosition3");

//	geometry
	RegisterGeometry<1>(reg, grp);
	RegisterGeometry<2>(reg, grp);
	RegisterGeometry<3>(reg, grp);
}
Example #8
0
void RegisterGridBridge_Refinement(Registry& reg, string parentGroup)
{
	string grp = parentGroup;

	reg.add_class_<IRefinementCallback>("IRefinementCallback", grp);

//	IRefiner
	reg.add_class_<IRefiner>("IRefiner", grp)
		.add_method("refine", &IRefiner::refine)
		.add_method("coarsen", &IRefiner::coarsen)
		.add_method("save_marks_to_file", &IRefiner::save_marks_to_file, "", "filename")
		.add_method("set_adjusted_marks_debug_filename", &IRefiner::set_adjusted_marks_debug_filename, "", "filename")
		.add_method("mark_neighborhood",
					static_cast<void (IRefiner::*)(size_t)>(&IRefiner::mark_neighborhood),
					"", "numIterations")
		.add_method("clear_marks", &IRefiner::clear_marks)
		.add_method("set_refinement_callback", &IRefiner::set_refinement_callback)
		.add_method("enable_debugging", &IRefiner::enable_debugging)
		.add_method("num_marked_edges", static_cast<size_t (IRefiner::*)()>(&IRefiner::num_marked_edges))
		.add_method("num_marked_faces", static_cast<size_t (IRefiner::*)()>(&IRefiner::num_marked_faces))
		.add_method("num_marked_volumes", static_cast<size_t (IRefiner::*)()>(&IRefiner::num_marked_volumes))
		.add_method("num_marked_elements", static_cast<size_t (IRefiner::*)()>(&IRefiner::num_marked_elements));

//	HangingNodeRefiner
	reg.add_class_<HangingNodeRefiner_Grid, IRefiner>("HangingNodeRefiner_Grid", grp)
		.add_constructor()
		.add_method("assign_grid", &HangingNodeRefiner_Grid::assign_grid, "", "g")
		.set_construct_as_smart_pointer(true);

	reg.add_class_<HangingNodeRefiner_MultiGrid, IRefiner>("HangingNodeRefiner_MultiGrid", grp)
		.add_constructor()
		.add_method("assign_grid", &HangingNodeRefiner_MultiGrid::assign_grid, "", "mg")
		.set_construct_as_smart_pointer(true);

//	AdaptiveRegularMGRefiner
	reg.add_class_<AdaptiveRegularRefiner_MultiGrid, HangingNodeRefiner_MultiGrid>("AdaptiveRegularRefiner_MultiGrid", grp)
		.add_constructor()
		.add_method("assign_grid", &AdaptiveRegularRefiner_MultiGrid::assign_grid, "", "mg")
		.set_construct_as_smart_pointer(true);

//	GlobalMultiGridRefiner
	reg.add_class_<GlobalMultiGridRefiner, IRefiner>("GlobalMultiGridRefiner", grp)
		.add_constructor()
		.add_method("assign_grid", static_cast<void (GlobalMultiGridRefiner::*)(MultiGrid&)>(&GlobalMultiGridRefiner::assign_grid),
				"", "mg")
		.set_construct_as_smart_pointer(true);

//	FracturedMediaRefiner
	/*typedef FracturedMediaRefiner<typename TDomain::grid_type,
						  	  	  typename TDomain::position_attachment_type>	FracDomRef;
	reg.add_class_<FracDomRef, IRefiner>("FracturedMediumRefiner", grp)
		.add_constructor()
		.add_method("set_aspect_ratio_threshold", &FracDomRef::set_aspect_ratio_threshold);*/

//	GlobalFracturedDomainRefiner
	{
		typedef GlobalFracturedMediaRefiner cls;
		reg.add_class_<cls, IRefiner>("GlobalFracturedMediumRefiner", grp)
			.add_constructor()
			.add_method("assign_grid", static_cast<void (cls::*)(MultiGrid*)>(&cls::assign_grid), "", "g")
			.add_method("set_subset_handler", static_cast<void (cls::*)(ISubsetHandler*)>(&cls::set_subset_handler),
					"", "sh")
			.add_method("mark_as_fracture", &cls::mark_as_fracture, "", "subInd#bIsFracture")
			.add_method("is_fracture", &cls::is_fracture, "", "subInd")
			.set_construct_as_smart_pointer(true);
	}

//	parallel refinement
#ifdef UG_PARALLEL
	reg.add_class_<ParallelHangingNodeRefiner_MultiGrid, HangingNodeRefiner_MultiGrid>
		("ParallelHangingNodeRefiner_MultiGrid", grp)
		.add_constructor()
		.set_construct_as_smart_pointer(true);
/*Currently not directly usable. For domains, you may use the factory method
* GlobalFracturedDomainRefiner, which automatically creates a
* ParallelGlobalFracturedMediaRefiner, if required.
	reg.add_class_<ParallelGlobalFracturedMediaRefiner, GlobalFracturedMediaRefiner>
		("ParallelGlobalFracturedMediaRefiner", grp)
		.add_constructor()
		.set_construct_as_smart_pointer(true);
*/
#endif

//	refinement
	reg.add_function("TestSubdivision", &TestSubdivision, grp)
		.add_function("CreateHierarchy", &CreateHierarchy, grp)
		.add_function("CreateSmoothHierarchy", &CreateSmoothHierarchy, grp)
		.add_function("CreateSmoothVolumeHierarchy", &CreateSmoothVolumeHierarchy, grp)
		.add_function("CreateSemiSmoothHierarchy", &CreateSemiSmoothHierarchy, grp);

//	smooth volume subdivision
	reg.add_function("ApplySmoothSubdivisionToTopLevel", &ApplySmoothSubdivisionToTopLevel, grp);
	reg.add_function("ProjectHierarchyToLimitSubdivisionVolume", &ProjectHierarchyToLimitSubdivisionVolume, grp);
	reg.add_function("OctReferenceMappingTest", &OctReferenceMappingTest, grp);
	reg.add_function("TetReferenceMappingTest", &TetReferenceMappingTest, grp);
	reg.add_function("EdgeReferenceMappingTest", &EdgeReferenceMappingTest, grp);

//	register boundary refinement rule switch function for Subdivision Volumes smoothing
	reg.add_function("SetBoundaryRefinementRule", &SetBoundaryRefinementRule, grp, "", "bndRefRule",
			"Sets the boundary refinement rule used during Subdivision Volumes smoothing. Possible parameters: 'linear', 'subdiv_loop");
}
Example #9
0
void RegisterUserDataType(Registry& reg, string grp)
{
	string dimSuffix = GetDimensionSuffix<dim>();
	string dimTag = GetDimensionTag<dim>();

	string type = user_data_traits<TData>::name();

//	User"Type"
//	NOTE: For better readability this class is named User"Type"
//	      in vrl and lua. E.g. UserNumber, UserVector, ...
	{
		typedef UserData<TData, dim> T;
		typedef UserDataInfo TBase1;
		string name = string("User").append(type).append(dimSuffix);
		reg.add_class_<T,TBase1>(name, grp)
			.add_method("get_dim", &T::get_dim)
			.add_method("type", &T::type);
		reg.add_class_to_group(name, string("User").append(type), dimTag);
		reg.add_function("PrintUserDataValue", &PrintUserDataValue<TData, dim>,
						 grp, "", "userData#position#time#subsetIndex",
						 "Prints the value of the given user data at the given global position at the given time on the given subset.");
	}

//	CondUser"Type"
//	NOTE: For better readability this class is named CondUser"Type"
//	 	  in vrl and lua. E.g. CondUserNumber, CondUserVector, ...
	{
		typedef UserData<TData, dim, bool> T;
		typedef UserDataInfo TBase1;
		string name = string("CondUser").append(type).append(dimSuffix);
		reg.add_class_<T,TBase1>(name, grp);
		reg.add_class_to_group(name, string("CondUser").append(type), dimTag);
		reg.add_function("PrintUserDataValue", &PrintCondUserDataValue<TData, dim>,
						 grp, "", "userData#position#time#subsetIndex",
						 "Prints the value of the given user data at the given global position at the given time on the given subset.");
	}

//	CplUser"Type"
	{
		typedef CplUserData<TData, dim> T;
		typedef UserData<TData,dim> TBase1;
		string name = string("CplUser").append(type).append(dimSuffix);
		reg.add_class_<T,TBase1>(name, grp)
			.add_method("get_dim", &T::get_dim)
			.add_method("type", &T::type);
		reg.add_class_to_group(name, string("CplUser").append(type), dimTag);
	}

//	CondCplUser"Type"
	{
		typedef CplUserData<TData, dim, bool> T;
		typedef UserData<TData,dim,bool> TBase1;
		string name = string("CondCplUser").append(type).append(dimSuffix);
		reg.add_class_<T,TBase1>(name, grp);
		reg.add_class_to_group(name, string("CondCplUser").append(type), dimTag);
	}

//	DependentUserData"Type"
	{
		typedef DependentUserData<TData, dim> T;
		typedef CplUserData<TData, dim> TBase;
		string name = string("DependentUserData").append(type).append(dimSuffix);
		reg.add_class_<T, TBase >(name, grp);
		reg.add_class_to_group(name, string("DependentUserData").append(type), dimTag);
	}

//	ScaleAddLinker"Type"
	{
		typedef ScaleAddLinker<TData, dim, number> T;
		typedef DependentUserData<TData, dim> TBase;
		string name = string("ScaleAddLinker").append(type).append(dimSuffix);
		reg.add_class_<T, TBase>(name, grp)
			.add_method("add", static_cast<void (T::*)(SmartPtr<CplUserData<number,dim> > , SmartPtr<CplUserData<TData,dim> >)>(&T::add))
			.add_method("add", static_cast<void (T::*)(number , SmartPtr<CplUserData<TData,dim> >)>(&T::add))
			.add_method("add", static_cast<void (T::*)(SmartPtr<CplUserData<number,dim> > , number)>(&T::add))
			.add_method("add", static_cast<void (T::*)(number,number)>(&T::add))
			.add_constructor()
			.template add_constructor<void (*)(const ScaleAddLinker<TData, dim, number>&)>()
			.set_construct_as_smart_pointer(true);
		reg.add_class_to_group(name, string("ScaleAddLinker").append(type), dimTag);
	}

}