211 {
213
214 using OP_SOURCE = typename FormsIntegrators<OpBase>::template Assembly<
216 using OP_TEMP = typename FormsIntegrators<OpBase>::template Assembly<
218
219 auto add_op = [&](auto &&meshset_vec_ptr) {
221 auto *json_config = m_field.
getInterface<JsonConfigManager>();
222 for (
auto m : meshset_vec_ptr) {
223 const auto params_from_json =
224 json_config->getParamsFromBlockset(block_name,
m->getMeshsetId());
225 double target_temperature = 0;
226 double beta = 0;
227 if (!params_from_json.empty()) {
228 target_temperature = params_from_json.at("target_temperature");
229 beta = params_from_json.at("beta");
230 } else {
231 std::vector<double> block_data;
232 m->getAttributes(block_data);
233 if (block_data.size() < 2) {
235 "Expected two parameters");
236 }
237 target_temperature = block_data[0];
238 beta = block_data[1];
239 }
240 auto ents_ptr = boost::make_shared<Range>();
242 *(ents_ptr), true);
243
245 <<
"Add " << *
m <<
" target temperature " << target_temperature
246 << " penalty " << beta;
247
248 auto op_source = new OP_SOURCE(
250 [target_temperature, beta](double, double, double) {
251 return target_temperature * beta;
252 },
253 ents_ptr);
254 op_source->feScalingFun = fe_fun;
255 pipeline.push_back(op_source);
256 auto op_temp = new OP_TEMP(
258 [beta](double, double, double) { return -beta; }, ents_ptr);
259 op_temp->feScalingFun = fe_fun;
260 pipeline.push_back(op_temp);
261 }
263 };
264
266
267 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
268
269 (boost::format("%s(.*)") % block_name).str()
270
271 ))
272
273 );
274
276
278 }
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
constexpr auto field_name
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.