File: FEInternalForceEngine.hpp

package info (click to toggle)
yade 2026.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,448 kB
  • sloc: cpp: 97,645; python: 52,173; sh: 677; makefile: 162
file content (47 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*************************************************************************
*  Copyright (C) 2013 by Burak ER  burak.er@btu.edu.tr                	 *
*									 *
*                                                                        *
*  This program is free software; it is licensed under the terms of the  *
*  GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
#pragma once
#include <core/Callbacks.hpp>
#include <core/GlobalEngine.hpp>
#include <pkg/fem/FEInternalForceDispatchers.hpp>

namespace yade { // Cannot have #include directive inside.

#ifdef USE_TIMING_DELTAS
#define TIMING_DELTAS_CHECKPOINT(cpt) timingDeltas->checkpoint(cpt)
#define TIMING_DELTAS_START() timingDeltas->start()
#else
#define TIMING_DELTAS_CHECKPOINT(cpt)
#define TIMING_DELTAS_START()
#endif

class FEInternalForceEngine : public GlobalEngine {
	//	#ifdef YADE_OPENMP
	//		std::vector<std::list<idPair> > eraseAfterLoopIds;
	//		void eraseAfterLoop(Body::id_t id1,Body::id_t id2){ eraseAfterLoopIds[omp_get_thread_num()].push_back(idPair(id1,id2)); }
	//	#else
	//		list<idPair> eraseAfterLoopIds;
	//		void eraseAfterLoop(Body::id_t id1,Body::id_t id2){ eraseAfterLoopIds.push_back(idPair(id1,id2)); }
	//	#endif
public:
	void pyHandleCustomCtorArgs(boost::python::tuple& t, boost::python::dict& d) override;
	void action() override;
	// clang-format off
		YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(FEInternalForceEngine,GlobalEngine,"Unified dispatcher for handling Finite Element internal force loop at every step, for parallel performance reasons.\n\n.. admonition:: Special constructor\n\n\tConstructs from 3 lists of :yref:`Ig2<IGeomFunctor>`, :yref:`Ip2<IPhysFunctor>`, :yref:`Law<LawFunctor>` functors respectively; they will be passed to interal dispatchers, which you might retrieve.",
			((shared_ptr<InternalForceDispatcher>,internalforcedispatcher,new InternalForceDispatcher,Attr::readonly,":yref:`InternalForceDispatcher` object that is used for dispatching of element types."))
			,
			/*ctor*/
			,
			/*py*/
		);
	// clang-format on
	DECLARE_LOGGER;
};
REGISTER_SERIALIZABLE(FEInternalForceEngine);

} // namespace yade